From 7b21839e07e103636e2572e7de41ce456f1b1000 Mon Sep 17 00:00:00 2001 From: jeffyxu Date: Thu, 9 Jul 2026 13:48:34 +0800 Subject: [PATCH] fix(local-agent): report detected agent version, not teamai-cli's own MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 --- src/local-agent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/local-agent.ts b/src/local-agent.ts index 5a2cfae..a2b0c23 100644 --- a/src/local-agent.ts +++ b/src/local-agent.ts @@ -22,7 +22,7 @@ import { ResourceHandler } from './resources/base.js'; import { RulesHandler, SkillsHandler } from './resources/index.js'; import { injectHooksToAllTools } from './hooks.js'; import { parseHookEvent, appendEvent, compactEvents } from './dashboard-collector.js'; -import { getCurrentVersion } from './package-info.js'; +import { getAgentVersion } from './agent-version.js'; import { getMachineId, deriveLocalAgentId } from './machine-id.js'; import { EXCLUDED_RULE_NAMES } from './builtin-rules.js'; import { assertSafeResourceName } from './utils/path-safety.js'; @@ -662,7 +662,7 @@ export async function buildReportPayload( const payload: Record = { agent_type: tool, - agent_version: getCurrentVersion(), + agent_version: await getAgentVersion(tool), local_agent_id: resolveLocalAgentId(context), host_name: os.hostname(), os: os.platform(),