Skip to content

feat(native-chat): report Codex background tasks in the chat strip - #19346

Merged
brennanb2025 merged 9 commits into
mainfrom
brennanb2025/codex-strip-producer
Sep 9, 2026
Merged

brennanb2025 merged 9 commits into
mainfrom
brennanb2025/codex-strip-producer

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1471 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1466
Prod 39 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1246 $\color{#cf222e}{\Huge{\mathbf{−}}}$​338 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​908

Coverage: after this, the strip reports both providers

The background-tasks strip already works for Claude — the renderer, the wire type, the backgroundTasks channel and the backgroundTaskState adapter hook all landed on main in #18757, and claude-structured-session-adapter.ts implements that hook there today. A Codex structured session, by contrast, currently shows nothing in the strip, because no Codex adapter implements it.

This PR adds that missing implementation. It introduces no parallel strip: same optional backgroundTasks channel, same wire type, same router, same renderer, no new stream opcode. Codex simply becomes the second implementor of a contract that already exists — so once this merges, one strip reports both providers through one code path.

The one new field is optional (supportsStopAll, absent-means-true), so an older Claude host keeps its working stop-all.

Codex structured sessions now show work that remains active after the primary turn ends in the chat background-tasks strip. The strip hides during foreground work and clears when the child execution or persistent command actually ends.

Child turn identity owns execution state in one session model shared by the durable subagent roster and the strip. Activity items supply membership and labels: ordinary messages cannot invent another execution, follow-up turns can reuse a child, and an older completion cannot settle newer work.

Persistent shell commands retain their journal state and output across parent or child turn completion, then settle on their own command completion. Child commands appear only when an active child-agent row no longer covers them. Live command metadata uses bounded byte retention, preserving existing output limits and entering generation-fenced provider recovery when metadata cannot be admitted.

Codex tasks expose no stop control. The optional supportsStopAll field defaults to true when absent, preserving older hosts; hosts gate the nonstoppable projection behind a reader capability so older clients retain their previous empty Codex strip instead of displaying a dead Stop button.

The transcript also withholds a completion mark while any tool explicitly remains running. Independent review and end-readiness passed on the final head; test results, inspected screenshots, source revisions and validation limits are in the final review comment.

Merge Sim added 2 commits September 7, 2026 12:54
The background-tasks strip works for Claude only; a structured Codex
session shows nothing in it. Feed it from the Codex app-server stream.

The strip stands for work that OUTLIVED a turn, which is what the
monitoring header, Claude's foreground suppression, and the conversation
command gate all already assume. Codex has no `is_backgrounded` flag, so
that fact is derived from the turn boundary: a `subAgentActivity` child or
a primary-thread `commandExecution` becomes visible once the turn it
belongs to completes and it is still unsettled.

`turn/completed` only reveals a task here, never settles one — measured on
`codex app-server` 0.153.4, a spawn_agent child reported `completed` 95.8s
after its parent turn ended. Only a child's own activity kind settles it.

Codex exposes no honest stop: `turn/interrupt` on a child ends its turn
without emitting a terminal activity item and leaves its shell running. So
the state carries a new optional `supportsStopAll: false`, the strip hides
a control that could not act, and the blocked-command message asks the user
to wait rather than to press a button that does not exist.
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 513a95ba-e98f-4148-bc35-e50496bcc191

📥 Commits

Reviewing files that changed from the base of the PR and between 0f4632c and f86fe67.

📒 Files selected for processing (2)
  • src/renderer/src/components/native-chat/NativeChatToolRun.test.tsx
  • src/renderer/src/components/native-chat/NativeChatToolRun.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Codex child execution and persistent command tracking. It integrates background-task state with session acquisition, notification handling, publication, and teardown. It adds stop-all capability handling across shared state, RPC projection, command admission, and renderer controls. It extracts structured-session mutation handling into a reusable hook.

Merge Risk: 🟡 Moderate · up to f86fe

This change adds Codex background-task monitoring and stop-capability behavior, but equivalent mutation requests may not deduplicate, child-thread commands may be shown as primary background work, and session replacement can leave stale task status visible. These correctness issues should be resolved before merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.87% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 53 functions across 53 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the implementation and motivation in detail, but it does not follow the required template. It omits the required section headings and content for ELI5, What Changed, Why, Link… Rewrite the description using every required template section. Add a linked issue, visual proof or N/A with a reason, explicit testing steps and platform coverage, the required testing checklist items, the AI disclosure, the Agent skill u…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the primary change: reporting Codex background tasks in the native-chat strip.
Full details: Description check

Explanation

The description explains the implementation and motivation in detail, but it does not follow the required template. It omits the required section headings and content for ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. It also does not provide the required issue reference after Fixes #.

Resolution

Rewrite the description using every required template section. Add a linked issue, visual proof or N/A with a reason, explicit testing steps and platform coverage, the required testing checklist items, the AI disclosure, the Agent skill upstream boundary checkbox, Notes covering compatibility and platform concerns, and the final checklist.

✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch brennanb2025/codex-strip-producer

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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 7947dcc7-c2d8-4d59-9a7a-f54e700d1d33

📥 Commits

Reviewing files that changed from the base of the PR and between 1d1b73c and 91751a5.

📒 Files selected for processing (21)
  • src/main/codex/codex-background-task-frames.ts
  • src/main/codex/codex-background-task-tracker.test.ts
  • src/main/codex/codex-background-task-tracker.ts
  • src/main/codex/codex-structured-session-acquire.ts
  • src/main/codex/codex-structured-session-adapter.ts
  • src/main/codex/codex-structured-session-background-tasks.test.ts
  • src/main/codex/codex-structured-session-close.test.ts
  • src/main/codex/codex-structured-session-options.test.ts
  • src/main/codex/codex-structured-session-state.ts
  • src/main/native-chat/agent-session-wire/structured-conversation-command-admission.test.ts
  • src/main/native-chat/agent-session-wire/structured-conversation-command-admission.ts
  • src/main/runtime/structured-agent-session-runtime.ts
  • src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsx
  • src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
  • src/renderer/src/components/native-chat/structured-session-background-tasks-view.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session-mutate.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session.ts
  • src/shared/agent-session-wire.ts
  • src/shared/structured-agent-session-reducer.ts

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

return null
}
const targetFence = stateRef.current.fence
const key = `${sessionId}:${fingerprintMethod}:${JSON.stringify(fields)}`

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use the canonical payload fingerprint as the operation-ID cache key.

