Skip to content

fix(inference): preserve active sessions and routing state - #152

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
codex/fix-inference-routing-review
Nov 18, 2026
Merged

ScriptedAlchemy merged 1 commit into
mainfrom
codex/fix-inference-routing-review

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

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.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e895512

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit e5ade97 into main Nov 18, 2026
21 checks passed

@ScriptedAlchemy ScriptedAlchemy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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