feat(skills): offer to update stale skills after commands - #237
Open
gjtorikian wants to merge 3 commits into
Open
feat(skills): offer to update stale skills after commands#237gjtorikian wants to merge 3 commits into
gjtorikian wants to merge 3 commits into
Conversation
Skills ship inside the binary and are copied into each agent's skills dir, so every CLI release that bumps @workos/skills silently leaves installed copies behind. The only signal was `workos doctor`, which nobody runs routinely, and the setup offer never re-fires once completed — so a user who set up once would never learn their skills were stale. After each successful command in a human TTY, offer to refresh agents whose version marker trails the bundled version. Mirrors wrangler's update prompt (cloudflare/workers-sdk#14872) minus the network: the latest version is whatever this binary bundles, so there is no remote fetch, cache, or cooldown to manage. The prompt defaults to No (AUTH-6734: an absent-minded Enter never writes to an agent dir), honours a prior setup decline, and is asked at most once per bundled version — a "no" is remembered until a newer CLI ships newer skills. Ctrl-C is not remembered, matching setup.
|
…irected stdin Two review findings on the stale-skills offer: refreshWorkOSSkills is truthy as soon as one agent lands, so a multi-agent refresh where one target failed was reported as a clean success. The offered version is recorded before the refresh — deliberately, so a persistently broken refresh cannot nag after every command — which meant the failed agent stayed stale with no second offer and no mention of it. Partial refreshes now name what did not update and point at `workos skills install`. Interaction mode is resolved from stdout/stderr, so `workos org list </dev/null` still resolves to human mode: the offer printed, ui.confirm threw on the non-TTY stdin, and the catch swallowed it before the version was recorded — so every later command re-printed an offer nobody could answer. Gate on process.stdin.isTTY before any prompt-related output.
A partial refresh left the failed agent stale with no further automatic offer: the bundled version is recorded before the refresh runs, so the warning plus `workos skills install` was the only remaining path. Some agents landing proves the refresh mechanism works, so the miss is worth retrying. A partial outcome now clears the recorded version and marks the version retried, which re-opens the offer for exactly one more command; a second incomplete refresh lets the recorded version stand. The pre-refresh record stays: a refresh that throws, or a process killed mid-way, must not turn into an offer after every subsequent command. A refresh that lands nothing at all is still remembered outright, since nothing about it suggests a retry would fare better.
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
skills/dir, so every release that bumps@workos/skillsleaves installed copies behind. Until now the only signal wasworkos doctor, and the setup offer never re-fires once completed — a user who set up once would never learn their skills were stale..workos-skill-versionmarker trails the bundled version. ("latest" is whatever this binary bundles, so there is no remote fetch, cache, or cooldown.)checkSkills()(doctor's staleness check) for detection andrefreshWorkOSSkills()(atomic per-skill backup/rename) for the refresh. The new code is the prompt and its gating.preferences.json(setup.skillsUpdateOfferedVersion) until a newer CLI ships newer skills. Ctrl-C is not remembered, matching setup.root(--help/--version),skills,setup,doctor.