Skip to content

fix: stabilize session/create flow — runtime-prefs handshake, third-party providers, lazy sessions, model state - #38

Merged
william0wang merged 6 commits into
mainfrom
fix/create
Aug 3, 2026
Merged

fix: stabilize session/create flow — runtime-prefs handshake, third-party providers, lazy sessions, model state#38
william0wang merged 6 commits into
mainfrom
fix/create

Conversation

@william0wang

Copy link
Copy Markdown
Owner

Summary

Fixes the session/create flow for editor-initiated sessions and the model
state 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

  • Auto-reply session/requestRuntimePreferences (0a57cd5) — the backend
    sends this request during session/create; the bridge now answers it
    instead of letting session creation block.
  • Load third-party providers via workspace/updateProviderRegistry
    (5ab6b6c) — the V4 backend no longer auto-loads providers from
    config.json; the bridge mirrors the host's ModelProviderService by pushing
    the registry (inline apiKey, apiFormat derived from kind), so
    third-party models no longer fail with provider_not_configured.
  • Defer session/create until first use (90a890d) — session/new
    returns 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.
  • Propagate mid-turn model/mode/thought switches via state.updated
    (7a4185a) — pushes config_option_update (+ current_mode_update)
    immediately instead of waiting for turn completion.
  • Resolve lazy placeholders on session/resume / session/load
    (b4292d8) — keeps the acp_sid ↔ zcode_sid mapping consistent.
  • Keep the selected model in the dropdown (8a19626) — a state.updated
    patch 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.
  • New coverage: provider-registry, lazy-sessions, session-lazy,
    runtime-model, dispatch (ConfigChanged model preservation), bugfixes,
    backend.

Docs

  • docs/ARCHITECTURE.md and docs/PROTOCOL.md updated for the lazy-session
    lifecycle and the provider-registry push.

@william0wang
william0wang merged commit 17e9fc6 into main Aug 3, 2026
1 check passed
@william0wang
william0wang deleted the fix/create branch August 3, 2026 08:47
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