feat(agent-client): port Codex steer/compact/review/trust/permissions to CodexThreadClient#7
Open
huntharo wants to merge 1 commit into
Open
feat(agent-client): port Codex steer/compact/review/trust/permissions to CodexThreadClient#7huntharo wants to merge 1 commit into
huntharo wants to merge 1 commit into
Conversation
… to CodexThreadClient
Adds the rich Codex thread operations that the in-tree PwrAgent client had but
CodexThreadClient lacked, so hosts can drive them through the kit:
- steerTurn(threadId, input, expectedTurnId) → turn/steer (inject input into the
in-flight turn; precondition-guarded)
- compactThread(threadId) → thread/compact/start (summarize history)
- startReview({threadId, target, delivery?}) → review/start (inline/detached)
- setThreadPermissions(...) → thread/resume overlay (model/approval/sandbox/tier)
- trustProject({projectPath, configPath?}) → config/value/write
All turn-producing methods stream their output through the existing
normalizeNotification → onEvent path, so subscribers see normalized events with
no extra wiring. Id extraction tolerates snake_case / nested `turn` shapes via a
small ported codex-extract helper (asRecord/pickString/extract*). Methods are
Codex-native (not on AgentBackend), slotting alongside startThreadNative.
6 new tests drive each method through a fake transport (wire method + payload +
id extraction + fallbacks). Full agent-client suite: 46 passing. Typecheck +
build green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
huntharo
force-pushed
the
claude/codex-feature-port
branch
from
June 8, 2026 13:58
8024d51 to
d569b4c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the rich Codex thread operations the in-tree PwrAgent client had but
CodexThreadClientlacked, so hosts (PwrAgent, PwrSnap) can drive them through the kit instead of a bespoke in-tree client.New Codex-native methods on
CodexThreadClientsteerTurn({ threadId, input, expectedTurnId })turn/steer{ threadId, turnId }compactThread(threadId)thread/compact/start{ threadId, turnId, itemId? }startReview({ threadId, target, delivery?, cwd? })review/start{ threadId, reviewThreadId, turnId }setThreadPermissions({ threadId, model?, approvalPolicy?, sandbox?, serviceTier?, cwd? })thread/resumeoverlay{ threadId }trustProject({ projectPath, configPath? })config/value/write{ projectPath, configPath? }All turn-producing methods stream their output through the existing
normalizeNotification → onEventpath — subscribers see normalizedNormalizedThreadEvents with no extra wiring. Ids are extracted with tolerance for snake_case / nestedturnshapes via a small portedcodex-extracthelper (asRecord/pickString/extract*).Design
AgentBackendinterface), slotting alongside the existingstartThreadNative/startTurnNativepair — they have no cross-backend analog.CodexAppServerClientreference implementations.setThreadPermissionsmatches in-tree behavior: reasoning effort is a per-turn (turn/start) setting, not a resume field, so resume doesn't carry it.Tests
6 new tests drive each method through a fake transport (wire method + payload + id extraction + fallbacks). Full
@pwrdrvr/agent-clientsuite: 46 passing. Typecheck + build green.Consumer
PwrAgent's
CodexKitBackendClient(PwrAgent PR #679) calls these to make itsPWRAGENT_CODEX_KITpath support steer/compact/review — no longer core-chat-only. That PR currently links a local tarball of this branch; once this lands and a version is published, it switches to the version pin.🤖 Generated with Claude Code