fix: stabilize session/create flow — runtime-prefs handshake, third-party providers, lazy sessions, model state - #38
Merged
Merged
Conversation
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.
Summary
Fixes the
session/createflow for editor-initiated sessions and the modelstate that follows it: the backend handshake no longer blocks creation,
third-party providers load correctly, backend sessions are created lazily on
first use, and the editor's model/mode/thought UI tracks the session
authoritatively — including mid-turn switches — without drifting back to
defaults.
Changes
session/requestRuntimePreferences(0a57cd5) — the backendsends this request during
session/create; the bridge now answers itinstead of letting session creation block.
workspace/updateProviderRegistry(
5ab6b6c) — the V4 backend no longer auto-loads providers fromconfig.json; the bridge mirrors the host's ModelProviderService by pushing
the registry (inline apiKey,
apiFormatderived fromkind), sothird-party models no longer fail with
provider_not_configured.session/createuntil first use (90a890d) —session/newreturns a placeholder; the backend session materializes lazily on the first
prompt/resume/load, so an editor startup that never prompts leaves no empty
sessions behind.
state.updated(
7a4185a) — pushesconfig_option_update(+current_mode_update)immediately instead of waiting for turn completion.
session/resume/session/load(
b4292d8) — keeps the acp_sid ↔ zcode_sid mapping consistent.8a19626) — astate.updatedpatch only carries changed fields; config options are now rebuilt from the
session's authoritative settings instead of defaults, so a mid-turn
mode/thought update no longer resets the model/mode/thought dropdowns to
their default values.
Testing
pnpm test— 360 tests pass (23 files); typecheck and lint clean.runtime-model, dispatch (ConfigChanged model preservation), bugfixes,
backend.
Docs
docs/ARCHITECTURE.mdanddocs/PROTOCOL.mdupdated for the lazy-sessionlifecycle and the provider-registry push.