Skip to content

Keep a finished agent turn idle when a late tool result arrives - #15173

Merged
teamleaderleo merged 2 commits into
mainfrom
fix-settled-turn-running-resolution
Sep 28, 2026
Merged

teamleaderleo merged 2 commits into
mainfrom
fix-settled-turn-running-resolution

Conversation

@austinywang

@austinywang austinywang commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Since #14522, when Feed records a tool result after a Claude or Codex turn has completed, the session flips back to Running. Feed declares every tool result .running (Sources/AgentFeedSemanticInput.swift). #14522 made the reconciler adopt any phase declared on a resolution, so that a dismissed Pi idle dialog could project Idle, and that rule now adopts the .running too. The reconciler now honors only a declared .idle. Any other declaration goes through the rules from before #14522, which keep a stopped turn idle. A Pi idle-dialog resolution still settles to Idle.

This regression is also what fails app-host shard 6/7 on main and on every PR that includes #14522. The "Run agent notification semantics" step fails AgentSemanticNotificationDeliveryTests/feedToolResultDoesNotReopenSettledCompletion(source:) at line 232 with .running instead of .idle. It failed this way on main's run 36373808820 (job 108778128771) and on #12809's run 36373401453, attempt 2 (job 108790447141).

Testing

  • swift test --package-path Packages/macOS/CmuxAgentJournal --filter runningToolResultDoesNotReopenSettledTurn fails for both claude and codex on c366c49af8, the new test on top of main (.running == .idle). It passes on 0394e53094.
  • The full CmuxAgentJournal package passes, 76 tests in 10 suites. That includes fix: bring Pi agent integration to parity #14522's idleAttentionResolutionProjectsIdle and AgentLifecycleReducerTests/idleAttentionResolutionUsesDeclaredPhase.
  • python3 scripts/verify-local.py: 3/3 selected checks passed (swift-syntax, package-groups, feature-flags).
  • I didn't run the app-host feedToolResultDoesNotReopenSettledCompletion or the other agent-notification suites locally, because they need an app-host build. App-host shard 6/7 runs them in CI.

Changelog

none

Checklist

  • Behavior changes have added or updated tests, or Testing says why not
  • Reviewed with a subagent before merge (cmux-review), and all bot and human review comments resolved

🤖 Generated with Claude Code


Summary by cubic

Fixes a regression where a tool result arriving after a Claude or Codex turn completed flipped the session back to Running, reopening a settled turn.

While #14522 let a resolution's declared phase replace the session phase (so a dismissed Pi idle dialog projects Idle), Feed declares every tool result .running, so that rule was also adopting Running. The reconciler now honors only a declared .idle; any other declaration falls back to the prior rules, which keep a stopped root idle.

Written for commit 0394e53. Summary will update on new commits.

Review in cubic

austinywang and others added 2 commits September 27, 2026 22:15
#14522 made the reconciler adopt any phase declared on a resolution. Feed
declares every tool result `.running`, so a tool result after a completed
turn now projects Running. AgentSemanticNotificationDeliveryTests'
feedToolResultDoesNotReopenSettledCompletion fails the same way in app-host
shard 6/7 on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#14522 let a resolution's declared phase replace the session phase so a
dismissed Pi idle dialog projects Idle. Feed and the CLI also declare
`.running` on every ordinary resolution, which that rule now adopted, so a
tool result arriving after a completed turn reopened it as Running. Honor
only a declared `.idle`; other declarations fall back to the pre-#14522
rules, which keep a stopped root idle.

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

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 8 minutes.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b24ce859-8220-4024-aea2-5b53bacf62b0

📥 Commits

Reviewing files that changed from the base of the PR and between f807908 and 0394e53.

📒 Files selected for processing (2)
  • Packages/macOS/CmuxAgentJournal/Sources/CmuxAgentJournal/AgentNotificationReconciler.swift
  • Packages/macOS/CmuxAgentJournal/Tests/CmuxAgentJournalTests/AgentNotificationReconcilerTests.swift

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

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@teamleaderleo
teamleaderleo merged commit 528c5a8 into main Sep 28, 2026
67 checks passed
@teamleaderleo
teamleaderleo deleted the fix-settled-turn-running-resolution branch September 28, 2026 06:59
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for 0394e53094: every check was green at merge (21 verified; 17 skipped by policy). Full suite runs on main after merge.

rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 28, 2026
528c5a8 Keep a finished agent turn idle when a late tool result arrives (manaflow-ai#15173)
b76db12 ci: clone owned build state in one clonefile call and start the seed download earlier (manaflow-ai#15175)
ec90c2a ci: post a one-click dogfood link on app pull requests (manaflow-ai#15130)
05e0598 Keep tmux reattach bindings through update relaunch saves (manaflow-ai#15187)
5bf1b45 perf(claude-wrapper): skip redundant settings validation and overlap it with the ping (manaflow-ai#14872)
a49afca read_text: explain why a terminal is not running and how to wake it (manaflow-ai#15159)

# Conflicts:
#	.github/workflows/ci-macos.yml
#	.github/workflows/ci.yml
#	.github/workflows/test-e2e.yml
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.

2 participants