If a retry rebuilds fields with a different property order, JSON.stringify(fields) creates a different cache key. The hook can then send a new clientOperationId for the same canonical payload and bypass server-side idempotency.

Use the same payloadFingerprint for both the cache key and mutation payload.

Proposed fix
-      const key = `${sessionId}:${fingerprintMethod}:${JSON.stringify(fields)}`
+      const payloadFingerprint = structuredAgentSessionPayloadFingerprint({
+        method: fingerprintMethod,
+        sessionId,
+        fields
+      })
+      const key = payloadFingerprint
...
-            payloadFingerprint: structuredAgentSessionPayloadFingerprint({
-              method: fingerprintMethod,
-              sessionId,
-              fields
-            })
+            payloadFingerprint
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const key = `${sessionId}:${fingerprintMethod}:${JSON.stringify(fields)}`
const payloadFingerprint = structuredAgentSessionPayloadFingerprint({
method: fingerprintMethod,
sessionId,
fields
})
const key = payloadFingerprint

@pullfrog pullfrog 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.

ℹ️ No critical issues — minor suggestions and one coverage gap.

Reviewed changes

  • Codex background-task producer — new CodexBackgroundTaskTracker and readCodexBackgroundTaskFrame read subAgentActivity / commandExecution / turn/completed notifications and derive a "backgrounded" roster (visible only after the parent turn completes), publishing through the existing backgroundTasks channel.
  • Stop-capability wire field — optional supportsStopAll on AgentSessionBackgroundTaskState (absent = yes); Codex sends false, so the renderer hides the no-op stop-all control and conversationCommandBlocked downgrades to "Wait for background tasks to finish".
  • Adapter wiring — backgroundTaskState reader, onBackgroundTasksChanged publishes state, and close paths publish null explicitly so the strip clears.
  • Renderer extraction — mutate moved verbatim into useStructuredAgentSessionMutate, strip projection into structuredSessionBackgroundTasksView.

