Fix Codex non-tmux session output and add codexlogview replay#40
Fix Codex non-tmux session output and add codexlogview replay#40
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Replace three provider-specific bridge functions (bridgeClaudeEvents, bridgeCodexEvents, bridgeACPEventsToChannel/bridgeACPEventsToHandler) with a single generic bridgeEvents[E any] that uses the new agentstream interfaces. SDK event types implement StreamEventKind() plus data-access methods; the bridge does an inline type assertion and switches on kind. Delete MapEvent() from codex (MappedEvent/ParseMappedNotification kept for codexlogview). Net result: -422 lines added, +191 lines removed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The bridge called observeText/observeThinking for turn-tracking side effects but unconditionally forwarded all events, including whitespace- only deltas that should be suppressed. Now whitespace-only text and thinking events are filtered out while all other event types continue to be forwarded unconditionally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| ReasoningOutputTokens: msg.Info.TotalTokenUsage.ReasoningOutputTokens, | ||
| TotalTokens: msg.Info.TotalTokenUsage.TotalTokens, | ||
| } | ||
| } |
There was a problem hiding this comment.
Redundant nil check after early return guard
Low Severity
The msg.Info.TotalTokenUsage != nil check on line 154 is redundant because lines 150–152 already return early when either msg.Info or msg.Info.TotalTokenUsage is nil. The if guard always evaluates to true at this point, adding unnecessary indentation around the usage assignment.


Summary
codexlogviewCLI to replay Codex protocol logs through Bramble OutputModelcodexlogviewto replay multiple files in one command and add compact turn summaries (Tn $cost in:X out:Y) withfullmode opt-outrunning/idle/failed/completed) from protocol stateValidation
bazel test //bramble/cmd/codexlogview:codexlogview_test //bramble/session:session_test //multiagent/agent:agent_test --test_timeout=240/tmp/bramble-live-logs/*/*-codex.protocol.jsonlwithcodexlogviewin compact and full modesNote
Medium Risk
Touches core streaming/event-bridging and session execution paths across multiple providers, so regressions could affect live session output and tool/turn completion handling despite added tests.
Overview
Fixes non-tmux Codex/Gemini sessions that could finish without visible output by adding turn-scoped observation in
providerRunnerand synthesizing missing text/thinking fromAgentResultwhile filtering stale/whitespace-only deltas.Introduces a shared
agentstreaminterface + genericbridgeEventsto replace per-provider bridge code, and updatesclaude,acp, andcodexSDK events to implement the new streaming interfaces (including Codex scope filtering and permission-mode→approval policy mapping).Adds protocol/stderr logging plumbing (new
--protocol-log-dir/BRAMBLE_PROTOCOL_LOG_DIR) and a newcodexlogviewCLI that replays Codex protocol JSONL logs through Bramble’sOutputModel(optional compact turn/token summaries, approval-request surfacing, status derivation). Also aligns TUI/replay rendering by avoiding prompt truncation and only applying markdown rendering to multi-line assistant text.Written by Cursor Bugbot for commit cc2524a. This will update automatically on new commits. Configure here.