Repository navigation
Show recorded Codex scripts in Activity - #1413
Conversation
Restore exec and wait calls from Buzz's Codex rollout so Activity shows scripts and results with their recorded tool names. Keep execution records under the active script and highlight tool references in its input. Co-authored-by: Sol <4ea9f38a14e66809d462a705d31779034f9e606c3cec91cd7b5970c0f226190e@buzz.block.builderlab.xyz> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
A yielded script can still produce tool events after another exec starts. Keep later events independent once yielding or overlap makes their owner uncertain, rather than attaching them to the remaining active script. Co-authored-by: Sol <4ea9f38a14e66809d462a705d31779034f9e606c3cec91cd7b5970c0f226190e@buzz.block.builderlab.xyz> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8544b67d7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| item.status = item.output.includes("Script running with cell ID") | ||
| ? "yielded" | ||
| : "completed"; |
There was a problem hiding this comment.
Restrict yielded detection to the wrapper status
When a successfully completed script merely prints Script running with cell ID—for example, an rg command finds that text in source or logs—this substring check marks the script as yielded even though the result envelope says it completed. It also permanently marks the turn ambiguous, so later calls are no longer grouped under their scripts. Parse or anchor the execution wrapper's status line rather than searching the entire output.
Useful? React with 👍 / 👎.
A script can print the yield message as ordinary output. Restrict status detection to the execution wrapper prefix so completed scripts keep their status and subsequent tool calls remain grouped. Co-authored-by: Sol <4ea9f38a14e66809d462a705d31779034f9e606c3cec91cd7b5970c0f226190e@buzz.block.builderlab.xyz> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 The wrapper-prefix repair is verified. Two P2 defects remain in command attribution and failed-script status; details inline.
| (item.type === "tool" || (item.type === "message" && item.posted)) | ||
| ) { | ||
| parent.children ??= []; | ||
| parent.children.push(item); |
There was a problem hiding this comment.
🤖 [P2] Keep delayed command completions out of unrelated scripts
Script A can start a yielding tools.exec_command and finish while its process continues. If that process exits while script B is the sole active exec, the delayed CommandExecution item_completed record is assigned to B here. The transcript then attributes the command, and potentially its failure, to a script that did not start it. Check the recorded started_at_ms against the parent start time before nesting; retain earlier-started commands at top level when ownership cannot be established. Add a regression where a command starts in A and completes during B.
| // Its separately recorded wait calls retain that handle and output. | ||
| item.status = item.output.startsWith("Script running with cell ID ") | ||
| ? "yielded" | ||
| : "completed"; |
There was a problem hiding this comment.
🤖 [P2] Preserve failed and terminated script status
The prefix repair handles genuine yields, but every other wrapper still maps to completed. Synthetic producer-shaped inputs with Script failed or Script terminated headers both restore as completed, hiding unsuccessful execution in the Activity transcript. Parse the wrapper status explicitly and preserve failure/termination through the transcript status and rendering. Add regression cases for these headers; the existing quoted-yield cases do not cover them.
Keep commands that started before the active script outside that script. Read failed and terminated wrapper headers explicitly and show termination in the transcript summary. Co-authored-by: Sol <4ea9f38a14e66809d462a705d31779034f9e606c3cec91cd7b5970c0f226190e@buzz.block.builderlab.xyz> Signed-off-by: Salman Mohammed <smohammed@squareup.com>
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 Both P2s are resolved: delayed commands remain independent of later scripts, and failed/terminated statuses are preserved. Verified with regression tests and real Codex persistence replay; no new actionable findings. Required CI still needs a successful rerun after the timing-artifact upload timeout; the Vitest steps passed.
…-sessions * origin/main: (23 commits) Add Marketplace tab and shared agent profile panels (#1411) fix: publish scoped typing indicators from conversation composers (#1435) feat: add configurable composer and pane focus shortcuts (#1418) perf(messages): reuse captured video opening frames on remount (#1437) FOR OCT 22: let agents clone and push their channel's repository (#1324) perf(relay): keep row profile map identity while new authors load (#1431) perf: avoid redundant relay channel derivation (#1412) Normalize dialog sizing, headers, spacing, and motion (#1403) Polish agent activity pills and popover actions (#1429) feat(agents): ask to resume claude and codex turns stopped by reload or quit (#1235) test(sign-out): join listed paths with / so the tests pass on Windows (#1247) fix(deps): remove distrusted emsign certificate roots (#1436) fix(plugins): distinguish usage and costs from agent activity (#1392) refactor(design-system): extract named Appearance palettes and revise plugin gradients (#1339) fix(channels): cancel inert activity popover opens (#1426) fix(codex): set up Codex in a dialog from the agent creation card, as Claude does (#1419) Add community-local settings (#1363) Fix sidebar and pane header alignment (#1409) Show recorded Codex scripts in Activity (#1413) fix(agents): restore emoji avatars in the agent avatar picker (#1404) ... # Conflicts: # crates/agent-controller/src/app_agent.rs
…-sessions * origin/main: (23 commits) Add Marketplace tab and shared agent profile panels (#1411) fix: publish scoped typing indicators from conversation composers (#1435) feat: add configurable composer and pane focus shortcuts (#1418) perf(messages): reuse captured video opening frames on remount (#1437) FOR OCT 22: let agents clone and push their channel's repository (#1324) perf(relay): keep row profile map identity while new authors load (#1431) perf: avoid redundant relay channel derivation (#1412) Normalize dialog sizing, headers, spacing, and motion (#1403) Polish agent activity pills and popover actions (#1429) feat(agents): ask to resume claude and codex turns stopped by reload or quit (#1235) test(sign-out): join listed paths with / so the tests pass on Windows (#1247) fix(deps): remove distrusted emsign certificate roots (#1436) fix(plugins): distinguish usage and costs from agent activity (#1392) refactor(design-system): extract named Appearance palettes and revise plugin gradients (#1339) fix(channels): cancel inert activity popover opens (#1426) fix(codex): set up Codex in a dialog from the agent creation card, as Claude does (#1419) Add community-local settings (#1363) Fix sidebar and pane header alignment (#1409) Show recorded Codex scripts in Activity (#1413) fix(agents): restore emoji avatars in the agent avatar picker (#1404) ... Co-authored-by: Will Pfleger <wpfleger@block.xyz> Signed-off-by: Will Pfleger <wpfleger@block.xyz>

Why
Codex's Activity transcript shows the tools called by a script but omits the script itself. A single
execloop can therefore look like many separate model calls.What
Show recorded
execscripts andwaitcalls with their original names, inputs and readable results. Group the underlying execution records beneath the script and highlighttools.xyz(...)references.How
Read the rollout path returned by Buzz's Codex app-server through the existing file reader, using an absolute working directory. Restore missing script calls alongside the existing history. After a script yields or executions overlap, later calls stay separate because their parent is uncertain. Yielded scripts retain their separate wait records. Commands with earlier or missing start times stay separate. Recorded failures and terminations retain their status.
Reuse the existing transcript disclosures, code blocks and semantic accent color. There is no new dependency or lookup in
~/.codex/sessions.Risk
This changes the local Codex history display. An unavailable or oversized rollout retains app-server history and shows a warning.
Testing
Read a real Codex 0.163.0 session through app-server and the file reader: six scripts and nine child calls restored, with the original script and output intact.
Rendered that session with the production transcript component in Chromium and WebKit. Checked both themes, narrow/wide widths, enlarged text, tool highlighting, nested calls and keyboard/pointer disclosures.
Salman tested the desktop Activity tab and confirmed the transcript looks correct. The later fix for uncertain call grouping has parser regression coverage and independent review; native reproduction of that edge case remains deferred.
Follow-up regressions reproduce delayed command attribution and failed/terminated wrapper handling before the fixes. Independent review passed. Chromium/WebKit verified the status labels and existing danger styling in both themes, narrow/wide layouts and keyboard/pointer interaction. Native confirmation of these follow-up cases remains deferred.
Generated with Codex