Skip to content

fix(gateway): preserve model intent across turn admission - #130

Draft
RecursiveIntell wants to merge 1 commit into
mainfrom
fix/ares-model-intent-admission-20261004
Draft

RecursiveIntell wants to merge 1 commit into
mainfrom
fix/ares-model-intent-admission-20261004

Conversation

@RecursiveIntell

Copy link
Copy Markdown
Owner

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_at object. 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 through scripts/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_switch and config.set for 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, tree cbabd9591dc00fdf8deed90aeb3e8b1dc5bd2ebc. Reverse patch SHA256 b1729a1722cb8a9be945ec0c0adeb3fc23ec38aa62d87daeaface90c2d64af07 restores the exact two-path preimages. Hosted CI is a separate gate. No installed runtime changes accompany this draft.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on f2e1fe7 — fix(gateway): preserve model intent across turn admission

⚠️ Warnings

OSV vulnerability scan · View job

96 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 5m26s vs 7m23s (-26.4%). 13 job(s) slower, 10 faster, 1 unchanged.

  • Python tests / Run tests slice 2/12: -138.0s
  • OS-specific tests / macOS-only tests: -104.0s
  • OS-specific tests / Windows-only tests: -89.0s
  • Python tests / Run tests slice 3/12: +77.0s
  • Python tests / Run tests slice 11/12: +66.0s

This branch has not been deployed

No deployments
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.

1 participant