Repository navigation
Let TurnState answer which idle publication settles a held turn - #3076
Merged
Merged
Conversation
PR #2943 deleted TurnState.matches while Toad's ManagedTurnBinding.receive (conversation_turn.py:271) still called it, so every idle turn publication raised AttributeError inside Toad. The turn declaration owns which turn it holds and the finished record owns which turn it finished, so the answer is TurnState.settles(held) delegating to TurnDeclaration.settled_by and TurnRecord.names instead of a string id comparison in the client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trissim
marked this pull request as ready for review
October 24, 2026 19:50
trissim
enabled auto-merge
October 24, 2026 19:50
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
debt-src at e23a313, every finding: |
trissim
added a commit
to OpenHCSDev/toad
that referenced
this pull request
Oct 24, 2026
Pins agent-comms to 208a5b2ee, the merge of OpenHCSDev/agent-comms#3076, so this branch never ships calling state.settles against a Core that lacks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defect
Toad toast on core-49156b4bb (Tristan, 2026-10-24 ~15:42):
#2943 (merged 2026-10-23 22:42) deleted
TurnState.matches/observed_idwhen it replacedfinished_turn_idwithfinished: TurnRecord. Toad still callsstate.matches(...)at conversation_turn.py:271 (and deadmatches_settlementat :173), so every idle (non-busy) turn publication raises into Toad's UI. Reproduced in the installed runtime:ManagedTurnBinding.receive(TurnState())-> AttributeError at conversation_turn.py:271.Fix at the owner
Which turn a declaration holds is the declaration's fact; which turn a record finished is the record's fact. So:
TurnState.settles(held): a busy publication always replaces the held turn; an idle one settles it only viaheld.settled_by(self).TurnDeclaration.settled_by(abstract):NoTurn-> True;ActiveTurn->state.active.matches(self.id) or state.finished.names(self.id).TurnRecord.names(concrete False);FinishedTurnoverrides with itsturn_id.No string id comparison in the client, no None-means-anything branch. Toad PR (OpenHCSDev/toad) switches
receivetostate.settles(self.owner.state.active)and deletes the three deadmatches_settlementmethods; it needs this merged first.Proof
tests/test_turn_lease_release.py::test_idle_publication_settles_only_the_turn_it_finished: real begin/finish/begin on a wire bus; the finished state settles its own held turn and an idle owner, refuses a replacement turn, and a busy state settles anything.4 passed.tests/textual/test_compaction_turn_events.pyagainst this branch: see the Toad PR.Assumed: no other Core consumer needs the deleted
matches(None)"anything goes" spelling;git grep "\.matches(" srcshows only declaration/generation members.🤖 Generated with Claude Code