本文へ移動
cccskills
無料GitHub で公開日本語紹介

heterogeneous-agent

Claude CodeやCodexなど外部エージェントの起動から、イベント変換、ツール実行結果の保存、会話への反映までを追い、連携処理の不具合を調べます。

原文原文の説明を見る

Use for external-agent launchers and execution identity, Claude Code/Codex adapters, IPC, event mapping, sessions, persistence and tool-call chains.

lobehub/lobehubスター 83,506(GitHub 83,506 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • Claude Codeのイベント処理を調べたいとき
  • Codexのツール結果を追跡したいとき
  • 外部エージェントの起動情報を確認したいとき
  • サブエージェントの表示不具合を調べたいとき

日本語での紹介

できること

Claude CodeやCodexなど、外部CLIエージェントをアプリから起動する処理の調査・変更を支援します。CLIの生出力からアダプターによるイベント変換、アシスタントやツールメッセージの保存、画面への反映まで、処理の流れに沿って問題の箇所を切り分けます。ターン境界やツール結果の対応付け、サブエージェントのスレッド分離、再開時の状態、起動プロセスに渡す実行主体の識別情報なども扱います。実際のトレースを確認し、再現を絞ったテストにつなげる手順が示されています。

こんなときに便利

外部エージェントの返答が重複する、ツール実行結果が表示されない、複数のツール呼び出しが一つにまとまるといった連携不具合の調査に向いています。コメントの投稿者が誤って記録される場合や、サブエージェントの内容がメインの会話に混ざる場合にも、起動から保存までを順に追えます。

使い方の例

  • 「Claude Codeのツール結果が会話に表示されない原因を追って」
  • 「Codexの複数ツール呼び出しが一つにまとまる箇所を調べて」
  • 「起動したエージェントの識別情報とコメント投稿者の流れを確認して」

注意点

対象は通常のサーバー側エージェント実行環境ではなく、外部CLIエージェントのパイプラインです。実モデルとの互換性確認は、指定された専用スキルを利用者が明示的に呼び出す場合に限られます。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

資料チェック

SKILL.md の記述から、注意が要る操作と導入の前提を AI が確認しました。点数は実際に動かした結果(実行検証)だけで付けています。

安全面送信・削除・コマンド実行などの扱いが明示されているか
B一部不足実トレースの読み取りやCLI起動情報の扱いがある一方、秘密ファイルを直接読まない指示もあります。
導入のしやすさ必要なツールや API キーが少ないか、書かれているか
B一部不足対象リポジトリのコードとトレース、CLI・Desktop構成の知識を前提とします。

点数には入れていません。 2026年10月26日 時点で AI(OpenAI Codex)が判定しました。目安なので、入れる前に原文も確認してください。

評価が違うと思ったら、見直しを依頼する

どの項目が、なぜ違うと思うかを書いてください。ログインは不要です。内容を SKILL.md と照らし合わせて評価を作り直し、この欄に反映します。

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

含まれるファイル(2)

  • SKILL.md8.2 KB
  • references/debug-workflow.md13.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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/
  • Changing CLI/Desktop dispatch launchers, including OpenClaw/Hermes, or debugging task-comment authorship
  • Debugging heteroAgentRawLine transport, window.__HETERO_AGENT_TRACE, or executeHeterogeneousAgent
  • Fixing Claude Code stream-json bugs such as duplicate partial/full chunks, broken message.id boundaries, missing tool_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

  1. CLI raw stdout / JSONL
  2. Electron main spawns the CLI and broadcasts heteroAgentRawLine
  3. Adapter maps raw provider events into HeterogeneousAgentEvent
  4. executeHeterogeneousAgent persists assistant/tool messages and forwards stream events
  5. createGatewayEventHandler hydrates the UI
  6. Only after this path looks correct should you move on to agent-tracing or context-engine debugging

Read These Files First

  • apps/desktop/src/main/controllers/HeterogeneousAgentCtr.ts
  • apps/desktop/src/main/modules/heterogeneousAgent/drivers/claudeCode.ts
  • apps/desktop/src/main/modules/heterogeneousAgent/drivers/codex.ts
  • packages/heterogeneous-agents/src/adapters/claudeCode.ts
  • packages/heterogeneous-agents/src/adapters/codex.ts
  • src/store/chat/slices/agentRun/actions/transports/hetero/heterogeneousAgentExecutor.ts
  • src/store/chat/slices/agentRun/actions/__tests__/heterogeneousAgentExecutor.test.ts

Default Debug Order

  1. Prove whether the raw CLI output is correct before touching UI code. The app records every real session — read the most recent one via cat .heerogeneous-tracing/.last-live-trace rather than hand-rolling a claude -p repro (see references/debug-workflow.md §2).
  2. If raw output is correct, compare it with adapter output. In dev, executeHeterogeneousAgent exposes window.__HETERO_AGENT_TRACE.
  3. If adapted events look correct, inspect persistToolBatch, persistToolResult, step transitions, and subagent routing.
  4. Turn the repro into a focused test before fixing.
  5. 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.id are one turn, not multiple turns.
  • In Claude Code, tool_result lives in type: 'user' events, not assistant events.
  • In Claude Code partial mode, message_delta.usage is authoritative; do not trust echoed usage on every assistant block.
  • persistToolBatch must pre-register assistant tools[] before creating tool messages.
  • Every tool message must keep parentId equal to the owning assistant and tool_call_id equal to the tool id.
  • tool_result must resolve an existing toolMsgIdByCallId.
  • Subagent chunks must stay in thread scope and must not be forwarded into the main assistant stream.
  • Never clear the global toolMsgIdByCallId map at main step boundaries.

Dispatched Run Identity

A connector or desktop process can itself run inside another Agent's conversation. Its inherited environment identifies the launcher, not the dispatched Agent.

  • Build child identity from the current dispatch. Clear inherited LOBEHUB_AGENT_ID, LOBEHUB_ASSISTANT_MESSAGE_ID, LOBEHUB_TASK_ID, and LOBEHUB_WORKSPACE_ID; replace LOBEHUB_TOPIC_ID and LOBEHUB_OPERATION_ID with the dispatched values. Inject optional context only when supplied by the current dispatch; absent values must not retain ancestor identity.
  • Keep authorship independent of authentication. Clearing LOBEHUB_JWT or falling back to user credentials must not change the executing Agent. Never infer the author from the topic owner or task assignee.
  • In apps/cli/src/commands/task/lifecycle.ts, lh task comment must refuse to post when topic or operation context exists but the Agent ID is missing or blank. Ordinary terminal comments without execution identity remain user-authored. Misattributed Agent progress can otherwise become human <user_feedback> in later task runs.

Check all four launch surfaces when changing this contract or adding a launcher:

SurfaceEntry point
CLI Agent dispatchapps/cli/src/device/agentRun.ts — spawnHeteroAgentRun (Agent ID forwarded by apps/cli/src/commands/connect.ts)
CLI OpenClaw/Hermesapps/cli/src/tools/heteroTask.ts — runHeteroTask
Desktop Agent dispatchapps/desktop/src/main/controllers/HeterogeneousAgentImpl.ts — spawnLhHeteroExec
Desktop OpenClaw/Hermesapps/desktop/src/main/controllers/GatewayConnectionCtr.ts — runHeteroTask

Regression coverage must include a clean environment, conflicting ancestor identity, and missing current Agent/optional context. Check both OpenClaw and Hermes on CLI and Desktop, plus task comments after JWT fallback. Mocked spawn assertions verify environment construction, not end-to-end propagation through an external runtime.

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.
  • Wrong terminal-error guide (e.g. "usage limit reached" shown for a network drop): a classifier is branching on a structured field whose mere presence isn't its meaning. Grep the field across all event states in a real trace before trusting it — see references/debug-workflow.md §8 (CC rate_limit_info rides on status: "allowed" too).

References

  • For commands, trace capture, invariants, and focused test commands, read references/debug-workflow.md.
  • Live official-model compatibility checks are available only through explicit user invocation of /testing-heterogeneous-agents in Claude Code or $testing-heterogeneous-agents in Codex. Do not automatically load or run that skill during diagnosis. Its failed-cell evidence can be used here for diagnosis or a code fix.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

acceptance

無料概要あり

実際の製品を操作して、利用者が確認できる動作証拠を集め、検証計画に沿った受け入れレポートとして公開するスキルです。

  • 変更後の製品動作を実地で検証したいとき
  • 画面キャプチャなどの証拠を集めたいとき
  • 検証計画とレポートを作成したいとき
lobehub/lobehub8.4万2026年10月26日 更新

add-model-provider

無料概要あり

LobeHubにAIモデルプロバイダーを追加し、実行時連携からモデル表示、設定、ブランド表記、文書化、動作確認まで進めるスキルです。

  • 新しいAIモデルプロバイダーを追加したいとき
  • プロバイダーの設定手順や説明文を更新したいとき
  • 既存プロバイダーへのモデル追加要件を見極めたいとき
lobehub/lobehub8.4万2026年10月26日 更新

add-setting-env

無料概要あり

ユーザー設定の初期値をサーバー側の環境変数で切り替えるため、型定義や設定の組み立て、ユーザーストアへの反映、環境変数の例と説明書きを追加する手順です。

  • 設定の初期値を環境変数で変えたいとき
  • 設定項目をサーバー設定に追加したいとき
  • 環境変数の例と説明を更新したいとき
lobehub/lobehub8.4万2026年10月26日 更新

agent-runtime-hooks

無料概要あり

エージェント実行中の各段階をフックで監視し、ツール呼び出しの模擬・制御や人の承認、圧縮、サブエージェント処理に介入する仕組みを扱います。

  • エージェントの実行状況を記録したいとき
  • ツール結果をテスト用に模擬したいとき
  • Webhookでツール実行を許可・拒否したいとき
lobehub/lobehub8.4万2026年10月26日 更新

agent-signal

無料概要あり

イベントを起点にエージェントのバックグラウンド処理を組み立て、ソース・シグナル・アクション・ポリシーの役割分担や非同期連携を実装するためのスキルです。

  • イベント起点の処理を追加したいとき
  • バックグラウンド処理を非同期化したいとき
  • 重複実行を防ぐ仕組みを整えたいとき
lobehub/lobehub8.4万2026年10月26日 更新

agent-testing-bot

無料概要あり

DiscordやSlackなどの実際のチャットアプリでボットにメッセージを送り、応答を画面で確認する受け入れテストを行うスキルです。

  • 実際のDiscordでボット応答を確かめたいとき
  • SlackやTelegramの会話経路をテストしたいとき
  • macOSアプリ上の操作結果を画面で記録したいとき
lobehub/lobehub8.4万2026年10月26日 更新

lobehub のスキルをすべて見る

このスキルの問題を報告する