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

harness-development

CentaurのハーネスサーバーにCLIバックエンドを追加・修正し、各エージェントの出力変換やストリーミング、割り込み、再開などを調査します。

原文原文の説明を見る

Add, modify, or debug Centaur harness-server backends in crates/harness-server. Use when adding a new harness CLI, changing how Codex, Claude Code, Amp, Pi, Nanocodex, or Hermes output is normalized, or investigating harness streaming, interrupt, resume, model, or reasoning-effort behavior.

paradigmxyz/centaurスター 1,405(GitHub 1,405 + cccskills 0)
連携ツールSlack

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 新しいハーネスCLIを追加したいとき
  • 出力の変換やストリーミングを調査したいとき
  • 割り込みやセッション再開の不具合を追いたいとき
  • モデルや推論レベルの扱いを変更したいとき

日本語での紹介

できること

crates/harness-server のハーネスバックエンドを追加・変更・デバッグするための手順と設計上の決まりを示します。各CLIの実際の入力・出力を観察し、Rustの HarnessServer 実装でイベントを型付きデータとして解析し、共通のイベント形式に整えます。Codex、Claude Code、Amp、Pi、Nanocodex、Hermesの出力変換に加え、ストリーミング、割り込み、セッション再開、モデル切り替え、推論レベルの扱いを調べる作業が対象です。新しいハーネスでは、サンドボックスへの導入やAPI、Ingress、Consoleの選択肢など関連箇所も更新します。

こんなときに便利

新しいハーネスCLIを接続したいときや、既存バックエンドの応答が欠ける、ターン終了がずれる、会話が再開されないといった問題を追う開発者に向いています。テスト用の記録データやフェイクCLIを用いて、プロトコル変換とターンの継続性を確認できます。

使い方の例

  • 「新しいハーネスCLIのバックエンド追加手順を整理して」
  • 「Claude Codeのストリーミング出力が正しく正規化されるか調べて」
  • 「割り込み後にセッションが再開しない原因を追って」

注意点

RustとCargoを使う開発が前提です。実ハーネスを使う無視対象テストはネットワーク通信を行います。認証情報をログや出力に含めず、実キーをハーネスサーバーへ渡さない制約があります。

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

含まれるファイル(2)

  • SKILL.md6.6 KB
  • agents/openai.yaml228 B

SKILL.md(原文)

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

Harness Development

Shape of the crate

