Skip to content

Settle managed turns through TurnState.settles, not the deleted matches - #1193

Merged
trissim merged 2 commits into
mainfrom
fix/managed-turn-settles
Oct 24, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/managed-turn-settles

Conversation

@trissim

@trissim trissim commented Oct 24, 2026

Copy link
Copy Markdown

Defect

Toast on core-49156b4bb (Tristan, 2026-10-24 ~15:42), the cut-off end of the trace:

agent_comms/transcripts.py:358 publish_turn
toad/acp/comms_updates.py:256 publish_thread_turn
toad/acp/comms_updates.py:109 turn_changed
toad/conversation_turn.py:271 receive
AttributeError: 'TurnState' object has no attribute 'matches'

Core #2943 (merged 2026-10-23 22:42) deleted TurnState.matches. ManagedTurnBinding.receive still called it for every non-busy publication, including the owner snapshot OwnerSnapshotConsumer.thread_presentation publishes when you switch threads. Reproduced in the installed runtime: ManagedTurnBinding.receive(TurnState()) raises at conversation_turn.py:271.

Fix

  • receive asks Core's owner: state.settles(self.owner.state.active) (Let TurnState answer which idle publication settles a held turn agent-comms#3076 adds it: busy replaces, idle settles only the turn it finished, or anything when nothing is held).
  • Deleted TurnOwner/AgentTurn/ManagedTurn.matches_settlement: zero callers, and one of them called the deleted method.
  • tests/support/peers/typed_turn_events.py passed "retired-producer" / "actual-producer" as turn ids; #2943 made TurnId a typed 128-bit id, so this test was already red on main (MalformedRecord) before it reached the UI. It now passes TurnId(...).

Proof

tests/textual/test_compaction_turn_events.py against agent-comms#3076: 1 passed in 12.17s (stale finished cut refused, terminal publication settles the held turn).

Merge order: agent-comms#3076 first, then this. Waiting on the commander's verdict.

Assumed: ManagedTurnBinding._owner is always a ManagedTurn (it is constructed and replaced only as one in this class).

🤖 Generated with Claude Code

Core #2943 deleted TurnState.matches, so receive() at conversation_turn.py:271
raised AttributeError on every idle turn publication, including the owner
snapshot Toad publishes when switching threads. Ask Core's TurnState whether
the publication settles the held declaration, and delete the three
matches_settlement methods nothing calls. The compaction peer now passes
typed 128-bit turn ids, which #2943 also required.

Requires OpenHCSDev/agent-comms#3076.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim marked this pull request as ready for review October 24, 2026 19:51
Copilot AI balanced review requested due to automatic review settings October 24, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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>
@trissim
trissim merged commit 9ec64b8 into main Oct 24, 2026
3 checks passed
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