fix: regenerate the skill changelog preview after the file set changes - #3296
Merged
Patrick-Erichsen merged 1 commit intoJul 30, 2026
Merged
Conversation
The publish form keyed its generated-changelog cache on the number of selected paths rather than the paths themselves, and never reset that key when the selection changed. Swapping one bundled file for another left the key untouched, so the form kept showing a changelog generated from the previous bundle even though the new path list is what gets sent to the preview action. The plugin publish form already keys on the joined paths and resets the cache when the file set changes; the skill form now does both.
Contributor
|
@Yigtwxx is attempting to deploy a commit to the OpenClaw Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
Thanks @Yigtwxx — much appreciated! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where publishers updating an existing skill see a generated
changelog that describes a bundle they are no longer publishing. Changing the
selected files in a way that keeps the file count the same — swapping one
bundled script for another, or replacing a helper file — leaves the previously
generated text in the "What changed" field.
The affected surface is the skill publish form in update mode
(
/skills/publish?updateSlug=...), where that field is prefilled fromskills.generateChangelogPreview.Why This Change Was Made
The form caches its last preview request in
changelogKeyRefso ordinaryre-renders do not re-run generation. The key was built from the slug, version,
SKILL.md size and
lastModified, andnormalizedPaths.length— the pathcount. The path list itself is what the form sends to the action as
filePaths, so two different bundles holding the same number of files producean identical key and the second request is skipped.
Nothing reset that key when the selection changed, and the generation effect
returns early while the field is non-empty. Together those two things mean that
once a preview has landed, no later change to the file set can replace it for
the rest of the session.
The plugin publish form already covers both halves of this in
src/routes/plugins/publish.tsx: it keys onnormalizedPaths.join("\0")andresets the cached key when the file set changes. The skill form now does the
same, so the two publish forms agree.
Manually written text is never discarded — the reset returns early when
changelogTouchedRefis set, and there is a regression test for that.Of the two changes, the reset is what restores the behavior; keying on the joined
paths removes the underlying mismatch so the guard no longer depends on the reset
for correctness, and matches the sibling form.
Non-goals, kept out to hold the change to one concern:
extracting a common hook is a separate refactor.
User Impact
The generated changelog now describes the bundle that is actually about to be
published. Previously a publisher who swapped a file after the first preview
landed would either submit a changelog naming a file that is no longer in the
upload, or have to notice the problem and overwrite the field by hand.
Evidence
Base commit:
79ef4af1. The fix is not present onmain—changelogKeyRefthereis still built from
normalizedPaths.length, and the skill form has no effect thatresets it.
Behavior read out of the mounted
Uploadform. The sameSKILL.mdinstance isreused across both selections so its
sizeandlastModifieddo not change; onlya sibling file is swapped, keeping the path count at two:
[SKILL.md, scripts/alpha.sh]- Generated for [SKILL.md, scripts/alpha.sh][SKILL.md, scripts/beta.sh]filePaths["SKILL.md","scripts/alpha.sh"], field unchangedfilePaths["SKILL.md","scripts/beta.sh"], field shows- Generated for [SKILL.md, scripts/beta.sh]The new regression test fails on the parent commit and passes with the fix:
The second new test (
keeps a manually written changelog when the file set changes) passes on both sides — it guards the reset against discarding text thepublisher typed.
Both publish route suites together, to confirm the plugin form is unaffected:
Gates run locally on Windows:
bunx tsc --noEmit— cleanbun run lint— cleanbun run deadcode:ci— cleanbun run format:check— the only two files it reports areCLAUDE.mdand.agents/skills/autoreview/CLAUDE.md; both report identically on an unmodifiedcheckout of
79ef4af1, so they are pre-existing and untouched here.bun run ci:unit— 5541 passed. The 24 failures are pre-existing on thisplatform:
79ef4af1fails the same 14 files with the same 24 tests (5539passed there, the difference being the two tests added by this PR). They are the
scripts/worker, CLI and security-dataset suites that shell out tobun, plusconvex/lib/githubAccount.test.tsandsrc/routes/-management.test.tsx. LinuxCI is the authoritative signal.
The Vercel preview check will need OpenClaw Foundation team authorization, as with
other fork pull requests.