Skip to content

fix(codex): interactions no longer revive idle sub-agents - #5718

Open
caezium wants to merge 1 commit into
pingdotgg:mainfrom
caezium:agent/ignore-subagent-interactions-for-liveness
Open

fix(codex): interactions no longer revive idle sub-agents#5718
caezium wants to merge 1 commit into
pingdotgg:mainfrom
caezium:agent/ignore-subagent-interactions-for-liveness

Conversation

@caezium

@caezium caezium commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Problem

Codex emits interacted activity when the parent communicates with a child agent. T3 treated every interaction as proof that the child was running, so a message arriving after turn completion could revive an idle task row and leave the UI showing stale work.

Fix

  • Keep interacted activity liveness-neutral at the Codex adapter boundary.
  • Continue using collabAgent/turnStarted as the signal that a child resumed execution.
  • Cover the running-to-idle sequence with a focused adapter-stream regression using synthetic identifiers.

Validation

  • vp test run apps/server/src/provider/Layers/CodexAdapter.test.ts — 26 passed
  • Targeted lint for both changed files
  • Targeted formatting check for both changed files
  • vp run --filter t3 typecheck

Model: GPT-5.6 Sol; harness: Codex in T3 Code.

Note

Fix collabAgent/activity interactions to no longer revive idle sub-agents

In mapCollabAgentEvent, collabAgent/activity events with activityKind: 'interacted' previously emitted a task.updated event with status running, which caused idle sub-agents to appear active again. These events now return an empty array since interacted signals communication, not execution — only collabAgent/turnStarted triggers the running state. A test is added to assert the correct running → idle → interrupted sequence.

Macroscope summarized 0ce04fe.


Note

Low Risk
Narrow event-mapping fix in the Codex adapter with a focused regression test; no auth, data, or API surface changes.

Overview
Fixes sub-agent task rows flipping back to running when Codex sends collabAgent/activity with activityKind: 'interacted' after a child turn has already completed.

In mapCollabAgentEvent, interacted no longer emits a task.updated with status running; it returns no events because it signals parent–child communication, not execution. collabAgent/turnStarted remains the signal that a child resumed work.

A lifecycle regression test asserts the adapter stream stays running → idle → interrupted when interacted arrives between turn completion and agent close.

Reviewed by Cursor Bugbot for commit 0ce04fe. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Improved task status reporting for collaborative agent activity.
    • Interactive activity no longer incorrectly changes a task to “Running.”
    • Tasks now remain “Running” only when a turn begins, transition to “Idle” after completion, and become “Interrupted” when activity is interrupted or closed.
  • Tests

    • Added coverage validating the full task-status lifecycle and event sequence.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 35734253-8dff-40e0-8923-253b134cfa66

📥 Commits

Reviewing files that changed from the base of the PR and between a20923c and 0ce04fe.

📒 Files selected for processing (2)
  • apps/server/src/provider/Layers/CodexAdapter.test.ts
  • apps/server/src/provider/Layers/CodexAdapter.ts

📝 Walkthrough

Walkthrough

CodexAdapter no longer reports running for collabAgent/activity events with kind interacted. A lifecycle test verifies running, idle, and interrupted task statuses.

Changes

Codex activity status handling

Layer / File(s) Summary
Interacted activity status mapping
apps/server/src/provider/Layers/CodexAdapter.ts, apps/server/src/provider/Layers/CodexAdapter.test.ts
interacted activity events no longer emit running. The lifecycle test verifies the status sequence running, idle, and interrupted across turn start, completion, interaction, and closure.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main fix: interactions no longer revive idle Codex sub-agents.
Description check ✅ Passed The description explains the problem, fix, regression coverage, and validation; the missing checklist is non-critical.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 8, 2026
@caezium
caezium marked this pull request as ready for review August 8, 2026 16:34
@caezium

caezium commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@macroscopeapp

macroscopeapp Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 0ce04fe

Straightforward bug fix that removes incorrect status transitions for sub-agent 'interacted' events. The change is limited to a single case in an event mapper function and includes comprehensive test coverage verifying the expected behavior.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant