Repository navigation
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "2154"
goal_ref: "Anthropic subscription と ChatGPT Pro Codex subscription を独立 runtime として並列運用できる claude-gpt launcher を bootstrap し、現行ユーザーのまま worktree 上で runtime を実機確認する"
change_kind: featureParent Issue
Parent Goal Ref
- Goal: Claude Code を共通 development harness とし、Anthropic subscription と ChatGPT Pro Codex subscription を独立 runtime として並列運用できる状態へ移行し、Codex CLI 実行系を段階的に廃止する。
- Desired Destination: Native Claude(Anthropic subscription)と claude-gpt(ChatGPT Pro Codex subscription 経由 GPT-5.6 Sol/Terra/Luna)が、同一 repository・共通
.claude/agents/.claude/skills/を使いながら、config root・credential・working tree を分離した状態で並列稼働する。
Scope Reframe(2026-08-15, OWNER 判断)
本 Issue は個人趣味開発の Phase 1 実装であり、以下を OWNER の最新 authority として反映する(https://github.com/squne121/loop-protocol/pull/2162#issuecomment-5299336551):
raine/claude-code-proxyは通常の現行 Unix user・root 権限なしで利用できる(upstream 確認済み)。- dedicated Unix user・
useradd・sudoers provisioning・root 権限での proxy 起動は Phase 1 の必須要件ではない。 - Claude Code から起動される任意 subprocess(Bash tool 経由の
python3/node等)が、同一 Unix user が所有する credential を完全に秘匿できることは Phase 1 の non-goal であり、同一ユーザー内での local-user trust boundary を Phase 1 の accepted trust boundary とする。 permissions.denyのRead(//...)は、Claude Code 組み込み tool(Read 等)に対する best-effort な軽量防御として維持するが、「これにより arbitrary Bash subprocess から credential が安全になる」とは主張しない。sandbox.enabled/CLAUDE_CODE_SUBPROCESS_ENV_SCRUBの OS-level sandbox hardening は Phase 1 の merge 条件から除外し、実装しない(ネストした sandbox 実行環境下で Bash tool を破壊することが Issue 実装: claude-gpt launcher の sandbox hardening 既定有効化可否を実機検証する #2173 の実機検証で判明したため)。- 一方で、credential を repository に保存しない・credential 内容をログや GitHub evidence に出さない・proxy を不必要に外部公開しない、という基本安全性は維持する。
Current Validated Scope
- 本 Issue(Child 1 / Phase 1)の repository 実装は、
claude-gptlauncher の bootstrap と runtime smoke test を対象とする。 - Phase 1 の runtime verification が PASS(SKIP は不可)した後の delivery / phase handoff として、Child 2(agent/runtime parity contract 移行, 実装: migrate agent/runtime parity contracts(Phase 2, Child 2 of #2154) #2160)と Child 3(Codex CLI asset 撤去, 実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161)は既に起票済みであり、その状態が実態と整合していることを本 Issue の完了条件に含める。
- Child 2・Child 3 の repository 実装自体は本 Issue では行わない。
raine/claude-code-proxyを GPT backend の provider adapter として採用する方針は Issue 導入: Codex CLI 実行系を廃止し Claude Code dual-subscription runtime へ移行する #2154 で確定済み。- launcher の credential / config / state 分離境界と loopback listener 検証は、現行ユーザーのまま実現する範囲に限定する(dedicated user・OS-level isolation は対象外)。
Remaining Parent Gaps
- Child 2(実装: migrate agent/runtime parity contracts(Phase 2, Child 2 of #2154) #2160)は Phase 1 runtime verification PASS 後に着手可能。Child 3(実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161)は Child 2 merge 後に着手可能。
- Issue 実装: claude-gpt launcher の sandbox hardening 既定有効化可否を実機検証する #2173(sandbox hardening 既定有効化可否)は本 Scope Reframe により Phase 1 の pre-merge blocker ではなくなった(本 Issue の Stop Conditions 参照)。
Outcome
repository-owned claude-gpt launcher(scripts/claude-gpt/ 配下)が追加され、現行ユーザーのまま CLAUDE_CONFIG_DIR / proxy 設定・認証・state ディレクトリの分離(canonical path 検証込み)・raine/claude-code-proxy 向け環境変数の allowlist 起動・GPT-5.6 モデルエイリアスマッピング・strict MCP 除外・PID 所有権付き loopback bind preflight・ChatGPT subscription 認証 preflight を実装したコミットが作成され、runtime smoke test(live 環境で worktree を cwd として claude-gpt launcher を起動し、実際に ChatGPT Pro backend の GPT モデルへ request を送り、Bash tool と Task/SubAgent を最低 1 回動作させ、応答・provider/model evidence・cleanup を確認する)を含む Draft PR が作成された状態。
Child 2(#2160)・Child 3(#2161)は起票済みであり、Parent #2154 の Child Issues / Remaining Parent Gaps / Phase Handoff Contract が実態(Phase 1 の PASS 状況)と整合している状態まで確認・必要なら同期されていること。Phase 2 / Phase 3 の repository 実装は行わない。
Runtime Verification Applicability
- decision: immediate
- reason: AC1〜AC7 は live 環境で
claude-gptlauncher を worktree cwd から実際に起動し、ChatGPT subscription authentication・model/provider resolution・実際のプロンプト応答・Bash tool・Task/SubAgent を実機確認するため、静的検証(typecheck / lint / grep)だけでは検証が完結しない。 - applicable_acs: AC1, AC2, AC3, AC4, AC5, AC6, AC7, AC10
- execution_environment:
raine/claude-code-proxyが起動可能かつ ChatGPT subscription 認証が利用可能な live 環境(開発者ローカルの現行ユーザー、または同等の worktree) - skip_conditions:
raine/claude-code-proxyが利用不能、または ChatGPT subscription 認証が利用不能な場合。この場合 runtime smoke test は exit code 77 で SKIP を返す。 - fallback_policy: SKIP(exit 77)を PASS へ昇格しない。SKIP はそのまま SKIP として記録し、Draft PR には SKIP 理由を明記する。fallback 実行や擬似成功判定は行わない。bounded retry / timeout は許容するが、LLM の非決定性を完全に排除するための複雑な validation framework は追加しない。
- artifact_requirements: runtime smoke test の実行ログ(provider/model resolution・text response・Bash tool・Task/SubAgent 実行確認・cleanup 確認の出力)を Draft PR に証跡として添付する。証跡に credential・OAuth token・prompt 全文・tool 入出力全文を含めない。
applicable_acs: AC1, AC2, AC3, AC4, AC5, AC6, AC7, AC10
execution_environment: raine/claude-code-proxy が起動可能かつ ChatGPT subscription 認証が利用可能な live 環境(現行ユーザー)
skip_conditions: raine/claude-code-proxy または ChatGPT subscription 認証が利用不能な場合、exit code 77 で SKIP
fallback_policy: SKIP を PASS へ昇格しない。fallback 実行や擬似成功判定は行わない
artifact_requirements: runtime smoke test 実行ログ(credential・token・prompt/tool 全文は含めない)を Draft PR に添付
In Scope
scripts/claude-gpt/配下に repository-ownedclaude-gptlauncher スクリプトを追加する。実装はscripts/CLAUDE.mdの不変条件(外部ライブラリ依存ゼロ・Shell は POSIX 準拠・破壊的処理は dry-run 実装・構造化 YAML/JSON 出力)に従う。launcher は root/sudo を要求せず、現行 Unix user のまま起動できる。- launcher が以下を設定することを実装する:
CLAUDE_CONFIG_DIRを Claude Code 専用の GPT ディレクトリ(例:$HOME/.claude-gpt/claude)に分離する(Native Claude 用 config との混同防止)。raine/claude-code-proxyの設定・認証・state ディレクトリ(CCP_CONFIG_DIR/XDG_STATE_HOME相当)を、CLAUDE_CONFIG_DIRとは独立した GPT 専用ディレクトリ(例:$HOME/.claude-gpt/proxy-config/$HOME/.claude-gpt/state)へ、現行ユーザーの HOME 配下で分離する。- 上記ディレクトリの canonical path(symlink 解決後)が repository root 配下または worktree 配下でないことを preflight で拒否する。
ANTHROPIC_BASE_URL/ANTHROPIC_AUTH_TOKENをraine/claude-code-proxyの loopback listener 向けに設定する。ANTHROPIC_MODELとANTHROPIC_DEFAULT_OPUS_MODEL/ANTHROPIC_DEFAULT_SONNET_MODEL/ANTHROPIC_DEFAULT_HAIKU_MODELを、それぞれgpt-5.6-terra[1m]/gpt-5.6-sol[1m]/gpt-5.6-terra[1m]/gpt-5.6-luna[1m]にマッピングし、ANTHROPIC_SMALL_FAST_MODELをgpt-5.6-luna[1m]に明示設定する。[1m]suffixはupstreamraine/claude-code-proxyの推奨設定(Claude Code側のlocal context判定を拡張するhint。proxyがupstream送信前にsuffixを除去する)であり、CLAUDE_CODE_AUTO_COMPACT_WINDOWを272000(固定値)に設定することとセットで、Claude Codeが未知モデルとしてcontext上限を200kに誤認しauto-compactが早期破綻する事象(2026-08-15 OWNER実機確認)を防ぐ。CLAUDE_CODE_SUBAGENT_MODELを unset にする。- proxy を起動する子プロセスの環境変数を launcher が明示的に組み立てた allowlist のみへ限定する(親 shell から継承した
CCP_*/HTTP_PROXY/HTTPS_PROXY/ALL_PROXY系の値をそのまま proxy へ引き渡さない)。現行ユーザーのままenv -i相当で起動する。 - strict MCP mode(repository/user MCP を読み込まない)を有効化する設定を行う。
- launcher 起動前 preflight として、launcher 自身が spawn した proxy プロセスの PID を保持し、その PID が所有する listen socket の bind アドレスが厳密に
127.0.0.1(または明示許可した loopback アドレス)であることを確認するチェックを実装する。 - launcher 起動前 preflight として、ChatGPT subscription 認証状態を確認するチェックを実装する。
- credential・OAuth token・proxy state を repository へ保存しないことを保証する実装にする(
.gitignore対象化含む)。credential 内容を runtime evidence・ログ・GitHub コメントへ出力しない。 permissions.denyのRead(//...)を、Claude Code 組み込み tool に対する best-effort の軽量防御として設定する(OS レベルの隔離を主張しない。実装・運用コストが増える dedicated user・OS sandbox 等は追加しない)。- launcher が supervisor pattern(
execを使わずバックグラウンド起動 + signal forwarding +wait+ 全終了経路での cleanup)で proxy プロセスを管理し、launcher 終了時に proxy を確実に停止する。 - runtime smoke test スクリプト(
scripts/claude-gpt/配下)を追加し、raine/claude-code-proxyが利用可能な live 環境で、worktree を cwd として実際に launcher を起動し、ChatGPT subscription authentication・model/provider resolution・実プロンプト応答・Bash tool 実行・Task/SubAgent 実行・proxy cleanup を確認する。 raine/claude-code-proxyまたは ChatGPT subscription 認証が利用不能な環境では、runtime smoke test を exit code 77 で SKIP とし、SKIP を PASS に昇格しない。- Phase 1 runtime verification が PASS している状態を前提に、Child 2(実装: migrate agent/runtime parity contracts(Phase 2, Child 2 of #2154) #2160)・Child 3(実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161)・Parent 導入: Codex CLI 実行系を廃止し Claude Code dual-subscription runtime へ移行する #2154 の記載が実態と整合しているか確認し、必要なら Parent 導入: Codex CLI 実行系を廃止し Claude Code dual-subscription runtime へ移行する #2154 を最小限更新する。
Phase Handoff / GitHub Delivery Contract
Phase handoff は Phase 1 runtime verification の PASS を前提とする。exit 77 の SKIP、未検証、部分 PASS では #2154 を「Phase 1 gate 通過済み」と更新しない。
Child 2(#2160)・Child 3(#2161)は既に起票済みのため、本 Issue では新規起票を行わない。Phase 1 runtime verification が PASS したら、Parent #2154 の Child Issues / Remaining Parent Gaps / Phase Handoff Contract が実態(Phase 1 PASS)と整合しているかを確認し、乖離があれば最小限の更新を行う。
Out of Scope
- Child 2(実装: migrate agent/runtime parity contracts(Phase 2, Child 2 of #2154) #2160)・Child 3(実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161)の repository 実装。
raine/claude-code-proxy自体の実装・fork(upstream 管理下の依存として利用するのみ)。- herdr session 分離の一般的な仕組み自体の変更(既存の
.claude/worktrees/issue-<number>-<slug>/規約はそのまま前提として使う)。 - Codex CLI runtime の削除(本 Phase では fallback として残す)。
raine/claude-code-proxy/ OpenAI ChatGPT subscription の利用規約上のリスク評価そのもの(credential 共有・rate limit 回避・resale/shared-service 該当性の最終判断)。これは repository owner の human decision gate として扱う。- proxy / Claude Code の exact version pin・binary hash 検証・rollback 手順の恒久運用ポリシー化。
- dedicated Unix user・root/sudo/useradd/sudoers による OS-level credential isolation の実装・検証(Scope Reframe により Phase 1 の non-goal)。
sandbox.enabled/CLAUDE_CODE_SUBPROCESS_ENV_SCRUBによる OS-level sandbox hardening の必須化(opt-in・必須いずれも実装しない。Issue 実装: claude-gpt launcher の sandbox hardening 既定有効化可否を実機検証する #2173 の実機検証でネスト環境下の Bash tool 破壊が判明したため)。- Claude Code から起動される任意 subprocess に対する credential exfiltration adversarial matrix の網羅的検証。
Acceptance Criteria
- AC1: 通常の現行 Unix user のまま、root/sudo/useradd を一切使わずに
claude-gptlauncher を起動できる。 - AC2: worktree directory を cwd として
claude-gptlauncher が正常に起動できる(CLAUDE_CONFIG_DIR/ proxy 設定・認証・state ディレクトリの分離を含む)。 - AC3: ChatGPT subscription authentication を利用して proxy への request が成功する(loopback bind preflight・認証 preflight を含む)。
- AC4: 設定した GPT model alias(
gpt-5.6-sol[1m]/terra[1m]/luna[1m])が利用可能で、実際の request で使用された provider/model(upstream送信時は[1m]suffix除去後の実model ID)を evidence として確認できる。実際のinteractiveセッションでSkillロード・SubAgent起動を伴う操作を行ってもContext limit reached/automatic compaction failed/unknown-model warningが発生しないことを含む。 - AC5: launcher 経由で起動した Claude Code から通常のテキスト応答が返る。
- AC6: launcher 経由で起動した Claude Code で Bash tool が最低 1 回正常に実行できる。
- AC7: launcher 経由で起動した Claude Code で Task/SubAgent が最低 1 回正常に実行できる。
- AC8: strict MCP mode により repository/user MCP の意図しない混入が発生しない設定になっている。
- AC9: credential・OAuth token・proxy state が repository/worktree または runtime evidence(ログ・GitHub コメント)に保存・出力されない(
.gitignore等での除外を含む)。 - AC10: launcher が起動した proxy が launcher 終了後に通常 cleanup される(PID/listen socket の残留なし)。
- AC11: Child 2(実装: migrate agent/runtime parity contracts(Phase 2, Child 2 of #2154) #2160)・Child 3(実装: retire Codex CLI assets and documentation(Phase 3, Child 3 of #2154) #2161)・Parent 導入: Codex CLI 実行系を廃止し Claude Code dual-subscription runtime へ移行する #2154 の Phase handoff 記載が、本 Issue の Phase 1 runtime verification 結果と整合している。
Verification Commands
# AC1
# baseline-expect: fail
$ rg -n "CLAUDE_CONFIG_DIR" scripts/claude-gpt# AC2
# baseline-expect: fail
$ test -f scripts/claude-gpt/launch.sh# AC3
# baseline-expect: fail
$ rg -n "127.0.0.1" scripts/claude-gpt# AC4
# baseline-expect: fail
$ rg -n "gpt-5.6-sol" scripts/claude-gpt# AC5
# baseline-expect: fail
$ test -f scripts/claude-gpt/runtime_smoke_test.sh# AC6
# baseline-expect: fail
$ rg -n -e bash_tool -e BASH_MARKER -e "bash tool" scripts/claude-gpt/runtime_smoke_test.sh# AC7
# baseline-expect: fail
$ rg -n -e subagent -e SUBAGENT_MARKER -e SubAgent scripts/claude-gpt/runtime_smoke_test.sh# AC8
# baseline-expect: fail
$ rg -n -e strict_mcp -e strict-mcp-config scripts/claude-gpt# AC9
# baseline-expect: fail
$ rg -n "claude-gpt" .gitignore# AC10
# baseline-expect: fail
$ rg -n -e cleanup -e trap scripts/claude-gpt/launch.sh# AC11
# baseline-expect: pass
$ gh issue view 2154 --repo squne121/loop-protocol --json body,urlAllowed Paths
Repository file change の Allowed Paths:
scripts/claude-gpt/.gitignore
GitHub control-plane write は repository file path 変更とは別枠として、以下のみ許可する:
- Parent Issue 導入: Codex CLI 実行系を廃止し Claude Code dual-subscription runtime へ移行する #2154 の本文更新(Phase handoff 整合性確認のための最小更新)
- Issue 実装: claude-gpt launcher の sandbox hardening 既定有効化可否を実機検証する #2173 のクローズ・コメント(Scope Reframe に伴う整理)
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- dedicated Unix user・root/sudo/useradd/sudoers が実際に必要と判明した場合(本 Issue のスコープでは導入しない。判明した場合は実装自体が過剰でないか見直す)
- GPT backend 利用に OpenAI API metered billing が必須と判明した場合
- ChatGPT subscription auth では GPT-5.6 required models を利用できない場合
- Claude Code custom SubAgent が proxy 経由で tool execution または continuation を保持できない場合
- model alias routing または effort routing を実 runtime で検証できない場合
- GPT profile から MCP を除外できない場合
- proxy 利用に credential 本文を repository へ保存する必要が生じた場合
- listener を loopback 外へ公開する必要が生じた場合
raine/claude-code-proxy/ ChatGPT subscription の利用規約上、credential 共有・rate limit 回避・resale/shared-service に該当しうる運用が本 launcher に必須と判明した場合
Required Skills
なし
Required Design References
- Issue 導入: Codex CLI 実行系を廃止し Claude Code dual-subscription runtime へ移行する #2154 の「アーキテクチャ決定(A〜E)」「GPT Launcher Contract」「Child Issues」「Phase Handoff Contract」節
docs/dev/runtime-verification-policy.md(SKIP 規約 / Runtime Verification Applicability 記載規約)scripts/CLAUDE.md(外部依存ゼロ・POSIX shell・dry-run・構造化出力の不変条件)- OWNER scope-reframe コメント: feat: claude-gpt launcher を bootstrap し native canary で runtime を検証する #2162 (comment)
Delivery Rule
1 Issue = 1 PR で repository implementation を完結させる。dedicated worktree で作業し、Draft PR をデフォルトとする。PR #2162(既存 branch)を継続利用する。
Activity
squne121 commentedon Aug 14, 2026
you asked
message time: 2026-08-14 18:44:59
#2158
内容について関連Issue、PR、リポジトリ資産、コメントを参照した上で敵対的レビューして。
取り扱う技術や配布物の実装をWEB検索し高品質化してほしい。
chatgpt response
Issue #2158から本文・コメント・関連Issue/PR・実装資産・履歴・テスト/CI契約を突き合わせ、外部一次仕様とも照合します。重大度順に、再現可能な破綻条件・見落とされやすい境界条件・必要な修正を敵対的に整理します。
chatgpt response
初期確認では、Allowed PathsとAC5が矛盾し、runtime verificationの適用宣言も欠落しています。さらにRV観点の縮退、共有settings由来の権限分離不足、OPENな関連Issueとの運用依存も追跡します。
chatgpt response
外部実装照合では、設定・資格情報・状態保存の三層分離不足に加え、役割別model aliasが一律subagent環境変数で上書きされる重大矛盾を確認しました。さらにbind露出検証とeffort/fallback契約も不足しています。
chatgpt response
敵対的レビュー結果
判定
REQUEST_CHANGES — 現状のIssue契約では実装着手不可です。
採用している「Claude Codeを共通ハーネスとし、Anthropic系とChatGPT Pro/Codex系をプロセス・設定ごと分離する」という方向自体は妥当です。しかし、Issue #2158には次の問題があります。
このまま実装すると、「canaryはPASSしたが、実際には資格情報が読める、外部公開されている、別バージョンのproxyにつながっている、effortが送られていない」という状態を許します。
P0:実装前に修正必須
P0-1. AC5とAllowed Pathsが同時に満たせない
AC5は、OAuth情報・proxy state・資格情報をGit管理対象にしないことと、
.gitignoreによる除外を要求しています。一方、Allowed Pathsはscripts/claude-gpt/だけに限定され、範囲外変更は停止条件です。したがって、.gitignoreを変更するとscope違反、変更しなければAC5不達になります。これは文言上の軽微な問題ではなく、実装者がどの選択をしてもIssueを完了できない契約矛盾です。
修正は次のいずれかが必要です。
.gitignoreを追加する.gitignore変更をACから外し、既存パターンで除外できる配置へ固定する.gitignoreとは別に、canonical path、symlink、git check-ignore、git ls-filesを検証するなお、現在の
.gitignoreには.claude/settings.local.json等はありますが、~/.claude-gpt相当のrepo-local誤配置を明示的に拒否する契約はありません。P0-2. 「repo外に置く」はOAuth資格情報の隔離にならない
claude-code-proxyのCodex認証情報にはaccess tokenとrefresh tokenが含まれます。Linux/WSL2ではmacOS Keychainではなくファイルストアが使われ、JSONファイルはmode0600、ディレクトリは0700で保存されます。しかし、
0600は別ユーザーからの保護であり、同じUnixユーザーで動くClaude CodeのBash toolからの保護ではありません。さらに、Claude Codeのsandboxは、明示的にdenyReadを設定しない限り、原則としてコンピューター上のファイルを読み取り可能です。公式ドキュメントも、home全体をdenyし、projectだけをallowする構成と、sandboxが利用不能な場合にhard failするfailIfUnavailableを説明しています。 (Claude)したがって、次の攻撃が成立します。
.gitignoreはこの攻撃に一切効きません。最低限、launcherはsession-scoped settingsとして次を強制すべきです。
sandbox.failIfUnavailable: trueCCP_CONFIG_DIRとXDG_STATE_HOMEをdenyReaddenyReadし、対象worktreeのみallowReadより強い境界が必要なら、proxyをClaude Codeとは別のUnixユーザーまたは隔離serviceで動かすべきです。ただし、listener自体にclient authenticationがないため、別ユーザー化だけではlocal processによるquota消費までは防げません。
P0-3. loopback確認がfalse positiveを許す
Issueは「127.0.0.1へcurlできること」をloopback-onlyの検証にしています。しかし、
0.0.0.0:PORTでlistenしていても、127.0.0.1:PORTへのcurlは成功します。さらに、proxyは
CCP_BIND_ADDRESSや設定ファイルでbind addressを上書きできます。/healthz、/v1/models、/v1/messages等は同じlistenerにあり、client authentication middlewareはありません。上流自身も、incoming clientは未認証であり、非loopback公開は外部firewallまたは認証proxyを必要とすると明記しています。露出したlistenerはsubscription credentialとquota消費能力を露出するのと同等です。
必要な検証はcurlではなく、次です。
127.0.0.1または明示許可したloopback IPv6のみであることを確認する0.0.0.0、::、WSL側Ethernet addressを拒否する固定portを使う場合は、portへの接続成功だけで既存proxyを信用してはいけません。PID、実行ファイルpath、version、binary SHA-256、effective config digestを一致させる必要があります。
P0-4. 分離対象が
CLAUDE_CONFIG_DIRだけでは不足するCLAUDE_CONFIG_DIRはClaude Code側の設定、履歴、plugin等を分離するものです。proxyの設定とfile-backed authはCCP_CONFIG_DIR、ログ等のstateはXDG_STATE_HOMEで管理されます。CCP_CONFIG_DIRはstate directoryを移動しません。 (Claude)Issue #2158は主として
CLAUDE_CONFIG_DIR=~/.claude-gptだけを指定しているため、次が未定義です。少なくとも次の3階層に分けるべきです。
preflightでは、文字列比較ではなく
realpath後のcanonical pathを検証し、以下を拒否する必要があります。~P0-5. 環境変数の継承により、別endpoint・別modelへ静かに接続できる
proxy設定は環境変数、config file、built-in defaultの順で解決され、
serve --portはさらに強い優先順位を持ちます。また、次の変数でendpoint、model、effort、transport、traffic logging等を変更できます。CCP_CODEX_BASE_URLCCP_CODEX_MODELCCP_CODEX_EFFORTCCP_CODEX_TRANSPORTCCP_BIND_ADDRESSPORTCCP_TRAFFIC_LOGCCP_LOG_VERBOSEHTTP_PROXY/HTTPS_PROXY/ALL_PROXY/NO_PROXY現在のACでは、親shellからこれらが継承されても、launcherが期待するChatGPT Codex endpointやmodelを使った証明になりません。
launcherは「必要変数を追加する」のではなく、明示的な環境allowlistからproxyを起動するべきです。企業proxy等を継承する必要がある場合も、予期しない値をそのまま許すのではなく、許容値を明示し、effective configurationをartifactへ記録する必要があります。
P0-6. main model、alias、effort、continuationの契約が不足している
Parent #2154は、mainをTerra、Opus aliasをSol、Sonnet aliasをTerra、Haiku aliasをLunaとしています。Issue #2158はmapping変数を列挙していますが、
ANTHROPIC_MODELの最終値が明示されていません。最低限、起動時環境は次のように固定する必要があります。
ANTHROPIC_MODEL=gpt-5.6-terra ANTHROPIC_DEFAULT_OPUS_MODEL=gpt-5.6-sol ANTHROPIC_DEFAULT_SONNET_MODEL=gpt-5.6-terra ANTHROPIC_DEFAULT_HAIKU_MODEL=gpt-5.6-luna CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 unset CLAUDE_CODE_SUBAGENT_MODEL特に次の点が欠落しています。
effort
Claude Codeはcustom model IDやgateway使用時、
CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1を設定しなければeffortを常に送るとは限りません。 (Claude)非streaming fallback
CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1がない場合、stream障害後のfallbackがtoolの二重実行を発生させる可能性があります。 (Claude)continuation
claude-code-proxyのprevious_response_idcontinuationは既定で無効です。CCP_CODEX_PREVIOUS_RESPONSE_ID=1を明示しなければ、Issueが要求するcontinuation検証の前提自体が成立しません。また、このstateはprocess memory上にあり、proxy再起動で失われます。したがって、continuationのACは少なくとも次に分ける必要があります。
P0-7.
strict MCPではplugin、hook、project settingsを排除できないClaude Codeの
--strict-mcp-configは、明示されたMCP configuration以外を読み込ませないためのオプションです。hook、plugin、skills、project settings、CLAUDE.md等を無効化するオプションではありません。customization全体を排除する境界には--bare等が別途存在します。 (Claude Platform Docs)実際、このrepositoryの
.claude/settings.jsonには多数のhookとcontext-modepluginが設定されています。したがって、「strict MCPで起動できた」という結果から、次は証明できません。
canaryを次の2層に分けるべきです。
transport canary
--barerepository integration canary
この分離がないと、transport不良とrepository customization不良を区別できません。
P0-8. runtime-verification policyに不適合
repositoryのruntime verification policyは、Issueごとに
## Runtime Verification Applicabilityを持ち、immediate/deferred/not_applicableを明示することを要求しています。immediateの場合、runtime対象AC/VC、exit 77によるSKIP、evidence artifact等が必要です。Issue #2158は明らかに
immediate対象ですが、必要なsectionとevidence schemaがありません。静的なrg検査は、次を証明できません。Issue本文の「exit 77を使う」という記載だけでは、repository policyを満たしません。
P1:高優先度の設計不備
P1-1. proxy lifecycleとHerdr同時起動モデルが未決定
Parentコメントでは、
claude-code-proxy v0.1.34を導入し、Herdrの複数tabから同時利用したい意図が示されています。しかし、#2158は次を決めていません。
推奨は、user-scoped singleton proxyです。lockfileまたはruntime manifestに次を保存し、launcherは完全一致した場合だけattachします。
一致しなければ、既存listenerへ安易にattachせずfail closedにすべきです。
P1-2. 配布物のversion pinと実行バイナリ同定がない
調査時点のproxy latestは
v0.1.34です。Claude Code側も2026年8月14日時点でv2.1.224が公開され、subagent frontmatterのeffort対応が追加されています。上流installerには以下の性質があります。
CLAUDE_CODE_PROXY_VERSIONでversion pin可能latestsha256sum/shasumがなければ検証を省略release workflowはarchiveとSHA-256を公開していますが、確認したworkflowには独立したsignatureまたはattestation検証stepは示されていません。
したがってIssueには次が必要です。
P1-3. auth statusだけではmodel利用可能性を証明できない
proxyでOAuth認証が成立していても、Sol/Terra/Lunaがそのaccountで利用可能とは限りません。上流も、local model registrationはaccount entitlementを保証せず、unknown modelにfallbackしないとしています。
preflightは少なくとも次を分離すべきです。
auth status: OAuth credentialが存在し、有効期限更新可能models --json: 必須3 modelがcatalogに存在SKIP:または明示的unsupportedモデル自身に「あなたはどのモデルか」と答えさせる方法は証明になりません。
P1-4. evidence取得がprompt・tool内容を漏洩させ得る
proxyのtraffic captureはrequest body、prompt、tool content等を保存する診断機能です。上流もtraffic captureがpromptとtool contentを意図的に保持すると説明しています。
acceptance artifactでは以下を禁止すべきです。
CCP_TRAFFIC_LOG=1artifactはallowlist方式で、次だけを残すべきです。
{ "status": "pass|skip|fail", "reason_code": "...", "claude_version": "...", "proxy_version": "...", "proxy_binary_sha256": "...", "listener_pid": 123, "listener_address": "127.0.0.1", "listener_port": 18765, "required_models_present": true, "sandbox_credential_read_denied": true, "mcp_user_source_excluded": true, "tool_execution_count": 1, "continuation_same_session": true }P1-5.
scripts/配下のrepository契約を満たしていないscripts/CLAUDE.mdは、次を要求しています。#2158のACには、POSIX shell、dry-run、structured outputがありません。また、既存
package.jsonにはclaude-gpt関連の検証commandが存在せず、テストを置くだけではCIや標準verificationから呼ばれる保証がありません。少なくとも次が必要です。
--dry-run--jsonpnpmから呼べる明示的verification command、または既存Vitest discoveryに入ることの証明これを行うなら、Allowed Pathsへ
package.jsonまたは適切なtest pathを追加する必要があります。P1-6. 関連Issueの依存関係が現況とずれている
関連作業の現在の状態は次です。
#2153はbackend session resumeのnative canaryを扱っており、#2158のcontinuation canaryと直接重なります。「Allowed Pathsが重なるが依存なし」というコメントがありますが、ファイル競合がなくても、何をnative canaryと呼ぶか、どのsession lifecycleを正本とするかという運用契約上の依存は残っています。
責務を次のように分けるべきです。
P1-7. provider policy上の不確実性をIssueから除外している
OpenAI公式資料ではCodexがChatGPT planに含まれることと利用上限が説明されていますが、主に公式Codex app、CLI、IDE、web等が案内されています。第三者proxyによる内部subscription endpoint利用が明示的に保証されているわけではありません。 (OpenAI Help Center)
また、利用規約にはcredential共有、保護措置やrate limitの迂回、一定の自動的・プログラム的抽出等に関する制約があります。これは直ちに本構成が規約違反だという結論ではありませんが、上流proxy自身もprovider policyやaccount enforcementがprovider管理下であると明記しています。 (OpenAI)
したがって、Issueには技術的PASSとは別に、次のhuman-owned decisionが必要です。
修正後の推奨verification構成
Lane A:credential不要のhermetic CI
fake
claude、fake proxy、fixture socketを使い、次を検証します。0.0.0.0/::拒否Lane B:host preflight
実環境で、外部へpromptを送る前に検証します。
CCP_*/proxy envの不存在Lane C:bounded live transport canary
subscription quotaを無制限に消費しないよう、request数、turn数、timeoutを固定します。
-同一session continuation
Lane D:repository/Herdr integration canary
exit code契約
077SKIP:。PASSとして集計禁止12次は
77ではなく1にすべきです。必要なAllowed Paths修正
最低限、次へ変更する必要があります。
GitHub Actionsへ専用laneを追加するなら、
.github/workflows/**も明示的に追加します。逆にworkflowを変更しないなら、既存CIのどのcommandが新しいtestを実行するかをACで固定すべきです。最終結論
#2158は、現状では「launcher実装Issue」ではなく、credential boundary、proxy ownership、runtime evidence、concurrency modelが未決定の設計Issueです。
特にマージ前blockerは次の6点です。
CCP_CONFIG_DIR/XDG_STATE_HOMEを含む完全なstate分離これらをIssue本文へ反映するまでは、実装を開始しても「ACを満たした安全なPASS」を定義できません。
you asked
message time: 2026-08-14 19:11:32
#2158
実装内容に #2154 の GitHub Issueの更新と Child 2: migrate agent/runtime parity contracts(Phase 2) Child 3: retire Codex CLI assets and documentation(Phase 3)の記表を含めてほしいです。
chatgpt response
#2158の現行本文と#2154のPhase構成を確認し、実装スコープに「親Issue更新」と「Child 2 / Child 3の起票・記録」を明示的なAcceptance Criteriaとして追加します。既存の記述を壊さず、依存順序と完了条件も揃えます。
#2158の現行契約では「Child 2/3は別途起票」「新規Issue起票が必要ならStop」となっており、希望内容と矛盾しています。Phase 2/3の実装自体はOut of Scopeのまま、Phase 1 PASS後にChild 2/3を起票し、#2154へ番号・依存関係・進捗を反映するところまでを#2158のdelivery scopeへ組み込みます。
重複検索では、Child 2/3に相当する独立Issueはまだ存在せず、#2154だけが該当しました。したがって#2158には「Phase 1 runtime PASS後に2件を重複防止付きで起票し、その実番号を#2154へ反映する」を追加し、Phase 2/3の実装開始条件は従来どおり維持します。
#2158を更新しました。
追加した主要契約は以下です。
SKIP (77)や部分PASSでは起票しない#2154#2154Child IssuesRemaining Parent GapsPhase Handoff ContractAllowed Pathsとは別のcontrol-plane writeとして明示.gitignoreをAllowed Pathsへ追加つまり、#2158の完了フローは今後、
launcher実装 → native canary PASS → Child 2起票 → Child 3起票 → #2154 rollup更新 → #2158 delivery完了
となります。
なお、現時点ではChild 2 / Child 3そのものはまだ起票しておらず、#2154もまだ変更していません。それらを「#2158のPhase 1 PASS後に実施する実装・handoff作業」として契約化した状態です。
Powered by AI Exporter
squne121 commentedon Aug 14, 2026
issue-refinement-loop 完了報告
対象コメント(#2158 コメント)に含まれる敵対的レビュー結果(REQUEST_CHANGES、P0 8件・P1 7件)を踏まえて Issue 本文を改訂しました。
Step 2 最終判定
VERDICT: approve(0 blocker)。REVIEWED_BODY_SHA256: sha256:c9adc30b7d939a1e00b86eea264011e75ce3d52a4678e582b3b21bf7c350ff17反映した主な変更
決定論的ブロッカー(16件)の解消:
## Runtime Verification Applicabilityセクションを新設(decision: immediate、applicable_acs/execution_environment/skip_conditions/fallback_policy/artifact_requirementsの必須フィールドを含む)# AC<N>の bare 形式へ統一(コロン・説明文を除去)scripts/claude-gpt/)を対象とする VC に# baseline-expect: fail、既存 repository 状態で成功する VC(AC8〜AC11 のgh issue/git diff系)に# baseline-expect: passを付与guard-issue-body.pyのLP017に抵触していたため修正)対象コメントの P0 指摘の反映(実装スコープ内で AC/In Scope を強化、新規 AC は追加せず既存 AC1〜AC11 の粒度を強化):
.gitignoreが既に Allowed Paths に含まれている)curl疎通のみでの判定を明示的に禁止)CLAUDE_CONFIG_DIRだけでは不十分):CCP_CONFIG_DIR/XDG_STATE_HOME相当の分離と canonical path 検証を AC1 / In Scope に追加ANTHROPIC_MODEL系エイリアスの明示値を確定し AC2 に反映P1 指摘の反映(Scope / Design References / Stop Conditions への反映、AC 追加なし):
scripts/CLAUDE.md契約未遵守): In Scope と Required Design References に明記未反映・スコープ外と判断した指摘:
次のアクション(本 loop のスコープ外)
issue-refinement-loopはissue-contract-review(別 skill)を実行しないため、impl-review-loopへの正式な handoff(LOOP_HANDOFF_RESULT_V1.status: impl_ready)には、実装着手前にissue-contract-reviewの実行が別途必要です。squne121 commentedon Aug 14, 2026
implement-issue: 実装完了
d5f0226f).claude/worktrees/issue-2158-claude-gpt-launcher-bootstrap-native-canworktree-issue-2158-claude-gpt-launcher-bootstrap-native-canscripts/claude-gpt/runtime_smoke_test.shを live 環境(raine/claude-code-proxy 0.1.34、ChatGPT subscription 認証済み)で実行し PASS を確認した。証跡はscripts/claude-gpt/.evidence/(.gitignore対象、credential/token を含まない)に生成される。SKIP 分岐(exit code 77)もclaude-code-proxyバイナリ不在を模擬して動作確認済み。squne121 commentedon Aug 14, 2026
Issue #2174 evidence:
--claude-bin経由の claude-gpt launcher 実機検証(AC3/AC4)Issue #2174(
worktree-agent-runtime-smokeへ--claude-binlauncher 選択入力を追加)の実装(PR #2176)にて、scripts/claude-gpt/launch.sh(本 PR #2158 ブランチの worktree、まだ main 未マージ)を--claude-binに指定して structured lane(AC3)と isolated herdr interactive lane(AC4)を live 実機検証した結果を記録する。AC4(isolated herdr interactive lane): PASS
isolated named herdr session 経由で claude-gpt launcher を実際に起動し、応答受信・session cleanup 確認まで成功した。
runtime_version: 2.1.232 (Claude Code)は claude-gpt proxy 経由で実際に Claude Code CLI が応答したことを示す。isolated session は stop/delete/herdr session list --jsonでの消失確認まで完了している。人間の使用中 herdr session には一切相乗りしていない。初回試行は
herdr agent promptの bracketed-paste 由来の既知の stall(references/herdr.mdに記載済みのagent_prompt_stalled)で失敗(exit_code: 1,errors: ['herdr agent prompt stalled and recovery send-keys produced no observed state change; prompt remains unsubmitted'])したが、これは claude-gpt launcher 固有の問題ではなく既知の一般的な flake であり、再試行でprompt_stall_recovered: Trueとして成功した。AC3(structured lane): BLOCKED — アーキテクチャ不整合を発見
run_worktree_agent_runtime_smoke.pyのrun_structured_claude()は既存仕様(Issue #1886/#2046、hook lifecycle 観測用)として、すべての claude structured 起動に対して常に--settings <hook-observability-json>を固定 argv へ含める。一方
scripts/claude-gpt/launch.shは自身の安全設計(本 PR #2162 OWNER fix-delta P1-1、CLAUDE_GPT_FORBIDDEN_EXTRA_FLAGS="--settings --mcp-config --strict-mcp-config --dangerously-skip-permissions --allow-dangerously-skip-permissions")として、--settingsを含む policy-weakening flag を--の前後を問わず常に拒否する(launch.sh75-92 行目付近)。この 2 つはいずれも意図した通りに動作しており、両者を単純に組み合わせると構造的に非互換という発見である。回避策として:
launch.shへ直接(--なしで)--claude-binを渡す → launcher 自身の option parser が-pをunknown_launcher_optionとして拒否(exit 2)launch.sh -- <claude 引数...>の形で--区切りを挿入する shim 経由で渡す → forbidden-flags チェックに--settingsが引っかかりpolicy_weakening_flag_rejectedで拒否(exit 2)いずれの経路でも live 実行は失敗する。この不整合は launcher 側の起動前提(proxy / ChatGPT subscription 認証)が利用不能な場合の SKIP(Issue #2174 の
skip_conditions)とは異なるカテゴリの失敗であり、Issue #2174 の Stop Conditions(「scripts/claude-gpt/launch.sh自体の修正が必要と判明した場合」)に該当すると判断し、コード変更で無理に回避せず live 実行結果をそのまま記録した。OWNER 判断が必要な論点
launch.shのCLAUDE_GPT_FORBIDDEN_EXTRA_FLAGSから--settingsを除外する(hook lifecycle 観測目的の read-only 相当 settings のみ許可する等の緩和)か、run_worktree_agent_runtime_smoke.py側に--settings注入を任意で抑制するオプトアウトを追加する(新規 runner 機能、別 Issue 化)か、のいずれかを OWNER が決定する必要がある。詳細実装・全 evidence(両ケースの
summary.md全文・7 件の新規 pytest)は PR #2176 を参照。Ref: Issue #2174, PR #2176
fix(worktree-agent-runtime-smoke): claude-gpt launcher 向け narrow obse…
squne121 commentedon Aug 14, 2026
launch.sh stdin切断バグの修正(PR #2176 実機発見への対応)
commit: 95d10ba(このブランチへ直接push、head更新済み)
根本原因
launch.shの P0-4 supervisor構成("$CLAUDE_BIN" ... "$@" &に続けてwait)は、明示的な入力リダイレクトを持たない async command の stdin を shell が自動的に
/dev/nullへ差し替える POSIX 準拠の既定動作(job control 無効時。dash/bash 双方で再現確認済み)の
影響を受けていた。
再現条件を特定した結果:
-pのみ + prompt を stdin へ pipe)のみが影響を受ける。structured lane(run_worktree_agent_runtime_smoke.pyのrun_structured_claude())はまさにこの形(input_text=promptをsubprocess.PIPE経由)で prompt を渡しており、これがError: Input must be provided either through stdin or as a prompt argument when using --printの原因だった。runtime_smoke_test.shの-p "$step_prompt")は影響を受けない(argv に prompt が含まれるため stdin は不要)。検討した対処法と不採用理由
set -m(job control 有効化): stdin 問題自体は解消するが[N]+ Done ...という job 完了通知が stderr に出力される(実害はないが不要なノイズ)disown: stdin 問題は解消するが、wait "$CPID"がその後即座に rc=0 で返ってしまい、実際には子プロセスの終了を待たないことを検証で確認。これは P0-4 supervisor の exit code 取得と signal forwarding を静かに破壊する重大な副作用のため不採用。採用した修正
launcher 自身の stdin を
exec 9<&0で fd 9 として明示的に複製し、claude 起動時に<&9で結びつける。async command に明示的な入力リダイレクトを与えることで、shell 既定の/dev/null差し替えを回避する。job control 有効化や disown を使わないため、既存の signal forwarding / exit code 取得 / cleanup(P0-4)には一切影響しない。検証結果
echo hello | sh -c '...')で fd 9 複製ありなしの挙動差を dash・bash 両方で確認scripts/claude-gpt/runtime_smoke_test.sh実機 PASS(claude_exit_code: 0,text_marker_ok/bash_tool_marker_ok/subagent_marker_okすべて true,proxy_cleanup_ok_independent_reverify: true)run_worktree_agent_runtime_smoke.pystructured lane を本修正版 launch.sh に対して narrow observability channel(CLAUDE_GPT_RUNTIME_SMOKE_HOOKS=subagent-start-stop)付きで実機実行し、AC3相当の実機確認を達成:exit_code: 0,terminal_event_observed: true,expected_markers_missing: []child_spawn_observed: true,child_agent_type_observed: general-purpose,child_completion_observed: true,child_terminal_status: completedps/ssで独立確認、CLEANUP_OK: true)bash -n/shellcheck -s sh(新規warning無し)、pnpm typecheck/pnpm lint/pnpm test(1872/1872 pass)/pnpm build全greenScope
修正は
scripts/claude-gpt/launch.shのみ(Allowed Paths:scripts/claude-gpt/準拠)。fix: claude-gpt launcher を Phase 1 Scope Reframe に合わせ簡素化する
feat: claude-gpt launcher を bootstrap し native canary で runtime を検証する (…
squne121 commentedon Aug 15, 2026
Issue #2174 AC3/AC4/AC7 live runtime-verification evidence(fix_delta 後、head
8f7f60af)merge 済み main(
scripts/claude-gpt/launch.sh現行版)と PR #2176 fix_delta(--claude-adapter native|claude-gpt分離後)を組み合わせた clean な worktree checkout から、scripts/agent-ops/run_worktree_agent_runtime_smoke.pyを live 実行した結果。環境確認(Runtime Verification Applicability の
execution_environment):{"schema":"CLAUDE_GPT_LAUNCH_RESULT_V1","status":"ok","mode":"check_only","bind_ok":true,"model_alias_ok":true,"chatgpt_auth":{"available":true,"detail":"authenticated"}}herdr status serverもstatus: runningを確認済み。SKIP 条件(proxy/認証/herdr 利用不能)には該当しないため、以下は SKIP ではなく genuine PASS。AC3: structured lane(非対話、
--claude-bin scripts/claude-gpt/launch.sh --claude-adapter claude-gpt)→ PASSBash tool 呼び出し(
echo RUNTIME_SMOKE_STRUCTURED_OK)とgeneral-purposeSubAgent の起動・完了が native event stream 上で確認できた。claude-gpt launcher(--separator 挿入 +CLAUDE_GPT_RUNTIME_SMOKE_HOOKS=subagent-start-stop環境変数チャンネル)経由の実対話・tool 呼び出し・SubAgent 呼び出しが genuine に成立している。AC4: isolated herdr interactive lane(Lane B、
--claude-bin scripts/claude-gpt/launch.sh --claude-adapter claude-gpt)→ PASS--claude-binを isolated session 専用の PATH shim(claudesymlink)経由で herdr の--kind claude解決に反映し、claude-gpt launcher 経由の起動・入力・応答が観測された。isolated session は実行後 stop → delete →session list --jsonでの消失確認まで完了し、人間の使用中 herdr session には一切相乗りしていない。AC7: Herdr session snapshot 保全検証 → PASS
runner 自身の evidence:
control-plane 側の独立検証(runner の自己申告に依存せず、実行前後で自ら
herdr session list --json/herdr api snapshotを直接取得し比較):herdr session list --json: 実行前後で完全一致(差分なし)herdr api snapshot:focused_workspace_id/focused_tab_id/focused_pane_idが実行前後で完全一致(w4/w4:t3/w4:p3のまま不変)、既存 7 agent pane のworkspace_id/tab_id/pane_idの集合も実行前後で完全一致。以上により、isolated interactive lane の実行が人間の使用中 Herdr session(workspace/agent/focus を含む)に一切影響を与えていないことを、runner 自身の evidence と control-plane の独立確認の両方で確認した。
証跡に含まれないもの
credential・OAuth token・prompt 全文・tool 入出力全文は本コメントに含めていない(
summary.mdは allowlist-only フィールドのみを出力する設計であり、この comment もそれをそのまま転記している)。関連: Issue #2174(https://github.com/squne121/loop-protocol/issues/2174)、PR #2176(https://github.com/squne121/loop-protocol/pull/2176)
Co-Authored-By: Claude Sonnet 5 [email protected]
squne121 commentedon Aug 15, 2026
Issue #2174 / PR #2176 live AC3/AC4/AC7 re-verification (post fix_delta iteration 2)
tested_head:
6db0625f11299d88ad0a250b058d40a120fce19fexecuted: local live environment (
raine/claude-code-proxy+ ChatGPT subscription auth + herdr 0.8.0, all confirmed available viascripts/claude-gpt/launch.sh --check-only, exit 0)AC3 (structured lane): PASS
Command:
--runtime claude --mode structured --claude-bin scripts/claude-gpt/launch.sh --claude-adapter claude-gptexit_code: 0,errors: [],expected_markers_missing: []resolved_executable: .../scripts/claude-gpt/launch.shchild_spawn_observed: True,child_completion_observed: True,child_spawn_source: tool_use_result,child_completion_source: tool_use_result_status_completedAC4 (isolated herdr interactive lane, Lane B): BLOCKED (not PASS, not SKIP)
Command:
--runtime claude --mode interactive --claude-bin scripts/claude-gpt/launch.shCausal-proof mechanism (Findings 1+2 of the OWNER's iteration-2 review) is confirmed to function correctly, after an additional live-only bug was found and fixed during this re-verification:
herdr workspace create --env PATH=<shim>:<original>DOES set the newly spawned pane shell's initial process PATH (confirmed viaherdr pane run <pane> 'echo $PATH'), but the interactive login shell then re-sources its own.bashrc/.zshrc/.profile, which on this environment prepends~/.local/bin(containing the real nativeclaudebinary) ahead of the shim -- silently defeating the override exactly as Finding 1 warned. Fixed by explicitly re-exporting PATH inside the already-running (post-rc) pane shell viaherdr pane run <pane> "export PATH='<shim>':\"\$PATH\""immediately beforeagent start(pushed as commit 6db0625 on this same PR).--kind claudeflag injection) confirmed: the forwarder script IS invoked, the nonce/receipt is written and read back correctly, and the real launcher (scripts/claude-gpt/launch.sh) genuinely execs -- proving Findings 1+2 are structurally fixed at the PATH-resolution and shim-integrity layer.However, AC4 end-to-end still cannot PASS, for a reason outside this Issue's Allowed Paths:
herdr agent start --kind claudealways injects a fixed--strict-mcp-configflag into the launched process's argv (a Herdr-side behavior, not runner-side).scripts/claude-gpt/launch.shexplicitly rejects--strict-mcp-configas a policy-weakening flag it refuses to accept from a caller ({"status":"blocked","reason":"policy_weakening_flag_rejected","flag":"--strict-mcp-config"}), confirmed both with and without a--separator inserted ahead of it.launch.shexits with a blocked status instead of becoming an interactively-readyclaudeprocess,herdr agent startitself fails before the isolated lane can ever reach a point where marker/turn/cleanup evidence is meaningful.This is a genuine structural incompatibility between Herdr's fixed
--kind claudeinvocation contract andscripts/claude-gpt/launch.sh's own flag policy -- not fixable within Issue #2174's Allowed Paths (scripts/claude-gpt/launch.shis Out of Scope, and "scripts/claude-gpt/launch.sh 自体の修正が必要と判明した場合" is one of this Issue's explicit Stop Conditions). Per the Issue's fallback_policy, no PASS is claimed here from this evidence. This is a discovered functional incompatibility (proxy/auth/herdr are all fully available) requiring an OWNER decision, not a SKIP-77 (missing-prerequisite) condition.Recommended follow-up (OWNER decision required, #2158/#2162 scope): either (a)
scripts/claude-gpt/launch.shshould tolerate/pass through--strict-mcp-configwhen invoked as a drop-inclaudereplacement under Herdr (since Herdr, not an untrusted caller, is the one injecting it), or (b) a different Herdr invocation mode that does not auto-inject--strict-mcp-configneeds to be identified for this interactive-launcher-substitution use case.AC7 (Herdr full snapshot preservation): mechanism validated PASS (independent of the AC4 launcher blocker)
Since AC4's specific claude-gpt run never reaches a stable interactive state (see above), AC7 was independently validated using the SAME isolated-interactive-lane code path with the native (ambient)
clauderuntime (--runtime claude --mode interactive, no--claude-bin) to confirm the full-snapshot mechanism itself (Findings 3+4 of the OWNER's iteration-2 review) genuinely works end-to-end in this live environment:exit_code: 0,errors: []herdr_workspace_snapshot_before_captured: True,herdr_workspace_snapshot_after_captured: Trueherdr_workspace_snapshot_diffs: [],herdr_workspace_snapshot_preserved: Trueherdr session list --jsonbefore/after both confirmed clean (onlydefaultremained; isolated session correctly created and removed)This confirms
capture_all_herdr_workspace_snapshots()(multi-session enumeration, Finding 4) andcapture_herdr_workspace_snapshot()(full identity records includingterminal_id/agent_session/panes/tabs/workspaces/layouts, Finding 3) function correctly against the real installed herdr 0.8.0 binary, not merely against fake-herdr test fixtures.Summary
launch.shflag-policy incompatibility requiring OWNER decisionNo credentials, OAuth tokens, or full prompt/tool-output text are included above.
squne121 commentedon Aug 16, 2026
Issue #2174 / PR #2176 AC4 実機再検証 evidence(CLAUDE_GPT_CLAUDE_BIN 自己再帰バグ修正後、2026-08-16)
scripts/claude-gpt/launch.sh(Issue #2158 / PR #2162 由来)と PR #2176 の isolated herdr interactive lane を組み合わせた live 実機検証で、修正前はherdr agent start failed:(stdout/stderr 空)による genuine FAIL が再現していました。根本原因
run_interactive_herdr_isolated()が herdr 自身の--kind claude解決のため PATH 先頭に prepend する forwarder shim ディレクトリを、scripts/claude-gpt/lib.shのclaude_gpt_resolve_claude_bin()(CLAUDE_GPT_CLAUDE_BIN未設定時にcommand -v claudeへフォールバック)が自己参照的に発見してしまい、launch.shが自分自身を再帰的に exec、その再帰呼び出し自身の引数パーサーが--strict-mcp-configを拒否して exit 2 で終了、herdr の agent readiness wait がタイムアウトしていました。比較 matrix(native claude / main の launch.sh / 候補修正版 launch.sh)で、特定のlaunch.sh実装ではなく PATH シム統合自体の構造的欠陥であることを確認済みです。修正内容(PR #2176 の Allowed Paths 内、
scripts/claude-gpt/は無変更)claude_adapter == "claude-gpt"の場合のみ、シム prepend 前の元 PATH に対してshutil.which("claude")を実行し実ネイティブバイナリの絶対パスを解決、CLAUDE_GPT_CLAUDE_BINとして isolated session env(herdr workspace create --envとherdr pane runre-pin の両方)に設定するよう変更しました。修正後の live 実機再検証(genuine PASS)
修正後コードで、
defaultsession には一切相乗りしない使い捨て isolated named herdr session を使い、scripts/claude-gpt/launch.shを--claude-binに指定して再検証:exit_code: 0,final_state: done,detected_agent: claude,turns_completed: 1expected_markers_missing: [](応答テキストにマーカーを実際に観測)cleanup_attempted: True,cleanup_confirmed_removed: True(isolated session の stop/delete/消失確認済み)herdr_workspace_snapshot_preserved: True,herdr_workspace_snapshot_diffs: []herdr session list --json/herdr api snapshotを独立取得し、pre-existingdefaultsession が完全に不変であることを確認(diff 完全に空)修正前は同一条件で genuine FAIL、修正後は genuine PASS したことを確認しており、今回の fix_delta が実際にバグを解消したことを示します。
詳細は PR #2176 本文「[追加修正] CLAUDE_GPT_CLAUDE_BIN 自己再帰バグの発見と修正」節を参照: #2176
実装: worktree-agent-runtime-smoke に claude-gpt launcher 選択入力を追加する (#2174…