Fix queued seat wakes and refused starts - #60
Open
andreisavu wants to merge 1 commit into
Open
andreisavu wants to merge 1 commit into
andreisavu wants to merge 1 commit into
Conversation
andreisavu
added a commit
that referenced
this pull request
Sep 10, 2026
…a name a refused start took (#61) Three faults a review of the branch found are still open, and this commit fixes them. The seat actor held one queued wake, so a second wake that landed while an activation ran overwrote the first, and the room waited out the resend window for work the seat had already been sent. The queue is an array now: every wake queues once, keeps the place the first one took, and runs in turn. A wake that landed while an activation released its lease was steered into that activation. It reads nothing more, so the steer went nowhere. The activation is marked over for the length of its release, and a wake that lands then runs as an activation of its own. A start whose composition the record refuses kept the name for the life of the runtime, unless the host stopped the handle it holds. The name comes free when the start is refused, and the next start takes it. A delivery directed at the assistant is refused. The assistant sits at the narrow end of attention and wakes for nothing said, so such a delivery is a message nobody reads. The seat tests pin the two seat faults, and the session tests pin the freed name, the refused delivery, and a commit from a lease that ended, which is answered stale before what the record moved past. That last test comes from #60, which took the same three fixes in parallel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SJjjR3S6iwqEbDXsRDJgiq
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.
Motivation
Description
overwhile the release is in flight to ensure wakes in that window queue instead of starting or steering another activation (packages/ambion/src/seat/seat.ts).enqueuelogic and ordered draining (packages/ambion/src/seat/seat.ts).run()until the queued wakes drain in order (packages/ambion/src/seat/seat.ts).startSessionorresumeSessionfails so a refused composition does not keep the name reserved, using a guardedfreehelper to avoid deleting a newer run (packages/ambion/src/session.ts).noneto avoid messages that no seat can read (packages/ambion/src/session.ts).packages/ambion/test/seat.test.ts,packages/ambion/test/session.test.ts,packages/ambion/test/assistant.test.ts).Testing
pnpm --filter @ambionframework/ambion exec vitest run test/seat.test.ts test/session.test.ts, which passed (18 tests passed).pnpm --filter @ambionframework/ambion exec vitest run test/assistant.test.ts -t 'composes nothing for a question', which passed.pnpm check(build, type checks, lint/knip, test); succeeded apart from transient TypeScript diagnostics in test/live sources noted during build, and final test run succeeded.pnpm check:formatandprettierfixes where needed; formatting is clean.Codex Task