crates/harness-server is the only layer that translates harness output. It is built into the sandbox image and is the sandbox's PID 1: api-rs launches harness-server <subcommand> (harness_server_subcommand in crates/centaur-session-runtime/src/lib.rs). Don't add harness output parsing in Python, TypeScript, api-rs, or the ingresses.

  • Input: By default (--mode blocks) stdin carries Centaur blocks NDJSON: user (text or content blocks, with optional model, provider, reasoning, and trace context), attachment.chunk, and interrupt. See parse_blocks_line_with_state in src/server.rs. --mode jsonrpc accepts Codex App Server requests instead, including turn/steer. It is used for protocol testing.
  • Output: stdout carries only Codex App Server V2 notifications (thread/started, item/*, turn/completed, error), typed in src/protocol.rs. crates/harness-server-conformance (its own workspace, so the Codex crates stay out of other lockfiles) round-trips them through the upstream codex-app-server-protocol types at a pinned revision. Harness stderr may be logged, but nothing else may reach stdout.

Backends:

  • codex.rs: runs codex app-server and passes its native protocol through.
  • claude.rs, amp.rs, pi.rs: implement HarnessServer (src/traits.rs) on the shared runner in server.rs. Each one builds the process command and stdin lines, parses stdout lines into typed events, and normalizes them into NormalizedEvent. CodexTurnNormalizer (turn.rs) turns those into App Server items.
  • nanocodex.rs, hermes.rs: their own blocks servers (an in-process library and a long-lived JSON-RPC gateway). They also feed CodexTurnNormalizer.

Adding or changing a backend

  1. Observe the native CLI first. Start from the args in the backend's command_for_turn (or the vendor docs for a new harness). Feed it hand-written stdin, and save every stdin, stdout, and stderr line to a temp directory. Establish the real contract: startup args, input shape, event types, terminal event, session id and resume, tool-call and tool-result shape, interrupt, model switching, and reasoning controls.
  2. Implement HarnessServer in one module, src/<harness>.rs. Use typed serde event enums. Use serde_json::Value only at the parser boundary. Override the trait hooks only when the harness needs them: terminal_assistant_stop_settle, turn_hold, restart_on_model_change, validate_model, reasoning_effort, and stdin_for_reasoning_effort.
  3. Wire it up. Add the subcommand in src/main.rs, the HarnessKind variant, and dispatch in src/server.rs. The binary path should be overridable through an env var (CLAUDE_BIN, AMP_BIN, CENTAUR_PI_BIN) so tests can substitute a fake. Namespace new settings as CENTAUR_<HARNESS>_*.
  4. For a new harness, update the rest of the path. src/pi.rs and commit 8814c7f8 are the reference:
    • api-rs HarnessType (centaur-session-core), the subcommand mapping, and auth mode / proxy wiring (centaur-api-server/src/args.rs).
    • Install the CLI and persist its state in services/sandbox/Dockerfile and entrypoint.sh.
    • Add the selector in the ingresses (services/slackbotv2/src/overrides.ts and response-context.ts) and in the Console harness list.
    • Add a page under docs/pages/extend/ and update docs/pages/reference/configuration.mdx.

Invariants

  • Keep one harness process per thread across turns, and resume it with the native session id (--resume, threads continue, --session-id). Never silently start a fresh conversation when the caller expects continuity.
  • Every turn emits the userMessage item started and completed events and ends with exactly one turn/completed that includes all of the turn's items.
  • Complete a turn only at the harness's real terminal boundary: Claude Code's result, Pi's agent_settled, or Amp's terminal assistant stop, since Amp may not emit result while stdin is open. Use terminal_assistant_stop_settle rather than ad hoc timers.
  • Interrupt is cancellation, and it is distinct from steering. Codex sends turn/interrupt to the app server. The shared runner kills the harness process and finishes the turn as interrupted, and the next turn respawns the process and resumes the session.
  • Reject an unsupported model with a turn error worded "unsupported model". Slack keys on that wording to clear the thread's sticky model.
  • Never log or emit credentials. Sandboxes see iron-proxy placeholders. Don't inject real keys in harness-server.

Tests

From the repository root:

cargo fmt -p harness-server --check
cargo clippy --locked -p harness-server --all-targets -- -D warnings
cargo test --locked -p harness-server
  • Unit tests in each module: stdin generation, stdout parsing, and event normalization for representative recorded lines.
  • Stdio integration tests (tests/app_server_stdio.rs, tests/pi_stdio.rs): run the real harness-server binary against a scripted fake harness that replays recorded native output from tests/fixtures/<harness>/*.jsonl. Record fixtures from the real CLI and note the CLI version in the test. Assert on the emitted App Server stream: item order, phases, turn/completed, interrupt, resume args, and model switches.
  • Real-binary tests are #[ignore] tests that spawn installed harnesses and make network calls. Run them when native behavior is the question:
cargo test -p harness-server \
  real_harnesses_basic_steer_and_resume -- --ignored --nocapture

Other real tests in tests/app_server_stdio.rs include real_claude_code_long_streaming_is_anchored_to_native_cli, real_amp_long_streaming_is_anchored_to_native_cli, and real_codex_long_streaming_uses_native_app_server_chunks. Read the --nocapture output, not just the summary. Look for non-JSON stdout, missing item/completed, duplicate or stale assistant text, wrong thread or turn ids, and lost session continuity.

For changes that affect the deployed path, also build the sandbox image and run a real turn through the local stack. e2e/stack.sh test covers the Slack path with scripted model providers.

Record any native quirk in the backend module or its tests, not only in the PR description.

レビュー

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

コメント

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

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

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

0 / 1000 文字

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

同じリポジトリのスキル

auth-failure-log-triage

無料概要あり

認証や権限、APIプロキシの失敗をVictoriaLogsの実行ログから調べ、状態コードやシークレット解決エラーなど、原因の手掛かりを整理するスキルです。

  • 401・403・503の原因を調べたいとき
  • 連携機能の認証失敗を追跡したいとき
  • シークレットの解決状況を確認したいとき
paradigmxyz/centaur1,4052026年10月26日 更新

centaur

無料概要あり

認証済みのCentaur環境からチーム承認済みツールを探して実行し、利用者の権限や実行結果を踏まえて作業内容をまとめるスキルです。

  • 承認済みのCentaurツールを探したいとき
  • CentaurのCLI操作を実行したいとき
  • 利用者の権限を確認したいとき
paradigmxyz/centaur1,4052026年10月26日 更新

centaur-console-permissions

無料概要あり

Centaur Consoleで、Slackのチャンネルやユーザー、ワークフローに付与する権限や共有シークレットを、管理者の依頼に沿って追加・変更・削除します。

  • チャンネルに共有ツールのアクセスを付与したいとき
  • Slackチャンネル間の読み書き権限を設定したいとき
  • ユーザーやワークフローの権限を整えたいとき
paradigmxyz/centaur1,4052026年10月26日 更新

centaur-observability

無料概要あり

VictoriaLogsとVictoriaMetricsでCentaurのログや指標を調べ、停止・未反映などの原因を実行履歴や稼働状況の証拠から切り分けるスキルです。

  • 止まったワークフローの原因を調べたいとき
  • 未反映の投稿やアラートを追跡したいとき
  • 実行やツール呼び出しの記録を確認したいとき
paradigmxyz/centaur1,4052026年10月26日 更新

company-context

無料概要あり

社内の過去の議論や決定、プロジェクト・会議の状況を、索引化された情報とSlackやLinearなどの原資料を照合して調べるスキルです。

  • 社内での過去の決定を調べたいとき
  • プロジェクトの経緯や状況を確認したいとき
  • 会議の議論や予定を探したいとき
paradigmxyz/centaur1,4052026年10月26日 更新

creating-tools

無料概要あり

外部サービスのAPIを利用するツール連携を、PythonクライアントやCLI、認証情報の設定、テストを含む所定の構成で新規作成するスキルです。

  • 外部API連携ツールを作りたいとき
  • PythonクライアントとCLIを追加したいとき
  • 認証情報を含むツール構成を整えたいとき
paradigmxyz/centaur1,4052026年10月26日 更新

paradigmxyz のスキルをすべて見る

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