Repository navigation
fix(inference): preserve active sessions and routing state - #152
Conversation
|
ScriptedAlchemy
left a comment
There was a problem hiding this comment.
Post-merge audit of e895512604072ad6e3443ff705fc88d02db2c6ca: a P2 catalog/session mismatch remained for Pi on current main (1857cd2554f068a0c75ac5f109a07afe9398ba16). Pi loads its hosted-model config at subprocess startup, but its adapter did not expose inferenceCatalog, so an existing session was reused for a newly discovered model it could not serve. Switching an already-running native Pi session to hosted inference also missed the refresh because the manager required an old catalog to be present.
Fixed in #158 by exposing Pi's active catalog and treating an absent old catalog as requiring refresh when the requested model is in the current catalog. Pending background work still defers replacement; original-model reuse and subsequent replacement reuse are covered. Both Pi paths failed before their respective fixes. The combined validation passed all 80 session-manager tests and all 254 Pi package tests.
The lifecycle tests use the real Pi adapter metadata with the existing managed-session runtime harness; no live Pi executable or model request was available. Next action: require #158's exact-head CI to pass before merging.
Follow-up to #151. A model picker refresh could replace a managed OpenCode instance and stop its server during an active turn. Several inference settings paths also handled older hosts, project overrides, or pending setup inconsistently.
Keep the previous managed OpenCode server alive until its existing sessions release it when only the hosted model catalog changes. An idle session can reopen safely when the user selects a newly advertised model. Actual configuration changes still use the normal provider replacement path.
Recognize advertised Codex and Claude models from older servers, gate automatic hosting changes on server support, and keep explicit local setup on the chosen environment. Preserve the provider's separate enabled setting on reconnect. Show project-only routes, allow incomplete routes to be turned off, and use the guard for the operation's actual scope. Discard stale setup completions after leaving a provider screen.
Verification includes focused lifecycle, settings, authorization, and mixed-version regression tests. Two isolated Chromium scenarios cover inline hosting and discovery of GPT-6.2 Sol and Astra after refresh.
Built with GPT-6.2 Sol in Codex Desktop.