Repository navigation
feat(native-chat): report Codex background tasks in the chat strip - #19346
Conversation
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.
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe 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 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)
✅ Passed checks (3 passed)
Full details: Description checkExplanation 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 Resolution Rewrite the description using every required template section. Add a linked issue, visual proof or ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 7947dcc7-c2d8-4d59-9a7a-f54e700d1d33
📒 Files selected for processing (21)
src/main/codex/codex-background-task-frames.tssrc/main/codex/codex-background-task-tracker.test.tssrc/main/codex/codex-background-task-tracker.tssrc/main/codex/codex-structured-session-acquire.tssrc/main/codex/codex-structured-session-adapter.tssrc/main/codex/codex-structured-session-background-tasks.test.tssrc/main/codex/codex-structured-session-close.test.tssrc/main/codex/codex-structured-session-options.test.tssrc/main/codex/codex-structured-session-state.tssrc/main/native-chat/agent-session-wire/structured-conversation-command-admission.test.tssrc/main/native-chat/agent-session-wire/structured-conversation-command-admission.tssrc/main/runtime/structured-agent-session-runtime.tssrc/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsxsrc/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.tsxsrc/renderer/src/components/native-chat/structured-session-background-tasks-view.tssrc/renderer/src/components/native-chat/use-structured-agent-session-mutate.tssrc/renderer/src/components/native-chat/use-structured-agent-session.tssrc/shared/agent-session-wire.tssrc/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)}` |
There was a problem hiding this comment.
🗄️ 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.
| const key = `${sessionId}:${fingerprintMethod}:${JSON.stringify(fields)}` | |
| const payloadFingerprint = structuredAgentSessionPayloadFingerprint({ | |
| method: fingerprintMethod, | |
| sessionId, | |
| fields | |
| }) | |
| const key = payloadFingerprint |
There was a problem hiding this comment.
ℹ️ No critical issues — minor suggestions and one coverage gap.
Reviewed changes
- Codex background-task producer — new
CodexBackgroundTaskTrackerandreadCodexBackgroundTaskFramereadsubAgentActivity/commandExecution/turn/completednotifications and derive a "backgrounded" roster (visible only after the parent turn completes), publishing through the existingbackgroundTaskschannel. - Stop-capability wire field — optional
supportsStopAllonAgentSessionBackgroundTaskState(absent = yes); Codex sendsfalse, so the renderer hides the no-op stop-all control andconversationCommandBlockeddowngrades to "Wait for background tasks to finish". - Adapter wiring —
backgroundTaskStatereader,onBackgroundTasksChangedpublishes state, and close paths publishnullexplicitly so the strip clears. - Renderer extraction —
mutatemoved verbatim intouseStructuredAgentSessionMutate, strip projection intostructuredSessionBackgroundTasksView.
ℹ️ 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'sclearBackgroundTaskspublishesnulldirectly instead, unlike Claude whose close path callssession.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/upsertCommanddo not latch a terminal command state the wayupsertChildlatches terminal subagent state. This is correct given ordered per-item delivery (commands don't havesubAgentActivity's double-delivery quirk), so no change needed — just noting the asymmetry is intentional and already reasoned through.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
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.
There was a problem hiding this comment.
✅ 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 explicitnullbackground-task publish through onesettledhelper that runs only when the child was actually proven stopped. - Label normalization at receipt time — the tracker now stores collapsed/truncated
string | undefinedlabels instead of rawstring | null, and the projection is a thintask()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.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Command/shell rows dropped from the strip —
readCodexBackgroundTaskFrameno longer produces acommandframe, and the tracker'scommandsmap,upsertCommand, and genericmakeRoomwere removed, so the Codex strip now reports onlysubagentchildren. The rationale is sound and I verified it:commandExecutionitems translate totool-calljournal rows, andsettleCodexJournalTurnwrites still-active ones asstate: 'failed'onturn/completed(interruptedBodyincodex-structured-journal-settlement.ts), so a "still running" shell row would have contradicted the journal row Orca just wrote.turn/completedtherefore 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 overchildrenonly, and the inlinetask()builder was folded back intotasks(); no dangling references to the removedcommandLabel/commandRunning/CODEX_COMMAND_ITEM_TYPEremain.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
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 winForward the background-task callback when replacing a live session.
When
closeCodexPublishedSessioncloses a live session, the connection suppressesonExitwhileclosingis true. The close function then callshandleCodexSessionExitwithoutonBackgroundTasksChanged. The tracker is cleared, but the renderer can retain stale monitoring state. Extend this close path to forwarddeps.onBackgroundTasksChanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 06d453cc-cc84-4626-896a-2f8f08d40a72
📒 Files selected for processing (35)
src/main/codex/codex-background-command-tracker.test.tssrc/main/codex/codex-background-command-tracker.tssrc/main/codex/codex-background-task-frames.tssrc/main/codex/codex-background-task-tracker.test.tssrc/main/codex/codex-background-task-tracker.tssrc/main/codex/codex-command-lifecycle.tssrc/main/codex/codex-item-stream-retention.tssrc/main/codex/codex-persistent-command-retention.test.tssrc/main/codex/codex-structured-item-stream-bounds.tssrc/main/codex/codex-structured-item-stream-contracts.tssrc/main/codex/codex-structured-item-streams.tssrc/main/codex/codex-structured-journal-contracts.tssrc/main/codex/codex-structured-journal-items.tssrc/main/codex/codex-structured-journal-settlement.tssrc/main/codex/codex-structured-journal-translation-subagents.test.tssrc/main/codex/codex-structured-journal-translation.tssrc/main/codex/codex-structured-session-acquire.tssrc/main/codex/codex-structured-session-adapter.tssrc/main/codex/codex-structured-session-background-tasks.test.tssrc/main/codex/codex-structured-session-close.tssrc/main/codex/codex-subagent-activity.tssrc/main/codex/codex-subagent-execution-projection.test.tssrc/main/codex/codex-subagent-executions.test.tssrc/main/codex/codex-subagent-executions.tssrc/main/codex/codex-subagent-group-body.tssrc/main/codex/codex-subagent-roster.test.tssrc/main/codex/codex-subagent-roster.tssrc/main/ipc/runtime.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer-protected.test.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer.tssrc/main/runtime/rpc/methods/structured-agent-session-background-task-capability.test.tssrc/main/runtime/rpc/methods/structured-agent-session-background-task-capability.tssrc/main/runtime/rpc/methods/structured-agent-session.tssrc/shared/protocol-version.tssrc/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) |
There was a problem hiding this comment.
🎯 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.
There was a problem hiding this comment.
✅ 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 sharedCodexSubagentExecutionsderives a child'sworking/completed/stopped/failed/unverifiablestate from its ownturn/started/turn/completedevents, consumed by both the ephemeral strip tracker and the durable roster;subAgentActivityitems now only register and label the child. - Persistent shell rows re-introduced as
commandtasks —CodexBackgroundCommandTrackerreportscommandExecutionitems whosesourceisunifiedExecStartup, andcodexCommandOutlivesTurnmakessettleCodexJournalTurnskip them so the journal keeps themrunningpast the turn boundary — the exact contradiction that had justified dropping commands previously. - Protected retention for outliving commands —
CodexItemStreamRetentionand the coalescer'sisProtectedkeep 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_CAPABILITYprojects asupportsStopAll: falseCodex roster tonullfor readers lacking the capability, so a legacy client sees no strip rather than a dead stop-all button. - Exit-time clearing —
handleCodexSessionExitclears and publishesnullbackground-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.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ 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 —
NativeChatToolRunnow suppresses the trailing completion check while anytool-callblock in the run is stillrunning, 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.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Review fixes pushed in
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 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 evidenceIntermediate review build: informational message incorrectly created a phantom task. This is a documented intermediate build, not evidence attributed to the immutable original head. Corrected lifecycle: informational message leaves no task. Fan-out: foreground children, background monitoring after parent completion, then settled. Final rebuilt head: persistent command remains monitored without a false completion mark; actual exit restores the mark and clears the strip. Ordinary shell completes inside its structured turn without a background strip. |
There was a problem hiding this comment.
✅ 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-baseconfirms a clean fast-forward of the branch tip onto main's head, with no conflict markers. - Journal-translator reconciliation — kept the PR's
subagents.handleTurnEventchild-turn handling ahead of main's newCodexJournalCompactionshook, and adopted main'scontextCompactionearly-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
useStructuredAgentSessionMessagesextraction while preserving the background-taskblockedgating andstructuredSessionBackgroundTasksViewwiring.
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.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Hidden Electron QA — both providers, head
|
| 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.
Turn complete: four rows — two agents by description, two commands — each with a per-task Stop (supportsTaskStop: true).
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.
Codex lane — PASS, new producer
Real fan-out via collaboration.spawn_agent.
Parent turn complete, both children monitored by name:
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.
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 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.
- A Codex subagent row loses its human-readable name mid-flight.
long_probeis 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 throughcoveredThreadswhileworkingChildren()covers that thread). What isn't carried across is the label:CodexBackgroundCommandTracker.parse()derivesdescriptionfrom the rawcommandstring only, so the child's name disappears at exactly the moment that row becomes the sole signal for the work. Count stays correct. Visible acrosscodex-subagent-row-named.png→codex-command-row-after-subagent-settles.png. - Transcript reads
Ran 1 subagent — completed · 49swhile 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
supportsStopAlltrue/absent branch (fallback Stop shown) never occurred live — Claude reports per-task stop, Codex reportsfalse. Only the newfalsebranch 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-purposeClaude subagents andcollaboration.spawn_agentCodex children; noworkflowormonitortask 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.
There was a problem hiding this comment.
✅ 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 achildLabelresolver; a non-primary persistent command row is now projected ascount_a — sleep 90, resolved at read time so a label that arrives after the command still lands, and bounded toMAX_DESCRIPTION_CHARSso read-time qualification cannot outgrow admission. CodexSubagentExecutions.label()— reads the child's retained label fromchildren, which survives the child's turn (evicted only onclear()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.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|




















Coverage: after this, the strip reports both providers
The background-tasks strip already works for Claude — the renderer, the wire type, the
backgroundTaskschannel and thebackgroundTaskStateadapter hook all landed onmainin #18757, andclaude-structured-session-adapter.tsimplements 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
backgroundTaskschannel, 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
supportsStopAllfield 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.