Repository navigation
feat: daily check for a newer Claude adapter, and model update to install it - #117
Merged
Merged
Conversation
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.
Summary
The
modellist went stale for four months without anyone noticing: hash shows whateverclaude-agent-acpreports, and that list is baked into the Claude Code binary bundled in the npm package. Nothing updates a globalnpm install -g.This PR makes hash notice and offer the fix, Ghostty-style (
check, never a silent install):package.json, and asks the npm registry forlatestat most once per 24h across all sessions (state in<data dir>/agent-update.json). Offline or unknown layout: silent.model updatepre-filled as ghost text. At most once a day per version. A pending learned fix outranks it. A notice the adapter has already caught up with is dropped unseen.model update. Prints the exactnpm install -g …command, streams npm's output dim and indented, reports OSC 9;4 progress and OSC 7501 status, restarts the agent (the pinned model survives), and shows the fresh model list withnewtags. Every failure (no npm, EACCES, prefix mismatch, restart failure) names the manual command or the next step. Ctrl-C cancels npm, not hash.statusshows the adapter version andX available · model updatewhen behind.[agent] auto_update = "check" | "off"(defaultcheck). Only the npm-installed@agentclientprotocol/claude-agent-acpis handled; other agents are untouched.New leaf package
internal/agentupdate(standard library only) owns detection, registry, state, throttle rules, and the installer, all with injected clock, PATH lookup, and process runner. No new dependencies.Not in scope
auto_update = "install"): left as a documented future value.Test plan
go vet ./... && go test ./...green; golangci-lint 0 issues.model updatesuccess/failure paths with a fake installer and transport, OSC 7501 pairing,statusrendering, stale-notice drop.ls,model updateghost text,statuslines, no banner and no registry call on a second launch the same day.model updaterun on a 0.42.0 install: npm output, agent restart, fresh model card (Opus 5.5, Fable 5.1, Sonnet 5.5, Haiku 5.5).Known, pre-existing, unrelated: the whole
internal/shellpackage fails under-raceon a data race insidegithub.com/chzyer/readline; the new tests pass under-racewhen run on their own.Docs: README and
docs/config-reference.mdhere; the website docs guide gets a one-lineauto_updatenote in the hash-website repo (separate commit, not yet pushed).