Skip to content

fix(local-agent): report detected agent version, not teamai-cli's own#171

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
jeff-r2026:fix/local-agent-report-real-agent-version
Jul 9, 2026
Merged

fix(local-agent): report detected agent version, not teamai-cli's own#171
jeff-r2026 merged 1 commit into
Tencent:mainfrom
jeff-r2026:fix/local-agent-report-real-agent-version

Conversation

@jeff-r2026

Copy link
Copy Markdown
Collaborator

Problem

buildReportPayload (the HTTP reportAndSyncLocalAgent path) set agent_version from getCurrentVersion(), which returns teamai-cli's own package version (e.g. 0.17.2). As a result every report carried the CLI's version instead of the reported agent's real version.

Observed in ~/.teamai/debug.log — a codebuddy report showed the CLI version instead of the installed CodeBuddy build:

[DEBUG] [2bcf67] [codebuddy]   body: {"agent_type":"codebuddy","agent_version":"0.17.3-beta.10", ...}

Root cause

Two report paths existed with divergent version sources:

  • status-report.ts (correct): getAgentVersion(agentType) — detects the target tool's real version.
  • local-agent.ts buildReportPayload (wrong): getCurrentVersion() — teamai-cli's own package version.

Fix

Switch buildReportPayload to getAgentVersion(tool), the same per-agent detector status-report.ts already uses (claude/codebuddy --version, IDE Info.plist). Unused getCurrentVersion import removed. Two-line change.

Test Plan

  • npx tsc --noEmit — passes
  • npx vitest run src/__tests__/local-agent.test.ts src/__tests__/status-report.test.ts — 22 passed
  • npm run build — success
  • End-to-end (isolated $HOME, mock HTTP endpoint via TEAMAI_HTTP_ENDPOINT, trigger hook-dispatch session-start --stdin):
    • --tool claude → report body "agent_version":"2.1.205" (matches claude --version), not 0.17.2
    • --tool codebuddy → report body "agent_version":"2.117.2" (matches codebuddy --version), not 0.17.2

🤖 Generated with Claude Code

`buildReportPayload` set `agent_version` from `getCurrentVersion()`, which
returns teamai-cli's own package version (e.g. 0.17.2). So every report —
regardless of the agent being reported — carried the CLI version instead of
the target tool's real version. In debug.log a codebuddy report showed
`"agent_version":"0.17.3-beta.10"` rather than the installed CodeBuddy build.

Switch to `getAgentVersion(tool)`, the same per-agent detector the
status-report path already uses (claude/codebuddy --version, IDE Info.plist).
Now reports carry the real version of the reported agent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jeff-r2026 jeff-r2026 merged commit 5a2b251 into Tencent:main Jul 9, 2026
7 checks passed
@jeff-r2026 jeff-r2026 deleted the fix/local-agent-report-real-agent-version branch July 9, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant