Skip to content

feat(agents): Codex implements, Claude reviews, and lanes clean up opened workspaces - #266

Merged
furedea merged 10 commits into
mainfrom
feat/codex-implements-claude-reviews
Oct 21, 2026
Merged

furedea merged 10 commits into
mainfrom
feat/codex-implements-claude-reviews

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

概要

ユーザーが Codex による実装を求めたとき,実装を Codex,レビューを Claude が行う流れを整備する.あわせて,レーンのために開く primary workspace を,安全に帰属を確認できる形で後始末できるようにする.

変更内容

  • Opus 中 effort のレーン起動を許可(-- --model opus --effort medium のみ,allowed/forbidden ルールと tests).
  • herdr-delegation に Codex 実装フローとレビュー方向の反転を追記.発動条件は「ユーザーが Codex による実装を求めたとき」.Codex への実装委任は task --write --model gpt-6.1-sol --effort medium を明示し,レビューは config の既定(gpt-6.1-sol, xhigh)のままとする(実装は medium,レビューは xhigh).
  • Codex は sandbox から nix daemon に届かないため,Claude レーンが Nix のハッシュ計算と nix チェックを行い,必要なら値を Codex に渡す旨を追記.
  • gh api の変数ダブルクォート規則を branches.md に追記.
  • workspace の後始末を作り直した(list 差分,実行前のパス記録,close --group の自動許可はいずれも安全に帰属を確認できないため廃止):
    • 引き継ぎ: primary が未オープンなら親が herdr workspace create --cwd <primary> --label <repo> --no-focus を単純な 1 コマンドとして実行し,worktree create --workspace <primary-id> を使う.
    • 所有: 複合コマンド・パイプ・リダイレクト・ラッパーを含まない単一の workspace create が成功したときの結果 JSON から,ID と label(.result.workspace),path(.result.root_pane.cwd),root pane の terminal_id を記録する.記録はそのセッションの state にのみ置き,他セッションや SessionStart は読まない.
    • インスタンス識別子: herdr は server id・pid・起動時刻を公開していないため,create 結果の .result.root_pane.terminal_id(terminal ごとに一意)を記録する.workspace ID の再利用やサーバー再起動では別の値になる.
    • 後始末: lane の workspace を 1 つずつ閉じ(lane 名の所有で許可),最後に自セッションが作った primary を --group なしで閉じる.herdr 自体が linked workspace の残る間は workspace_group_close_required で拒否する.primary の close は,生きている workspace の ID・label・path が一致し,herdr pane list --workspace <id> に記録した terminal_id の pane が残っており,エージェントが動いていない場合のみ許可.lane の close も primary の close も,環境変数代入・env などのラッパー・herdr の global option の前置・複合コマンド・パイプ・リダイレクトを含まない単一の直接呼び出しのときだけ自動承認し(接続先の上書きを防ぐ.同じ制約を agent start / agent prompt / worktree remove / agent rename にも適用し,形の判定でパーサーが失敗した場合も確認を求める),それ以外と --group(位置を問わず)は常に確認を求める.close 時に記録は失効.primary への worktree remove も確認を求める.
    • SessionStart の cleanup_worktrees.py は,マージ済み worktree の workspace のみ閉じ,primary は閉じない.
    • command_permissions.json の workspace create を ask から allow に変更(形式は hook ルールで制限).

確認

  • 回帰テストを先に追加: 複合コマンド・リダイレクト・ラッパー経由で偽装した出力,他セッションの記録,別の terminal_id(pane なしを含む),同一 ID・label・path でも terminal が違う場合,primary 内のエージェント,--group(どの位置でも)は確認を求める.通常の create → lane close → primary close は許可.失敗した create などの既存ケースも維持
  • uv run --frozen pytest tests/agents: 1923 passed
  • lefthook pre-commit: 全て成功
  • 実機の herdr での通し確認(create → worktree create --workspace → close --group)は,sandbox から herdr のソケットに届かず未実施.

🤖 Generated with Claude Code

furedea and others added 9 commits October 21, 2026 21:40
…rktree-open workspaces

Allow `-- --model opus --effort medium` for Claude lanes, document the Codex
implementation flow and the gh api quoting rule, and treat a primary-checkout
workspace opened by `herdr worktree open` like one opened by `worktree create`.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Record the workspace IDs a successful `worktree create` or `worktree open`
opened through a PostToolUse step instead of the repository path before the
command ran, and end the claim when the workspace closes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… its group

Replace the list-diff ownership with an explicit `herdr workspace create` whose
successful result JSON records the primary's ID, path, and label. Allow
`workspace close --group` only while the live workspace still matches that
record and only this session's lanes run in the group, and let the session-start
sweep close an idle recorded primary.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
`herdr workspace create` returns no checkout path; record the ID and label from
`.result.workspace` and the path from `.result.root_pane.cwd`, then compare with
`workspace list` at close time.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Record a primary only from one plain `workspace create` call's result, bind it to
the Herdr socket identity, keep it in the creating session, and allow its plain
close only while the live workspace still matches and no agent runs in it. Drop
the group close and the sweep's primary close.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Herdr exposes no server ID or start time, so record the root pane's terminal_id
from the create result and require the live workspace to still hold a pane with
it (herdr pane list --workspace) before the primary's close is allowed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Ask for a close behind an environment assignment, wrapper, global option,
compound command, pipe, or redirection, since Herdr would run it against a
target the ownership check did not verify.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea-agent
furedea-agent Bot force-pushed the feat/codex-implements-claude-reviews branch from 42c1930 to 10b8c87 Compare October 21, 2026 12:41
Ask for agent start, agent prompt, workspace close, worktree remove, and agent
rename unless the command is one simple direct Herdr call, so an environment
override or wrapper cannot point an approved action at another server. A parser
failure while checking the shape also asks.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea
furedea merged commit d62311e into main Oct 21, 2026
11 checks passed
@furedea
furedea deleted the feat/codex-implements-claude-reviews branch October 21, 2026 13:30
furedea added a commit that referenced this pull request Nov 21, 2026
…487)

agent-config を 0.4.0,agent-harness を 0.9.15 に上げる.T3 で lane
を回す仕組みと,Antigravity の provider・hook adapter が入る.Antigravity の hook
の配線と有効化は別の PR.

| 入力 | 変更前 | 変更後 |
| --- | --- | --- |
| `agent-config` | `3dfa0ad8`(0.3.1 後) | `51f91f9a`(v0.4.0) |
| `agent-harness` | `83caaa98`(0.9.14) | `c5b13036`(0.9.15) |

- [ ] CI
- [ ] 反映後,`~/.claude/settings.json` の `sandbox.excludedCommands` に `t3
thread *` がある
- [ ] 反映後,`delegation` skill が Claude と Codex に入っている

<details>
<summary>内容と出典</summary>

- agent-config 0.4.0:`t3 thread` の guard(#265),T3 の lane worktree
の片付け(#266),`delegation` skill(#268),ADR-0028(#267),Antigravity の hook
adapter(#263).furedea/agent-config#264
- agent-harness 0.9.15:Antigravity
provider(furedea/agent-harness#257).`programs.agent-harness.antigravity`
は未設定なので,この PR では Antigravity の設定は作られない想定
- 変更は `flake.lock` のみ

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant