Repository navigation
Surface richer Codex activity and public output - #343
Merged
Merged
Conversation
Register the complete public Codex hook lifecycle locally and remotely, then translate provider-specific tool calls into bounded, privacy-aware status details without changing approval routing. Constraint: Codex requires hooks to be reviewed again whenever hooks.json content changes. Rejected: Rely on app-server polling alone | it misses CLI tool lifecycle detail and remote sessions. Confidence: high Scope-risk: moderate Directive: Keep raw toolName values for approval decisions; activityLabel is display-only. Tested: 8 Codex rich-status tests; 940-test suite excluding one environment-dependent PID assertion; release build. Not-tested: Signed app packaging and live hook re-trust on a deployed installation.
The compact island now follows public Codex transcript output instead of falling back to a generic thinking label between tool calls. A transient per-turn field prevents stale replies from crossing task boundaries, while remote hooks attach a bounded public transcript summary to lifecycle events. Constraint: Remote Codex sessions can refresh only when a hook event is forwarded; this is not token-level streaming. Rejected: Forward response_item agent_message content | it may contain private inter-agent traffic. Confidence: high Scope-risk: moderate Directive: Keep the public-output parser allowlisted; never broaden it to reasoning, encrypted content, tool output, or response_item agent_message. Tested: 116 Codex-focused tests; 189 merged feature/config tests; remote Python filter tests; release build. Not-tested: Signed app installation and live remote s-m hook delivery.
The quick probe required the contiguous run
`"payload":{"type":"message","role":"assistant"`, but Codex serializes
model output with its Responses API id between `type` and `role`
(`{"type":"message","id":"msg_…","role":"assistant",…}`). Every real
assistant record was therefore classified irrelevant and never parsed.
Since Codex switched the TUI and `codex exec` to paginated thread
history, rollouts no longer persist `event_msg` `agent_message` either,
so on current Codex the live-output line never updated locally.
Match the message-payload, assistant-role and output_text markers
independently within the same bounded 4 KiB prefix, and add fixtures
copied from a real 0.155 rollout (id, phase, metadata passthrough),
user/developer messages with ids, and a paginated Reasoning item.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Interrupting the root Codex turn does not stop agents it spawned; they keep running and emit SubagentStop when their turn ends. The latch dropped that event, so the child stayed in `subagents` and the next root Stop saw "active subagents" and pinned the card to running/Agent. SubagentStop only removes subagent state and cannot revive an idle parent, so exempt it from the latch. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`sanitizedSummary` rebuilt eight NSRegularExpressions on every call, and it runs for every Codex PreToolUse / PermissionRequest description. Hoist them into a static table; an invalid pattern now trips an assertion in debug instead of being skipped silently. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Codex fires SubagentStop at the end of every child turn, and agent_id is the child's thread id, reused for follow-up turns sent through send_message / followup_task with no new SubagentStart. Now that the installer registers SubagentStop, the reducer's closed-subagent tombstone made CodeIsland drop every later turn's hooks and auto-deny their PermissionRequests via shouldSuppressClosedSubagentUI. For Codex SubagentStop, remove the subagent entry but skip the tombstone; Codex awaits hooks in order, so no stale tool hook trails the stop, and the next turn's hooks recreate the entry. Other providers (single-use Claude Task ids, Cursor Tasks) keep the tombstone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
wxtsky
force-pushed
the
feature/rich-codex-hooks
branch
from
September 23, 2026 03:09
db2e1bb to
81a6512
Compare
Owner
|
Merged (890b929) — thanks a lot, @954708775. The richer Codex statuses and the careful public-output/privacy boundary are a great addition, and the redaction tests are thorough. I checked the hook contract against Testing against real rollouts turned up three things, which I fixed on your branch before merging:
Plus the redaction regexes are now compiled once. Ships in the next release. |
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.
Summary
This PR makes Codex sessions more informative than a generic
thinkingstate while preserving the boundary between public assistant output and private model internals.thinking.PermissionRequesthook registration so approval requests reach the existing CodeIsland approval UI.0.3.0and public-output summaries.Behavior
Local sessions
CodeIsland tails Codex rollout transcripts and extracts only model-visible assistant output. Status text updates as new public output is written, without waiting for the session to stop.
Remote sessions
The remote helper includes a bounded public-output summary in lifecycle events sent through the existing SSH socket. Remote updates are event-driven rather than token-streamed, so they refresh when Codex emits a hook event.
Privacy and safety
The transcript parser intentionally excludes:
Extracted text is normalized and bounded before display. Existing socket permissions and session routing remain unchanged.
Implementation notes
CodeIslandCore.Validation
./build.sh.0.3.0, socket forwarding, andPermissionRequestregistration.The existing Swift 6 Sendable warnings remain unchanged and are outside this PR.