ℹ️ The renderer's "absent means yes" default is untested

structuredSessionBackgroundTasksView encodes supportsBackgroundTaskStopAll: state?.supportsStopAll !== false — the rule that a host predating supportsStopAll still gets a working stop-all control, while Codex's explicit false hides it. This is the crux of the wire-compatibility decision, and it is derived from redux-free state so the NativeChatStructuredSession mock does not exercise it. The server-side twin (conversationCommandBlocked) is tested for both the predating-host and Codex cases, but the renderer default has no direct test; a regression here silently re-introduces a dead stop-all button on Codex, the exact failure this PR removes.

Technical details
# Test the renderer stop-capability default

## Affected sites
- src/renderer/src/components/native-chat/structured-session-background-tasks-view.ts:26-29 — `supportsBackgroundTaskStop` / `supportsBackgroundTaskStopAll` derivation has no unit test.
- src/shared/structured-agent-session-reducer.ts:63 — `supportsStopAll` added to `backgroundTaskStatesEqual`, also untested.

## Required outcome
- A test pinning: `state` absent/null → `supportsBackgroundTaskStopAll: true`; Codex `supportsStopAll: false` (with `state: 'monitoring'`) → `false`; explicit `true` → `true`.
- A reducer test asserting `backgroundTaskStatesEqual` treats a `supportsStopAll`-only delta as a real change (and equal `supportsStopAll` as unchanged).

## Suggested approach (optional)
- Mirror `structured-conversation-command-admission.test.ts`, which already covers the server-side cases for the same default rule.

ℹ️ Nitpicks

  • CodexBackgroundTaskTracker.clear() (src/main/codex/codex-background-task-tracker.ts:113) is never called in production — the adapter's clearBackgroundTasks publishes null directly instead, unlike Claude whose close path calls session.backgroundTasks.clear(). Either wire it into the Codex close for symmetry, or drop the method and its 'clears everything when the session is gone' test so an unused path isn't maintained as a live contract.
  • commandRunning/upsertCommand do not latch a terminal command state the way upsertChild latches terminal subagent state. This is correct given ordered per-item delivery (commands don't have subAgentActivity's double-delivery quirk), so no change needed — just noting the asymmetry is intentional and already reasoned through.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Merge Sim added 2 commits September 7, 2026 13:20
Merging main crossed the 300-line cap on
`codex-structured-session-adapter.ts`: the rewind backend (#19235) and this
branch's close-time strip clear both landed in it. The four close paths move
verbatim into `codex-structured-session-teardown.ts`, where they funnel
through one `settled` helper instead of repeating the notification-retry and
background-task cleanup at each call site. No ratchet bump.

Also normalize a background task's description once at receipt rather than on
every projection; the roster is re-projected on each observed frame.
A `commandExecution` still `inProgress` when its turn ends was reported as a
`command` task. But `settleCodexJournalTurn` writes exactly those items to the
journal as `state: 'failed'` on `turn/completed` and forgets them, so the strip
row would have claimed a shell was still running at the same instant Orca
recorded that it was not — two surfaces contradicting each other about the same
process.

A subagent is the opposite case and stays: the roster pointedly does not sweep
at a turn boundary, because children measurably outlive it. That leaves the
producer making exactly one claim — these spawn_agent children are still live
after their turn — which the durable roster row corroborates.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Session teardown extraction — the four Codex close paths moved out of the adapter into CodexStructuredSessionTeardown, funneling the notification-retry clear and the explicit null background-task publish through one settled helper that runs only when the child was actually proven stopped.
  • Label normalization at receipt time — the tracker now stores collapsed/truncated string | undefined labels instead of raw string | null, and the projection is a thin task() wrapper, so the 512-char bound is applied once rather than on every re-projection.

One benign deviation from a strictly verbatim move worth noting for the record: forceCloseUnexpected previously cleared only background tasks, and now (via settled) also clears notification retries. That is correct — the retry fail() path already drops its own state before invoking forceCloseUnexpected, and a re-acquisition creates fresh retry state — so it is a small cleanup, not a regression.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Command/shell rows dropped from the strip — readCodexBackgroundTaskFrame no longer produces a command frame, and the tracker's commands map, upsertCommand, and generic makeRoom were removed, so the Codex strip now reports only subagent children. The rationale is sound and I verified it: commandExecution items translate to tool-call journal rows, and settleCodexJournalTurn writes still-active ones as state: 'failed' on turn/completed (interruptedBody in codex-structured-journal-settlement.ts), so a "still running" shell row would have contradicted the journal row Orca just wrote. turn/completed therefore correctly reveals a child and never settles it, while a command is settled by the journal rather than outliving the turn.
  • Simplified tracker — makeRoom() is now no-arg over children only, and the inline task() builder was folded back into tasks(); no dangling references to the removed commandLabel / commandRunning / CODEX_COMMAND_ITEM_TYPE remain.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/codex/codex-structured-session-acquire.ts (1)

98-98: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Forward the background-task callback when replacing a live session.

When closeCodexPublishedSession closes a live session, the connection suppresses onExit while closing is true. The close function then calls handleCodexSessionExit without onBackgroundTasksChanged. The tracker is cleared, but the renderer can retain stale monitoring state. Extend this close path to forward deps.onBackgroundTasksChanged.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 06d453cc-cc84-4626-896a-2f8f08d40a72

📥 Commits

Reviewing files that changed from the base of the PR and between 0fe3b71 and 0f4632c.

📒 Files selected for processing (35)
  • src/main/codex/codex-background-command-tracker.test.ts
  • src/main/codex/codex-background-command-tracker.ts
  • src/main/codex/codex-background-task-frames.ts
  • src/main/codex/codex-background-task-tracker.test.ts
  • src/main/codex/codex-background-task-tracker.ts
  • src/main/codex/codex-command-lifecycle.ts
  • src/main/codex/codex-item-stream-retention.ts
  • src/main/codex/codex-persistent-command-retention.test.ts
  • src/main/codex/codex-structured-item-stream-bounds.ts
  • src/main/codex/codex-structured-item-stream-contracts.ts
  • src/main/codex/codex-structured-item-streams.ts
  • src/main/codex/codex-structured-journal-contracts.ts
  • src/main/codex/codex-structured-journal-items.ts
  • src/main/codex/codex-structured-journal-settlement.ts
  • src/main/codex/codex-structured-journal-translation-subagents.test.ts
  • src/main/codex/codex-structured-journal-translation.ts
  • src/main/codex/codex-structured-session-acquire.ts
  • src/main/codex/codex-structured-session-adapter.ts
  • src/main/codex/codex-structured-session-background-tasks.test.ts
  • src/main/codex/codex-structured-session-close.ts
  • src/main/codex/codex-subagent-activity.ts
  • src/main/codex/codex-subagent-execution-projection.test.ts
  • src/main/codex/codex-subagent-executions.test.ts
  • src/main/codex/codex-subagent-executions.ts
  • src/main/codex/codex-subagent-group-body.ts
  • src/main/codex/codex-subagent-roster.test.ts
  • src/main/codex/codex-subagent-roster.ts
  • src/main/ipc/runtime.ts
  • src/main/native-chat/agent-session-wire/agent-session-delta-coalescer-protected.test.ts
  • src/main/native-chat/agent-session-wire/agent-session-delta-coalescer.ts
  • src/main/runtime/rpc/methods/structured-agent-session-background-task-capability.test.ts
  • src/main/runtime/rpc/methods/structured-agent-session-background-task-capability.ts
  • src/main/runtime/rpc/methods/structured-agent-session.ts
  • src/shared/protocol-version.ts
  • src/shared/remote-runtime-client-capabilities.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.

}
expect(items.activeItems.size).toBe(448)
expect(items.streams.persistentCount).toBe(448)
expect(tracker.tasks()).toHaveLength(448)

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Exclude child-thread commands from background tasks.

The tracker primary thread is thread-0, but this assertion accepts command tasks from all seven threads. CodexBackgroundCommandTracker.parse currently uses codexCommandOutlivesTurn without checking event.threadId, so child-thread unifiedExecStartup commands appear in the monitoring strip. This conflicts with the primary-thread-only command requirement.

Return null from CodexBackgroundCommandTracker.parse when event.threadId !== this.primaryThreadId. Then change this expectation to 64 and assert that child-thread commands do not create command tasks.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

This run reviewed the fifth commit, 0f4632c ("track Codex background execution lifetimes"), which re-derives child execution state from child turn events and re-introduces persistent shell rows on the journal-retention foundation the earlier "drop the shell row" commit had avoided.

  • Child execution state moved off activity kind — a new shared CodexSubagentExecutions derives a child's working/completed/stopped/failed/unverifiable state from its own turn/started / turn/completed events, consumed by both the ephemeral strip tracker and the durable roster; subAgentActivity items now only register and label the child.
  • Persistent shell rows re-introduced as command tasks — CodexBackgroundCommandTracker reports commandExecution items whose source is unifiedExecStartup, and codexCommandOutlivesTurn makes settleCodexJournalTurn skip them so the journal keeps them running past the turn boundary — the exact contradiction that had justified dropping commands previously.
  • Protected retention for outliving commands — CodexItemStreamRetention and the coalescer's isProtected keep persistent command metadata byte-bounded while exempting it from the per-stream count cap.
  • Old-client stop gating — a new AGENT_SESSION_BACKGROUND_TASK_STOP_CAPABILITY projects a supportsStopAll: false Codex roster to null for readers lacking the capability, so a legacy client sees no strip rather than a dead stop-all button.
  • Exit-time clearing — handleCodexSessionExit clears and publishes null background-task state before lifecycle observers read it.

