[bug] Stop-hook updater reports skipped or failed updates as ok and repeats unsupported-install warnings
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- node.js, typescript
Research direction
Start with src/update.ts and src/hook-handlers.ts to trace how update outcomes reach Hook dispatch diagnostics. Read the existing update and hook handler tests, then add regression coverage for policy or layout skips and a doUpdate failure, including the recorded dispatch outcomes. Done means diagnostics distinguish success, skip, and failure, unchanged unsupported-install warnings are not repeated, and explicit teamai update shows the manual remedy.
Written by the indexing model from the issue text.
Description
Problem
The Stop-hook updater loses the actual update result. An unsupported installation produces a warning on every Stop, while the dispatcher records the update handler as ok. A returned install failure is also ignored by the handler.
Reproduced on released 0.29.0
macOS, Node 22.22.3, official Volta-managed [email protected]. Executed the real installed entry with an isolated HOME, a local fixture team config, updatePolicy: auto, and a fresh cached availableUpdate: "99.0.0".
99.0.0 is a controlled fixture to enter the update path; it is not an actual release. The Volta guard runs before npm installation. No package was installed or replaced.
Run three times:
printf '%s\n' '{"cwd":"<fixture-app>","session_id":"outcome-fixture"}' |
node <official-teamai-entry> hook-dispatch stop --tool claude --bg-only
Each run exits 0 and adds another warning:
[WARN] Self-update skipped: teamai at <HOME>/.volta/tools/image/packages/teamai-cli is managed by Volta. ... Upgrade with "volta install teamai-cli@latest".
The same three runs record:
update=33ms(ok)
update=32ms(ok)
update=32ms(ok)
The refusal to update a Volta image with npm is appropriate. The incorrect outcome and repeated warning are the problem.
Cause in current main
Verified in default-branch files:
- src/update.ts:
UpdateOutcomehas onlyok | failed. Unsupported layouts and policy skips returnok; install failures returnfailed. - src/hook-handlers.ts: the update handler awaits
doUpdate(config), discards its return value, then returnsnull. Both outcomes resolve normally and appear asokin dispatch diagnostics.
The failed-install case follows directly from this return-value path; the runtime reproduction above covers the unsupported-install case.
Expected behavior
- Distinguish completed update, intentional skip, and failure in Hook diagnostics.
- Preserve a real install failure as a failed handler outcome, even if the outer Hook deliberately exits 0 for host compatibility.
- Avoid repeating an unchanged unsupported-install warning on every agent turn. Retain a useful diagnostic/manual upgrade hint, and show the remedy for an explicit
teamai update. - Do not try to fix this by running npm inside a Volta image.
A regression should verify both policy/layout skips and a doUpdate failure, including their dispatch log outcomes.
- Dominant language
- TypeScript
- Stars
- 5.7k
- Forks
- 486
- Avg merge
- 13h 3m
- Merged PRs (30d)
- 474
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Tencent/teamai-cli
-
Lint rule: require `windowsHide: true` on every child_process call in production sourcePossibly taken @SaulMoro claimed this today. Openenhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Tencent/teamai-cli#1763 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 38/100
Tencent/teamai-cli#1753 · 2 comments ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 5/5 Over a week Newbie friendliness 32/100
Tencent/teamai-cli#1743 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 25/100
Tencent/teamai-cli#1722 ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 38/100
Tencent/teamai-cli#1721 ·
Maintainers usually reply within 1 day
All issues in Tencent/teamai-cli
Similar issues
-
Add: ESP 2 ROOpenapproved check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
ipaas: Configure form shows "Deploy to apply." and "Overrides selected Link" when they don't applyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
wso2/integration-control-plane#1118 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UTDNebula/utd-notebook#311 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day