fix(statusline): write statusLine.type so settings.json stays valid - #16
Open
nikhilmeenaa wants to merge 1 commit into
Open
fix(statusline): write statusLine.type so settings.json stays valid#16nikhilmeenaa wants to merge 1 commit into
nikhilmeenaa wants to merge 1 commit into
Conversation
The installer wired the statusline by writing the two settings keys
independently, which left settings.json in a state Claude Code's schema
rejects — breaking startup with a "Settings Error":
- install wrote `statusLine.command` but never `statusLine.type`, so
Claude reported `statusLine.type: Invalid value. Expected "command"`.
- clear/uninstall deleted `command` but left `{ type: "command" }`, so
Claude reported `statusLine.command: Expected string, received undefined`.
Because `selfHealStatusline` runs on every activation, the broken block
was rewritten on every session, so the error recurred even after a
manual fix.
Introduce `writeStatuslineCommand()` which manages the block atomically:
a non-empty command writes `{ type: "command", command }` (type first so
disk is never momentarily invalid); an empty command removes the whole
`statusLine` object (an empty `{}` fails the same "type required" check).
Wire it into install, clearTapFromOtherScopes, and uninstall.
Add a regression test asserting `statusLine.type` is written on install,
and update the clear test to expect whole-object removal.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The installer wired the statusline by writing the two settings keys independently, which left settings.json in a state Claude Code's schema rejects — breaking startup with a "Settings Error":
statusLine.commandbut neverstatusLine.type, so Claude reportedstatusLine.type: Invalid value. Expected "command".commandbut left{ type: "command" }, so Claude reportedstatusLine.command: Expected string, received undefined.Because
selfHealStatuslineruns on every activation, the broken block was rewritten on every session, so the error recurred even after a manual fix.Introduce
writeStatuslineCommand()which manages the block atomically: a non-empty command writes{ type: "command", command }(type first so disk is never momentarily invalid); an empty command removes the wholestatusLineobject (an empty{}fails the same "type required" check). Wire it into install, clearTapFromOtherScopes, and uninstall.Add a regression test asserting
statusLine.typeis written on install, and update the clear test to expect whole-object removal.What & why
Closes #
Type of change
Checklist
npm run check(Biome) passesnpm run typecheckpassesnpm testpasses; new/changed source has co-located__tests__coveragenpm run buildsucceedsnpm run sizeis within budget (note any intentional budget change)src/corenovscode;webview/no Node/vscode)Testing notes