I traced the two admission gates (canObserve in the adapter emit vs. the journal's canRetain — both bound persistent metadata to the same 16 MB ceiling), the close/exit null-publish paths (settled vs. handleCodexSessionExit) for double-publish, and the old-execution fencing in observeTurn; ran the touched suites (100 tests across 11 files) — all green.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

This run reviewed the sixth commit, f86fe67 ("keep running tool groups from claiming completion"), a renderer-only follow-up to the execution-lifetime work.

  • Completion mark gated on the item's own state — NativeChatToolRun now suppresses the trailing completion check while any tool-call block in the run is still running, so a post-turn background shell no longer inherits a "completed" glyph from its turn's lifecycle; the check appears once the item itself settles.

The test was rewritten to prove the neutral state (running in a settled turn shows neither the pulsing label nor a check) and the transition (completed adds the check). Verified in NativeChatToolRun.test.tsx — 31 tests pass.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review fixes pushed in 0f4632c53e and f86fe671cb. Independent same-model review and END readiness passed on the final head with zero remaining proven findings, including the follow-up review after live QA exposed the transcript completion mark.

  • Functional: fixed follow-up and message handling, long-lived command reporting/output retention, mixed-version Stop controls, and stale monitoring after natural provider exit. Excluding shell commands had hidden incorrect journal settlement; commands now keep their own completion lifecycle. Live QA also caught a false transcript completion mark, now withheld while the tool remains running.
  • Architecture: the durable roster and strip share child-turn execution ownership. Primary turns control visibility; process completion settles commands. Live metadata stays bounded without FIFO-evicting running work, and admission failure uses the existing generation-fenced recovery path.
  • Precedent: inspected concrete execution and delivery mechanisms. Execution-owned lifetime matches; Orca's grouped durable journal, admission ordering, and paired-reader capability projection are explicit application-specific differences.
  • Validation: 1,771 broad tests passed (10 skipped), 29 renderer/admission tests passed, and final focused retention/exit/visual suites passed 78/44/64 tests; the full independent reviewer ran 32 passing checks. Node/web typechecks, changed-code quality, and commit hooks passed. The 448-command regression preserves metadata/output, and 100 unchanged flushes perform zero output-prefix joins.

Hidden Electron QA with real Codex passed fan-out, child-shell handoff, follow-ups in new/same parent turns, idle/running messages, and ordinary-shell negative control. Provider/journal lifecycle runs used 0f4632c53e; the final shell running/completed presentation and structured negative control were rebuilt and verified on f86fe671cb.

Grok hit its weekly quota, so Astra performed the CDP QA. Real Windows/Linux/SSH/mobile and natural-provider-exit UI runs remain unperformed; natural exit has adapter regression coverage. GitHub currently reports no checks on the final head. No merge performed.

Inspected screenshot evidence

Intermediate review build: informational message incorrectly created a phantom task. This is a documented intermediate build, not evidence attributed to the immutable original head.

Intermediate phantom task

Corrected lifecycle: informational message leaves no task.

No phantom task

Fan-out: foreground children, background monitoring after parent completion, then settled.

Foreground children
Background children
Settled fan-out

Final rebuilt head: persistent command remains monitored without a false completion mark; actual exit restores the mark and clears the strip.

Running persistent command
Completed command

Ordinary shell completes inside its structured turn without a background strip.

Structured shell negative control

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

This run reviewed the merge beead401d5 ("Merge origin/main into codex-strip-producer"), the only new commit since the prior review. The ~600 unrelated main changes folded in on their own; the reconciliation surface is the seven PR-owned Codex/native-chat files both tracks touched.

  • Merged origin/main — pulled main's latest (bba68b1) into the branch; git merge-base confirms a clean fast-forward of the branch tip onto main's head, with no conflict markers.
  • Journal-translator reconciliation — kept the PR's subagents.handleTurnEvent child-turn handling ahead of main's new CodexJournalCompactions hook, and adopted main's contextCompaction early-admission arm unchanged.
  • Tool-run reconciliation — adopted main's per-member header rendering (toolRunSummaryMembers, NativeChatToolAnnotations) while preserving the PR's "a running item cannot inherit completion" gate (structuredActivityUi && !hasRunningCall) and its "post-turn running call neutral" test.
  • Session-hook reconciliation — adopted main's useStructuredAgentSessionMessages extraction while preserving the background-task blocked gating and structuredSessionBackgroundTasksView wiring.

Verified the merge base-to-head tree delta on the PR's files is exactly this reconciliation (no semantic changes to the strip/execution/stop-capability logic), and ran the touched suites (NativeChatToolRun 39 tests, codex journal translation + compactions + background tasks 20 tests) plus typecheck:node and typecheck:web — all green. The two already-tracked open items (renderer "absent means yes" default test, backgroundTaskStatesEqual supportsStopAll test) remain unaddressed and non-blocking.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

brennanb2025 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Hidden Electron QA — both providers, head 99b5189421

Ran the strip end-to-end in a hidden Electron renderer over CDP (no window focus stolen, no computer-use), in an isolated child worktree at the exact PR head. git diff HEAD was empty before and after: no source was modified to produce this evidence.

Provenance — the running renderer served this PR's code, not a peer worktree's. Fetched through the instance's own dev server:

module status predicate
structured-session-background-tasks-view.ts (PR-only file) 200 supportsStopAll !== false
NativeChatBackgroundTasksStatus.tsx 200 supportsStopAll
use-structured-agent-session-mutate.ts (PR-only file) 200 useStructuredAgentSessionMutate
same path under a peer worktree 403 — (proves whose vite serves the page)

Re-checked at the end of the session: still 200 + match.

Claude lane — PASS, unchanged by this PR

Real Task fan-out with run_in_background, plus two backgrounded shell commands of different durations.

Mid-turn: no strip. This is the pre-existing turnId === null && state === 'monitoring' gate — byte-identical to main, only relocated into the new view module. The strip stands for work that outlived a turn.

claude-midturn-strip-suppressed.png

Turn complete: four rows — two agents by description, two commands — each with a per-task Stop (supportsTaskStop: true).

claude-fanout-live-expanded.png

Rows drained one at a time in exact duration order, then the strip cleared within ~10s of the last exit. Shell side effects confirmed on disk (a.log shows 120 packets transmitted). No phantom, stale, or duplicated rows.

claude-partial-drain-one-row-left.png
claude-strip-cleared.png

Codex lane — PASS, new producer

Real fan-out via collaboration.spawn_agent.

Parent turn complete, both children monitored by name:

codex-fanout-live.png
codex-subagent-row-named.png

A child's background command keeps its own row after the child's turn settles, and the strip clears only once the last command exits — timings matched the ping counts to the second.

codex-command-outlives-subagent-turn.png
codex-command-row-after-subagent-settles.png
codex-fanout-settled.png
codex-strip-cleared.png

Negative control — an ordinary foreground shell inside a structured Codex turn completes with no background strip. Verified by enumerating every [data-native-chat-background-tasks] node with its bounding rect: exactly one existed and it was 0x0, i.e. the hidden Claude pane's strip, not Codex's.

codex-shell-negative-control.png

Codex rows carry no Stop control at all, while Claude rows do. The tracker publishes supportsStopAll: false and never sets supportsTaskStop, so the new !supportsTaskStop && supportsStopAll predicate hides even the fallback button. That rendered asymmetry is observed. The further claim that main would have shown a dead Stop for Codex is a code reading, not a measurement — no ablation against main was run.

Two observed oddities

Neither breaks the strip, and neither is a phantom/stale/miscounted row.

  1. A Codex subagent row loses its human-readable name mid-flight. long_probe is replaced by /bin/zsh -lc 'ping -c 300 127.0.0.1 > /dev/null' once the child's turn settles while its unified-exec command keeps running. The handoff itself is deliberate and documented in the PR body (tasks() filters a child's commands through coveredThreads while workingChildren() covers that thread). What isn't carried across is the label: CodexBackgroundCommandTracker.parse() derives description from the raw command string only, so the child's name disappears at exactly the moment that row becomes the sole signal for the work. Count stays correct. Visible across codex-subagent-row-named.png → codex-command-row-after-subagent-settles.png.
  2. Transcript reads Ran 1 subagent — completed · 49s while the strip still shows that subagent's command running. Coherent — the subagent's turn did complete — but readable as "all done". This is the transcript tool row, not the strip.

