Skip to content

fix(agent-status): keep Codex's hidden title-thread prompt off the sidebar heading - #33746

Merged
nwparker merged 6 commits into
mainfrom
nwparker/agint-30049
Oct 26, 2026
Merged

nwparker merged 6 commits into
mainfrom
nwparker/agint-30049

Conversation

@nwparker

@nwparker nwparker commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​64 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​64
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​56 $\color{#cf222e}{\Huge{\mathbf{−}}}$​20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36

ELI5

When you send Codex your first message, Codex quietly opens a hidden second chat to come up with a short title for the conversation. That hidden chat's instructions start with "Generate a concise, single-line task title…". On some machines Codex also reports that hidden chat to Orca. Orca mistook it for the real conversation, so every Codex card in the sidebar got that English instruction as its heading. Now Orca recognizes the hidden title chat and ignores it, and the card keeps showing your real task.

Root cause

  • Codex starts the title chat on the first user message (codex-rs/tui/src/app/thread_routing.rs:2073, thread_title.rs:62). It is an ephemeral thread (temporary_structured_request.rs:151), so its hooks carry transcript_path: null. Its prompt always starts with thread_title_instructions() (thread_title.rs:266), and that text has been the same since the feature was added ([Feature]: Give plugins the focused workspace's id and path in workspace.readContext and workspace.changed #40492).
  • Codex turns hooks off for that thread (temporary_structured_request.rs:74, features.hooks = false). A managed requirements.toml or MDM config that pins hooks on overrides that, and then the thread's SessionStart / UserPromptSubmit / Stop reach Orca. This explains why we couldn't reproduce it on a stock install.
  • isForeignEphemeralCodexThread lets any rollout-less SessionStart with source: "startup" take the pane, because that's how a new codex exec --ephemeral conversation has to replace a row (covered by the existing relay test). The title thread starts the same way, so it took over the row:
    • its prompt became the heading;
    • its session replaced the row's providerSession. The thread_name//rename title Orca reads for that session couldn't resolve, which is why a rename only showed on the third line;
    • its Stop marked the pane done while the real turn was still running.
  • The sticky task title (getAgentRowPrimaryText) only applies while the prompt is still the Orca dispatch, so the title prompt also hid --task-title.

What changed

  • codex-ephemeral-threads.ts (now codexHookEventForEphemeralThread, applied in provider-dispatch.ts next to codexHookEventForEndedTurn): a rollout-less SessionStart(startup) while the row holds another Codex thread with a rollout is held. It doesn't change state, session or tool snapshot. When that session sends its first UserPromptSubmit, one of two things happens:
    • The prompt starts with Codex's title instructions: the session is recorded as a foreign ephemeral thread (like /side forks), and its prompt and Stop are dropped.
    • Any other prompt: the held start is replayed as SessionStart carrying that prompt. The new conversation takes the pane with no stale prompt, and relayed desktops let it through as before.
  • The hold doesn't depend on the row's state, so it also covers the main Stop arriving before the title thread starts.
  • Known hidden-thread prompts: title (tui/src/app/thread_title.rs:266) and recap (context-fragments/src/recap_prompt.rs:10). These are the only users of temporary_structured_request.rs.
  • server-status-update.ts: any hook with an explicit prompt, including the replayed SessionStart, now clears the previous completion stamp, as UserPromptSubmit already did.
  • listener-state.ts: one per-pane map for the held start, cleared and moved with the other Codex pane caches.

With the main row kept, the existing heading priority applies again: manual rename, then the session's thread_name, then the orchestration task title, then the dispatched prompt.

Verification

  • server-codex-side-thread.test.ts covers three hidden-thread cases:

    • a title thread during the main turn;
    • a title thread after a main Stop that arrived first;
    • a recap thread.

    Each case checks the row right after the hidden SessionStart and again at the end. On main the title case fails: the row gets the title prompt, switches to the title session, and shows done mid-turn.

  • A new local test has a new ephemeral conversation take over a row that's still working, showing the new prompt and not the old one.

  • The existing /side and "new ephemeral conversation replaces a row" tests (desktop and relay) still pass.

  • pnpm test src/main/agent-hooks src/shared/agent-hook-listener src/wsl-guest src/relay: 2398 passed. pnpm tc:node and check:code-quality:changed are clean.

  • Not reproduced with a real CLI: that needs a system-wide /etc/codex/requirements.toml (or MDM) that pins hooks, and we won't write that on a shared machine.

Risk

  • Detection relies on Codex's literal title and recap instruction prefixes. If Codex rewords it, we're back to today's behavior, nothing worse.
  • A new ephemeral conversation that replaces a pane takes over on its first prompt instead of its SessionStart. Codex fires them back to back.
  • The fix runs on the execution host (local, paired server, relay). An old relay with a new desktop keeps today's behavior.

Visual proof: N/A. This changes the agent-status state the card reads; the before/after is in the regression test.

Fixes #30049

…debar heading

Codex titles a new thread in a hidden ephemeral thread. When managed config pins hooks on,
that thread's SessionStart (source startup) took the pane and its prompt became the row heading.
Drop its prompt as a foreign ephemeral thread and keep the row's prompt across rollout-less starts.

Fixes #30049

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84b91ff4-63c4-4837-a8a2-28e4a06b6952
Commits

Reviewing files that changed from the base of the PR and between e5f531c and 0dabd47.

Files selected for processing: 6
  • src/main/agent-hooks/server-codex-side-thread.test.ts
  • src/main/agent-hooks/server/server-status-update.ts
  • src/shared/agent-hook-listener/listener-state.ts
  • src/shared/agent-hook-listener/provider-dispatch.ts
  • src/shared/agent-hook-listener/providers/codex-ephemeral-threads.ts
  • src/shared/agent-hook-listener/providers/codex-events.ts

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 95895b66-cddc-4ee7-ac6a-f2e88a91fabb
Commits

Reviewing files that changed from the base of the PR and between 838a3e2 and e5f531c.

Files selected for processing: 5
  • src/main/agent-hooks/server-codex-side-thread.test.ts
  • src/shared/agent-hook-listener/listener-state.ts
  • src/shared/agent-hook-listener/provider-dispatch.ts
  • src/shared/agent-hook-listener/providers/codex-ephemeral-threads.ts
  • src/shared/agent-hook-listener/providers/codex-events.ts
Files with no reviewable changes: 1
  • src/shared/agent-hook-listener/providers/codex-events.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The listener now classifies Codex ephemeral-thread events before normal event processing. It holds qualifying startup events, records title-generation threads as forks, and suppresses events from known forks. The listener state tracks held starts through pane cache operations. A test checks that title-generation events do not change the main Codex row and that the main turn can finish.

Priority: Pending latest changes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to e5f53

The identified sidebar identity regression is addressed, with no remaining actionable merge-blocking risk established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing Codex's hidden title-generation thread from changing the sidebar heading.
Linked Issues check Passed [#30049] The PR prevents Codex's hidden title thread from replacing the real Codex row. It holds a rollout-less startup when another Codex session owns the pane. It drops the title prompt and later `S…
Out of Scope Changes check Passed The changed production code handles Codex ephemeral-thread events and moves the related per-pane state with existing pane caches. The new test covers the reported title-thread failure and its event-or…
Description check Passed The description is complete and relevant. It explains the problem, root cause, implementation, testing, risks, visual-proof status, and linked issue. It does not use every template heading, and it omi…
Full details: Linked Issues check

Explanation

[#30049] The PR prevents Codex's hidden title thread from replacing the real Codex row. It holds a rollout-less startup when another Codex session owns the pane. It drops the title prompt and later Stop after it identifies the Codex title prefix. The new regression test covers title-thread startup during the main turn and after the main Stop. The test verifies the real prompt, provider session, and state remain unchanged. Existing heading priority can therefore use the real session: manual rename, thread_name, task title, then the real prompt.

Full details: Out of Scope Changes check

Explanation

The changed production code handles Codex ephemeral-thread events and moves the related per-pane state with existing pane caches. The new test covers the reported title-thread failure and its event-order variants. The changes support #30049 and do not add unrelated provider behavior or product functionality.

Full details: Description check

Explanation

The description is complete and relevant. It explains the problem, root cause, implementation, testing, risks, visual-proof status, and linked issue. It does not use every template heading, and it omits the checklist and explicit Review sections, but the required information is largely present under equivalent headings.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef49393c-8def-4c5c-b2e4-dde579a28826
Commits

Reviewing files that changed from the base of the PR and between 5ca8881 and 838a3e2.

Files selected for processing: 3
  • src/main/agent-hooks/server-codex-side-thread.test.ts
  • src/shared/agent-hook-listener/providers/codex-ephemeral-threads.ts
  • src/shared/agent-hook-listener/providers/codex-events.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

nwparker and others added 5 commits October 25, 2026 20:08
…hows what it is

The hidden title thread's SessionStart no longer swaps the row's state, session or tool snapshot.
A held start is dropped with the title prompt, or replayed as SessionStart on a new conversation's
first prompt so relayed desktops still let it take the pane. Covers a main Stop arriving first.

Co-Authored-By: Claude <noreply@anthropic.com>
…e old completion stamp on takeover

Co-Authored-By: Claude <noreply@anthropic.com>
@nwparker
nwparker merged commit 4c9a6a4 into main Oct 26, 2026
47 of 48 checks passed
Fartown pushed a commit to Fartown/orca that referenced this pull request Nov 3, 2026
…am tests

D-010 (user decision 2026-11-03): a tab's manual rename and a session's manual
name now rank above the Provider name, generated names and the live title on
every surface (tab, Dashboard, Activity, notifications, mobile list), which is
upstream's order. Quick-command labels stay in the label tier; split panes
still do not inherit the parent tab's rename. Activity's confirmed-Provider
shortcut yields to a manual tab name. Upstream's manual-rename projection test
passes unchanged.

D-011 (user decision 2026-11-03): D-009 stays, so a rollout-less Codex
session still cannot replace a backed row. Upstream's three ephemeral-takeover
cases (stablyai#33275, stablyai#33746) now pin that rule; the known limit is recorded under
REQ-028.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

[Feature]: Sidebar card heading for Codex sessions shows Codex's internal title-generation prompt

1 participant