Repository navigation
receive loop: hold a conversation answered none or paused until a newer message (1.5.1) - #33
Merged
Merged
Conversation
…er message (1.5.1) After a could-not-process report answered `none` or `paused`, the loop ran the conversation again on its next cycle, on the same input, and it failed the same way every time. The loop now holds it at the anchor it reported: no cycle runs or gates it while its card shows that anchor (an `unanswered` re-wake does not lift it), and a run or turn of it at that anchor does not start, whether it waited for a slot or was decided before the answer came. A newer message, or the card leaving a complete tray, ends the hold. A failure reported on another conversation's completion now holds its conversation until the answer, as one reported at its own end did: a freed slot no longer starts it on the input the answer is about. Status lists the held conversations; patch release 1.5.1.
…out for it The runtime check's end woke the loop whenever a cycle had left any card out. Inside a cycle, while a turn ran on, that made the gate spin: one gate call and one runtime check per pass. The end of a report or check now wakes only when a cycle left a card out because that card's report was out.
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.
What changes
When an agent's AI cannot process a conversation and the server answers the kit's could-not-process report with
noneorpaused,integration.ReceiveLoopused to run that conversation again on its next cycle on the same input. The trigger could be a message in any conversation, a wake frame, a reconnect, a wake the integration heard, or a turn's end. The run failed the same way and sent the same messages to the model every time. The loop now holds the conversation at the anchor it reported (a failed message is not redelivered; new messages flow):unansweredre-wake does not lift the hold.nonetoo, as onpaused). One decided before the answer came is checked again when it starts. A run already under way that ends silent there does not lift the hold.retry. A verdict or mark-read that takes the card off a complete tray ends it too.A failure reported later (on another conversation's completion, or on the runtime check) now holds its conversation from the moment its report is due until the server answers, as one reported at its own end already did. No cycle gates or runs it meanwhile, and a run or turn of it waits for the answer. Before this, the freed slot could start it on the input the answer was about.
Status:
processingFailures.heldlistsconversationId,anchor,sinceandreason, so integrations' status/doctor can say "not retried until a new message arrives".processingFailures.startsHeldcounts the runs and turns not started because of a hold.CycleSummary.heldAfterFailurecounts the cards a cycle left out.All three are optional in the types (always set by the loop), so status objects built elsewhere keep compiling. Existing fields are unchanged.
Version
1.5.1(a patch: it fixes existing behaviour, perVERSIONING.md), with a CHANGELOG section## 1.5.1 — 2026-11-20. README anddocs/integration-kit.mdare updated. No tag is created here: publishing is the separate, approved release step.Verification
type-checkclean;test903 passed in 30 files (14 new could-not-process tests and one existing expectation updated: a run of the conversation queued behind the evidence is now dropped onnone);buildok;scripts/check-contract-fixtures.shmatches the published contract. The new tests cover:noneheld through a message elsewhere, a wake frame, anunansweredre-wake and a reconnect while the other conversations keep running, with a newer message lifting the hold and the next failure gettingretry; a waiting run that waits for the answer (nonedrops it,retrystarts it once);paused; a card read meanwhile, and a truncated tray proving nothing; gate-call mode (reply turns and single-card gate calls); the runtime-check path; the three start-time races; a newer-anchor run kept onnoneand dropped onpaused; a silent run under way not lifting the hold; no wake loop while a turn runs; and the Pacer's bounds and read ordering. The new tests fail against the 1.5.0 loop.reportingleak if the turn-end path threw, a pace replacing a hold at the same anchor, required new type members (a compile break for integrations that build status objects), status not clearing a hold whose card moved to a newer anchor, and doc inaccuracies. All are fixed and covered by the new tests; the reviewer's probes now show the conversation staying held. A re-review of the fixes found one regression they introduced: a wake at the end of the runtime check that could spin the gate while a turn ran on. That is fixed (the end of a report wakes only for a card a cycle left out because its report was out), and a test pins one wake to one cycle (it fails with the regression: 161 cycles).Also in this PR: the contract v1 fixtures copied byte for byte from the published contract (manual 2.4.1), the established fixture-only commit; the conformance check passes.
Risk and rollback
The risk is a conversation held when it should run. The hold never covers new input: a newer message, the card leaving a complete tray, a
retry/hiddenanswer, or a restart ends it. A server that predates the route reads asnone, so on such a server a failure with evidence now holds the conversation until a new message arrives, where before it ran again on every cycle. The server answers the route today. Rollback: revert this PR, or stay on 1.5.0. There is no wire, storage or server change.