Repository navigation
fix(gateway): preserve model intent across turn admission - #130
Draft
RecursiveIntell wants to merge 1 commit into
Draft
RecursiveIntell wants to merge 1 commit into
RecursiveIntell wants to merge 1 commit into
Conversation
૮ >ﻌ< ა ci reviewran on f2e1fe7 — fix(gateway): preserve model intent across turn admission
|
This branch has not been deployed
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.
A model picker request that starts while a chat is idle can finish resolving after Send admits a turn and replace that turn’s model/client. Queued B can also override a later acknowledged idle C, and A → unused B once → unused C once can restore B instead of the original A.
Commit the picker’s runtime swap and once lease under the existing admission/history lock. Recheck the mapped session, agent and transport before committing, and defer a late pick past the admitted turn. The fence survives accepted steering through the existing admission’s immutable
started_atobject. Replacing an owned, unused once lease preserves its original runtime snapshot and durable/session pin.A successful manual choice supersedes its captured older queue. Unconfirmed or failed choices retain that queue; config adoption and internal one-shot restoration do not erase manual intent. During fallible publication, overlapping manual choices hold the same canonical pending dictionary, release their own claims on failure, and retire it after any successful acknowledgement. Publication stays outside the history lock so slash-worker replacement retains the registry/history lock order.
Validation on sealed tree
23601778b52660daf01d950841748c228c310985: 21 focused regressions and 66 existing compatibility cases pass throughscripts/run_tests.sh, one worker, zero file retries, inert clients and temporary stores. Controls exercise real dispatch/Send/steer, model switching, once turn-finally restoration, config adoption, and the slash restart path with an inert worker. Real StdioTransport EIO injections cover both overlapping failure orders and a newer once choice that completes before the older publication fails.Preserved controls: original unchanged production has 8 failures/4 passes, followed by 12 passes with identical original regression bytes. Review counterexamples have 4 failures/13 passes, and the later completed-once publication counterexample has 1 failure/18 deselections. The test file was expanded by phase; the final 21-case suite is separately sealed and executed. Forward and reverse patches pass byte-checked replay on the two changed paths. Independent review and exact receipts accompany the handoff.
Qualification is the bounded offline backend behavior. Existing global config writes can report False without raising, and the separate slash late-admission route remains outside this picker guarantee. Live providers, installed Ares, desktop integration, packaging and activation were not exercised. Core owns integration and draft-PR publication.
Related open draft #102 changes
_apply_pending_model_switchandconfig.setfor model-control revisions. This focused delta repairs admission fencing, pending-intent retirement and once restoration; the shared seams need reconciliation before either draft is merged.Exact base
04997747879d54a242941d344c3a38293c307076, treecbabd9591dc00fdf8deed90aeb3e8b1dc5bd2ebc. Reverse patch SHA256b1729a1722cb8a9be945ec0c0adeb3fc23ec38aa62d87daeaface90c2d64af07restores the exact two-path preimages. Hosted CI is a separate gate. No installed runtime changes accompany this draft.