Skip to content

Fix Codex non-tmux session output and add codexlogview replay#40

Merged
mzhaom merged 5 commits intomainfrom
fix/codex-build
Feb 13, 2026
Merged

Fix Codex non-tmux session output and add codexlogview replay#40
mzhaom merged 5 commits intomainfrom
fix/codex-build

Conversation

@mzhaom
Copy link
Member

@mzhaom mzhaom commented Feb 12, 2026

Summary

  • fix provider-runner fallback handling so Codex/Gemini turns still emit user-visible output when streaming events are missing
  • add protocol/stderr logging hooks for Codex/Gemini sessions and live integration coverage for non-tmux multi-turn builder flows
  • align Bramble and replay rendering (no prompt truncation, shared text renderer, follow-up prompt as status + full text)
  • add codexlogview CLI to replay Codex protocol logs through Bramble OutputModel
  • extend codexlogview to replay multiple files in one command and add compact turn summaries (Tn $cost in:X out:Y) with full mode opt-out
  • improve replay diagnostics by surfacing approval-request events and deriving status (running/idle/failed/completed) from protocol state

Validation

  • bazel test //bramble/cmd/codexlogview:codexlogview_test //bramble/session:session_test //multiagent/agent:agent_test --test_timeout=240
  • replayed all discovered live logs under /tmp/bramble-live-logs/*/*-codex.protocol.jsonl with codexlogview in compact and full modes

Note

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 providerRunner and synthesizing missing text/thinking from AgentResult while filtering stale/whitespace-only deltas.

Introduces a shared agentstream interface + generic bridgeEvents to replace per-provider bridge code, and updates claude, acp, and codex SDK 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 new codexlogview CLI that replays Codex protocol JSONL logs through Bramble’s OutputModel (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.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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>
@mzhaom mzhaom merged commit 679c041 into main Feb 13, 2026
2 of 3 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@mzhaom mzhaom deleted the fix/codex-build branch February 13, 2026 16:39
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

Comments