fix(local-agent): report detected agent version, not teamai-cli's own#171
Merged
jeff-r2026 merged 1 commit intoJul 9, 2026
Merged
Conversation
`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>
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.
Problem
buildReportPayload(the HTTPreportAndSyncLocalAgentpath) setagent_versionfromgetCurrentVersion(), 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: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.tsbuildReportPayload(wrong):getCurrentVersion()— teamai-cli's own package version.Fix
Switch
buildReportPayloadtogetAgentVersion(tool), the same per-agent detectorstatus-report.tsalready uses (claude/codebuddy --version, IDEInfo.plist). UnusedgetCurrentVersionimport removed. Two-line change.Test Plan
npx tsc --noEmit— passesnpx vitest run src/__tests__/local-agent.test.ts src/__tests__/status-report.test.ts— 22 passednpm run build— success$HOME, mock HTTP endpoint viaTEAMAI_HTTP_ENDPOINT, triggerhook-dispatch session-start --stdin):--tool claude→ report body"agent_version":"2.1.205"(matchesclaude --version), not0.17.2✅--tool codebuddy→ report body"agent_version":"2.117.2"(matchescodebuddy --version), not0.17.2✅🤖 Generated with Claude Code