You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this — root cause is spot on, and the negative-control E2E (proving the old file is actually rejected before validating the fix) is excellent.
One blocker before merge (P1): routing all tools through renderForTool introduces a new regression for Codex-family tools.
renderForCodex / renderForCodexInternal return ext: '.toml' (agent-format.ts:165,173), and codex / codex-internal / tcodex all have an agents path in the default toolPaths and are in ALL_SUPPORTED_TOOLS. So on a machine with Codex installed, recall enable now writes .codex/agents/teamai-recall.toml (previously copyFile produced teamai-recall.md).
Both removal paths hardcode .md: recall-toggle.ts:33 (remove(.../teamai-recall.md)) and uninstall.ts:294 (${name}.md).
Result:teamai recall disable and teamai uninstall can no longer delete the generated .toml — Codex users are left with a permanent orphan file. This did not happen before the change (Codex got a .md, which the removal paths could delete).
The new tests do not catch it because every case only configures opencode as a target — there is no Codex target exercised.
Suggested fix (any one):
Derive the extension in the removal paths from renderForTool(spec, tool).ext instead of hardcoding .md (most thorough), or
Skip non-.md targets (Codex family) in the deploy loop with a warning, or
Constrain built-in recall deployment via spec.targets.
Please add a regression test with a Codex target covering enable -> disable leaves no orphan.
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
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.
Summary
修复启用 recall 后,TeamAI 将 Claude 格式的内置代理配置直接复制到 OpenCode,导致 OpenCode 配置校验失败、无法启动的问题。
内置代理现在会复用现有的目标工具原生渲染流程。OpenCode 生成的代理配置使用
mode: subagent,不再包含 Claude 专用的name和字符串格式的tools字段。对于尚无原生渲染器的目标工具,将跳过部署并输出可操作的警告。Type of Change
Test Plan
npx tsc --noEmit通过npx vitest run --coverage通过npm run build通过tools字段失败teamai recall enable和teamai pull --force本地验证结果:
src/builtin-agents.ts语句覆盖率为 81.94%1.18.23Related Issues
Fixes #332
Notes for Reviewers
内置 recall agent 仍以 Claude Markdown 格式作为唯一源文件,部署时通过现有的
reverseFromClaude和renderForTool转换成不同工具的原生格式。本次修改没有为 OpenCode 单独维护第二份模板,避免内置代理与普通团队代理的渲染逻辑继续分叉。
真实 OpenCode E2E 包含负向对照:先确认旧版原样复制的配置确实会被 OpenCode 拒绝,再验证修复后的生成文件和完整配置均能通过校验。