Not exercised

  • Settled/completed rows never rendered. Rows leave on settle in both lanes; none lingered with a done marker. No claim is made about settled-row rendering.
  • Stop was never clicked. Claude's per-task Stop rendered; the action was not fired.
  • The supportsStopAll true/absent branch (fallback Stop shown) never occurred live — Claude reports per-task stop, Codex reports false. Only the new false branch was proven.
  • No ablation of the renderer change against main.
  • Folder workspace only, no git worktree. Local host only, no remote/SSH. macOS dev build only — this rig is blind to packaged-build regressions. No Windows, WSL, Linux, or mobile runs.
  • Only general-purpose Claude subagents and collaboration.spawn_agent Codex children; no workflow or monitor task kinds.
  • Mixed-version/remote-client rendering of the new field has unit coverage, not a live paired client.

Edited to correct an earlier "no defects found" line: two oddities were observed and are listed above, and the not-exercised list was incomplete.

A child agent's commands stay hidden behind its agent row while the child
works. Once the child's turn settles with a command still running, that
command surfaces as its own row labelled from the raw command string, so
'long_probe' became "/bin/zsh -lc 'ping -c 300 127.0.0.1 > /dev/null'"
at the moment that row was the only remaining signal for the work.

Qualify a child's command row with the child's label. Resolved on read,
so a label registered after the command still lands, and bounded by the
existing description cap so admission accounting stays valid. Primary-
thread commands are left unqualified: they have no child to name.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

This run reviewed the single new commit 9b9d163 ("keep a child's name on the command row that outlives it"), the only delta since the prior review.

  • Child shell rows now name their owner — CodexBackgroundCommandTracker.tasks() takes a childLabel resolver; a non-primary persistent command row is now projected as count_a — sleep 90, resolved at read time so a label that arrives after the command still lands, and bounded to MAX_DESCRIPTION_CHARS so read-time qualification cannot outgrow admission.
  • CodexSubagentExecutions.label() — reads the child's retained label from children, which survives the child's turn (evicted only on clear() or the 128-child cap), so a row outliving its agent row can still name it.

