1154761334/it-bidding-copilot/heterogeneous-agent
Claude Code and agent skill by 1154761334/it-bidding-copilot
- community
Checking that the SKILL.md file is still in the repository.
Guide for implementing and debugging LobeHub heterogeneous agent integrations such as Claude Code, Codex, and future external CLI agents. Use when working on adapter event mapping, Electron IPC transport, renderer persistence, tool-call chaining, subagent threads, resume/session handling, or regressions like mixed multi-tool messages, broken step boundaries, stuck tool loading, and orphan tool messages. Triggers on 'heterogeneous agent', 'hetero agent', '异构 agent', 'claude code adapter', 'codex adapter', 'external agent CLI', '孤立 tool 消息', 'raw Codex trace', or adapter/executor bugs.
Install
npx vskill@latest install 1154761334/it-bidding-copilot/heterogeneous-agentSKILL.md
The same SKILL.md was published earlier as 1154761334/it-bidding-copilot/heterogeneous-agent.
Heterogeneous Agent Development
Use this skill when the bug or feature lives in the external CLI agent pipeline, not the normal server-side agent runtime.
Use This Skill For
- Adding or changing a driver under
apps/desktop/src/main/modules/heterogeneousAgent/drivers/ - Editing an adapter under
packages/heterogeneous-agents/src/adapters/ - Debugging
heteroAgentRawLinetransport,window.__HETERO_AGENT_TRACE, orexecuteHeterogeneousAgent - Fixing Claude Code stream-json bugs such as duplicate partial/full chunks, broken
message.idboundaries, missingtool_result, TodoWrite state drift, or subagent thread routing - Fixing Codex JSONL bugs such as mixed multi-tool messages, broken turn boundaries, or missing tool-result mapping
- Fixing step-boundary, tool persistence, subagent thread, or resume bugs in Claude Code / Codex flows
- Reproducing multi-tool mixing, orphan tool messages, or stuck tool-result loading
Pipeline Map
- CLI raw stdout / JSONL
- Electron main spawns the CLI and broadcasts
heteroAgentRawLine - Adapter maps raw provider events into
HeterogeneousAgentEvent executeHeterogeneousAgentpersists assistant/tool messages and forwards stream eventscreateGatewayEventHandlerhydrates the UI- Only after this path looks correct should you move on to
agent-tracingor context-engine debugging
Read These Files First
apps/desktop/src/main/controllers/HeterogeneousAgentCtr.tsapps/desktop/src/main/modules/heterogeneousAgent/drivers/claudeCode.tsapps/desktop/src/main/modules/heterogeneousAgent/drivers/codex.tspackages/heterogeneous-agents/src/adapters/claudeCode.tspackages/heterogeneous-agents/src/adapters/codex.tssrc/store/chat/slices/aiChat/actions/heterogeneousAgentExecutor.tssrc/store/chat/slices/aiChat/actions/__tests__/heterogeneousAgentExecutor.test.ts
Default Debug Order
- Prove whether the raw CLI output is correct before touching UI code.
- If raw output is correct, compare it with adapter output. In dev,
executeHeterogeneousAgentexposeswindow.__HETERO_AGENT_TRACE. - If adapted events look correct, inspect
persistToolBatch,persistToolResult, step transitions, and subagent routing. - Turn the repro into a focused test before fixing.
- Only after the transport/adapter/executor path looks sound should you debug later-stage message processing.
Critical Invariants
- One raw tool item must map to one stable
ToolCallPayload.id. - A new main-agent step must emit a boundary signal before events are forwarded to the new assistant.
- In Claude Code, multiple assistant events with the same
message.idare one turn, not multiple turns. - In Claude Code,
tool_resultlives intype: 'user'events, not assistant events. - In Claude Code partial mode,
message_delta.usageis authoritative; do not trust echoed usage on every assistant block. persistToolBatchmust pre-register assistanttools[]before creating tool messages.- Every tool message must keep
parentIdequal to the owning assistant andtool_call_idequal to the tool id. tool_resultmust resolve an existingtoolMsgIdByCallId.- Subagent chunks must stay in thread scope and must not be forwarded into the main assistant stream.
- Never clear the global
toolMsgIdByCallIdmap at main step boundaries.
Common Bug Patterns
- Claude Code duplicates text or thinking:
check whether partial deltas and the later full assistant block are both being emitted.
- Claude Code opens too many assistant messages:
check whether the adapter is cutting steps on every assistant event instead of only on message.id changes.
- Claude Code tool results never land:
check whether type: 'user' tool_result blocks are being ignored because the code only inspects assistant events.
- Claude Code TodoWrite cards look stale:
check whether synthesized pluginState.todos is being attached at tool-result time.
- Claude Code subagent transcript leaks into the main bubble:
check parent_tool_use_id handling and whether subagent chunks are being forwarded to the main gateway handler.
- Multiple Codex tools collapse into one assistant message:
first check whether the adapter emits a usable step boundary such as newStep or an equivalent turn-change signal.
- Orphan tool messages:
first check step-transition ordering and whether persistToolBatch Phase 1 ran before tool message creation.
- Tool bubble stays loading:
look for tool_result for unknown toolCallId and missing result_msg_id backfill.
- Subagent tools show up in the main bubble:
check for subagent chunks reaching the main gateway handler.
References
- For commands, trace capture, invariants, and focused test commands, read references/debug-workflow.md.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingfrontend/.agents/skills/heterogeneous-agent/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/1154761334/it-bidding-copilot/heterogeneous-agent)