Skip to content

Settle the setup turn before counting idle chat changes - #2467

Merged
santoshkumarradha merged 1 commit into
app/v3from
c27/idle-release-i2
Nov 6, 2026
Merged

santoshkumarradha merged 1 commit into
app/v3from
c27/idle-release-i2

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Fixes TestAppIdleReleaseI1I2BackgroundChatStaysReleasedUntilSend, which sometimes reported "I2 idle chat emitted 2 changes, want 1". Test-only.

Cause. The extra change was the setup turn's own naming tail, not an idle chat waking up. After the turn, the second-chance naming writes the chat's title and intent name records, 257 bytes. Their capture and publication can finish after the test has started counting. That publication moves the saved head while the status, holder and fence stay the same. It makes no model calls and adds no spend.

Fix.

  • The fixture renames the chat before sending, because the late naming tail belongs to the setup turn, not to idle.
  • It joins the turn's capture and waits until the peer sees that exact saved head before counting.
  • The change-count, lease, acquire and release assertions are unchanged. A mutation that injects a real idle change still fails the test.

Validation:

  • Base under load: fails 1/100 with the exact message.
  • Branch at -count=200: passes, and the idle-count assertion held in all 400 runs at one and four CPUs.
  • Neighbours in the file at -count=20: pass.

Separately, the same test's final Send is sometimes refused with "This chat is available to continue here" at four CPUs, on base as well. That's being diagnosed on its own and is not changed here.

🤖 Generated with Claude Code

The vague fixture opener can finish its intent naming after the turn ends.
Its final title and intent_name records then publish another head inside
the idle counting window, before the expected release row.

Name the fixture before sending, join its completed capture, and wait for
that exact head on the peer before opening the window. Keep the exact
change-count and lease assertions unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@santoshkumarradha
santoshkumarradha merged commit aaef2fa into app/v3 Nov 6, 2026
4 of 6 checks passed
@santoshkumarradha
santoshkumarradha deleted the c27/idle-release-i2 branch November 6, 2026 16:00
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