[bug] Stop-hook updater reports skipped or failed updates as ok and repeats unsupported-install warnings

Open
#1,752 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@YogeLiu is already working on this.

Since Nov 6, 2026.

  • #1755 by @YogeLiu — open

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
Domain
cli, devtools

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: UpdateOutcome has only ok | failed. Unsupported layouts and policy skips return ok; install failures return failed.
  • src/hook-handlers.ts: the update handler awaits doUpdate(config), discards its return value, then returns null. Both outcomes resolve normally and appear as ok in 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Tencent/teamai-cli

All issues in Tencent/teamai-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.