Verified the label-resolution path end-to-end (registration via subAgentActivity frames, ??= first-label-wins semantics, byte accounting unaffected since labels are projected rather than retained) and ran the two touched suites — 26 tests pass.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 merged commit 5868fdc into main Sep 9, 2026
33 checks passed
@brennanb2025

Copy link
Copy Markdown
Contributor Author

⚠️ Do not merge yet — the PR head is stale against the branch

The branch ref brennanb2025/codex-strip-producer is at 03d336aea1, but refs/pull/19346/head and the PR object are both still at 9b9d163863, unchanged for ~30 minutes, and zero check-runs have been created for 03d336aea1.

Merging in this state would land 9b9d163863, which is missing the label-budget fix below. Confirmed three ways: gh api .../git/ref/heads/... → 03d336aea1, gh api .../git/ref/pull/19346/head → 9b9d163863, local git fetch → 03d336aea1. The PR needs to re-sync (or be nudged) before merge.


Round 2 — one defect found in live QA, fixed; one defect in that fix, also fixed

9b9d163863 — keep a child's name on the command row that outlives it

Live Electron QA (previous comment) found a Codex child's command row losing the child's name. A child's commands stay hidden behind its agent row while the child works; once the child's turn settles with a command still running, that command surfaces as its own row labelled from the raw command string. Observed live: long_probe became /bin/zsh -lc 'ping -c 300 127.0.0.1 > /dev/null' at exactly the moment that row was the only remaining signal for the work.

CodexSubagentExecutions.label() is a direct map read — deliberately not child(), which creates a record on miss and can evict a settled sibling, so a read path calling it would mutate the roster mid-render. Composition happens at read time in tasks(), so a label registered after the command still lands. Primary-thread commands stay unqualified.

03d336aea1 — reserve the label's share

Independent review caught a real defect in the above. child.label is stored at MAX_SUBAGENT_FIELD_CHARS + 1 (513) — deliberately one unit over the description cap (512), for the journal's truncation marker. Slicing the composed pair to 512 let a long label eat the command: at ≥506 chars the command text was gone, at ≥512 even the separator was, leaving a row of kind: 'command' naming an agent and showing no command. Strictly worse than the bug being fixed. The same clip could cut a surrogate pair.

Fixed by reserving MAX_LABEL_CHARS = 96 and clipping surrogate-safely, mirroring boundSubagentField.

Precedent — with the deviation named

claude-background-task-tracker.ts sets description straight from provider fields via taskDescription(); it never composes. Codex is the first producer to compose host-authored text into description, so this does not follow that precedent — it is a deliberate departure. What does cover it: subagentGroupFallbackText composes untranslated English (Kicked off 3 subagents (1 failed)) in shared code and freezes it into the durable journal, so an ephemeral recomputed strip row is the smaller deviation.

Composing into description rather than adding an optional owner? wire field was chosen because this PR is the first shipment of the Codex strip: an optional field only helps new-enough clients, leaving older ones showing the unowned row. The cost is that description is now sometimes provider-verbatim and sometimes host-composed with no way for the renderer to tell, so the owner cannot be localized or restyled without adding that field later. Reversible — no ids, persisted state, or negotiation depend on it.

Validation (reproduced independently, not relayed)

2194 tests across src/main/codex, the strip component, and agent-session-wire; all three typechecks pass run sequentially; changed-code quality gate clean including React Doctor; no new translate() keys, so no catalog sync. Ablation run twice, once per commit: reverting only the production files fails exactly the intended tests and the tree restores byte-clean. Readiness checklist passes on 03d336aea1.

CI: PR Checks, PR test LoC, and Computer-use e2e all passed on 9b9d163863. Nothing has run on 03d336aea1 — see the head-sync problem above.

Known gaps

MAX_CHILDREN eviction path is read-verified but has no test (a row degrades to the unqualified command — the pre-fix rendering). No live Electron re-QA of the fixed symptom. Em-dash separator is not localized; that needs the wire field. boundLabel duplicates boundSubagentField's shape rather than reusing it, because the latter's 512 cap leaves no room for the command and its …~index ordinal exists for identity a description does not carry.

The PR body's "Independent review and end-readiness passed on the final head" now predates two commits and should be refreshed before merge.

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