Skip to content
This repository was archived by the owner on Jul 30, 2026. It is now read-only.

fix(agents): collapse unstable OMP and Claude identities - #140

Merged
makoMakoGo merged 3 commits into
personal/local-clientsfrom
fix/omp-swarm-grouping
Jul 13, 2026
Merged

fix(agents): collapse unstable OMP and Claude identities#140
makoMakoGo merged 3 commits into
personal/local-clientsfrom
fix/omp-swarm-grouping

Conversation

@makoMakoGo

@makoMakoGo makoMakoGo commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • group canonical OMP swarm artifacts under the shared OMP Swarm reporting identity
  • collapse unknown Claude sidechain agentType and subagent_type values into Claude Subagent
  • preserve raw OMP artifact stems and Claude agent IDs as instance identities
  • invalidate source-message and TUI caches so stale detailed labels are rebuilt

Why

The Agents tab is an accounting view whose primary key must be a stable agent type. OMP swarm artifact names and one-off Claude task labels were being used as grouping identities, creating many low-value rows. Claude's behavior also contradicted ADR 0006, which requires unknown temporary sidechain names to use the generic Claude Subagent identity.

Impact

OMP swarm usage now appears in one OMP Swarm row. Claude retains known stable roles such as Explore, Plan, and General Purpose while temporary labels are aggregated into Claude Subagent. Token, cost, message, and instance accounting remain intact.

Validation

  • cargo fmt --all -- --check
  • cargo test
  • cargo build --release -p tokscale-cli
  • rebuilt the real TUI cache with the installed binary: Claude rows decreased from 28 to 6 and temporary custom rows from 22 to 0

Summary by cubic

Stabilizes agent grouping in the Agents tab and enables coverage on PRs. OMP swarm artifacts now report as "OMP Swarm", and unknown Claude sidechains report as "Claude Subagent", reducing noisy rows while preserving instance-level accounting.

  • Bug Fixes
    • Group all OMP swarm artifacts under the shared "OMP Swarm" identity; keep the artifact stem as the instance ID.
    • Collapse unknown Claude agentType/subagent_type values to "Claude Subagent"; keep known roles (Explore, Plan, General Purpose).
    • Bump parser revisions and the TUI cache schema to 30 to rebuild stale labels; update tests and ADR 0006 for the new rules.
    • Run coverage on pull requests and the default branch; treat error backtraces as distinct from panics so cargo tarpaulin can cover the malformed-config path.

Written for commit 6800834. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • 改进

    • 优化 Claude 子代理名称显示,无法识别的自定义类型将统一显示为“Claude Subagent”。
    • 统一 OMP Swarm 的代理分组名称为“OMP Swarm”,同时保留实例信息以区分不同任务。
    • 更新解析与缓存兼容性标识,确保新旧数据按正确规则处理。
  • 文档

    • 补充 OMP 代理身份与实例标识的说明。

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5b47d877-3a64-44e0-8327-0ba183f61af3

📥 Commits

Reviewing files that changed from the base of the PR and between 3f06750 and 6800834.

📒 Files selected for processing (8)
  • .github/workflows/test_coverage.yml
  • crates/tokscale-cli/src/tui/cache.rs
  • crates/tokscale-cli/tests/cli_tests.rs
  • crates/tokscale-core/src/adapters/claude.rs
  • crates/tokscale-core/src/adapters/omp.rs
  • crates/tokscale-core/src/sessions/claudecode.rs
  • crates/tokscale-core/src/sessions/pi.rs
  • docs/adr/0006-agent-identity-for-agents-tab.md

Walkthrough

本次更新调整 Claude 与 OMP 的代理身份解析和版本标识,提高 TUI 缓存 schema 版本,修改 CLI 测试断言,并放宽覆盖率工作流的执行条件。

Changes

代理身份解析

Layer / File(s) Summary
Claude 子代理身份与版本
crates/tokscale-core/src/adapters/claude.rs, crates/tokscale-core/src/sessions/claudecode.rs
Claude 解析器修订号递增;未知 agentTypesubagent_type 统一解析为 Claude Subagent,相关测试断言同步更新。
OMP swarm 共享身份
crates/tokscale-core/src/adapters/omp.rs, crates/tokscale-core/src/sessions/pi.rs, docs/adr/0006-agent-identity-for-agents-tab.md
OMP swarm 的 agent 统一为 OMP Swarmagent_instance 保留各 artifact 的独立标识,解析器修订号和 ADR 表述同步调整。

CLI 缓存与错误输出

Layer / File(s) Summary
TUI 缓存 schema 兼容性
crates/tokscale-cli/src/tui/cache.rs
磁盘缓存 schema 版本从 28 更新为 30。
CLI 错误输出验证
crates/tokscale-cli/tests/cli_tests.rs
malformed display config 测试移除 backtrace 断言,仅保留不包含 panicked 的断言。

覆盖率工作流

Layer / File(s) Summary
Coverage 执行条件
.github/workflows/test_coverage.yml
coverage 任务支持 pull request 或默认分支执行;tarpaulin 安装取消原有门控,覆盖率工件上传仅检查未取消状态。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Poem

小兔蹦跳过代码田,
Claude 身份归一线。
OMP swarm 同名聚,
实例各自留印记。
覆盖率门开得宽,
缓存新章亮闪闪!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题简洁且准确概括了本次对 OMP 与 Claude 代理身份稳定化的核心变更。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/omp-swarm-grouping

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 12, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 27 untouched benchmarks


Comparing fix/omp-swarm-grouping (6800834) with personal/local-clients (3f06750)

Open in CodSpeed

Treat anyhow error backtraces as distinct from panic output so tarpaulin can exercise the malformed-config CLI path.
@makoMakoGo
makoMakoGo marked this pull request as ready for review July 13, 2026 02:12

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Re-trigger cubic

@makoMakoGo
makoMakoGo merged commit 4956195 into personal/local-clients Jul 13, 2026
11 checks passed
@makoMakoGo
makoMakoGo deleted the fix/omp-swarm-grouping branch July 13, 2026 02:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant