Skip to content

[Bug]: Local ACP model picker reverts to Default after reopening a thread (session/load replay-idle drops SessionModelState) #23379

Closed

Description

@zucram

Summary

Follow-up to #17260 / #19519. On 0.1.2-nightly.20261021.3499, a Local ACP agent that only advertises models through the legacy SessionModelState (session/new / session/load → models) gets the full model list in the picker after a provider refresh. The picker falls back to a single Default entry as soon as an existing thread for that provider is reopened. Choosing a model on a reopened thread is also silently ignored.

Seen with Kiro CLI 2.33.0 (kiro-cli acp), configured as a Local ACP command. It should affect any agent that streams a history replay before answering session/load and doesn't put modelState in initialize._meta.

Steps to reproduce

  1. Add kiro-cli acp as a Local ACP provider and refresh it. The picker lists auto, claude-opus-5.5, claude-sonnet-5.5, … (correct).
  2. Reopen an existing thread on that provider that has some history and send a message.
  3. The model picker for the provider now shows only Default. The cached provider snapshot (caches/<instance>.json) is rewritten with models: [{slug: "default"}].

Cause (from the bundled server code)

  • runLoadSessionWithReplayIdle races acp.agent.loadSession(...) against waitForSessionLoadReplayIdle, using the default 2 s replay idle gap. Kiro replays the history as session/update notifications, pauses for more than 2 s, and only then returns the session/load result, which does contain models.
  • The idle branch wins and returns syntheticLoadSessionResponseFromInitialize(initializeResult), which carries modes only and no models. The real RPC result is discarded: the trace shows a session/load span Interrupted after about 3.2 s.
  • configureSession then calls flavor.onSessionConfigurationUpdate(configOptions, modeState, sessionSetupResult.models) with models === undefined. The ACP registry driver publishes that as live configuration, and withLiveRuntimeState → applyAcpRegistryLiveConfiguration replaces the probe-discovered models with modelsFromDiscovery({models: []}) → Default.
  • Separately, model selection in configureSession requires startResult.sessionSetupResult.models != null, so a picked model is never applied with session/set_model on reopened threads.

A provider refresh clears the live configuration (invalidate → clearLiveState), which is why the list comes back until the next reopen.

Suggested fix

Any one of these would solve the picker. The first also fixes selection:

  1. When the replay-idle branch wins, keep waiting a bounded time for the real session/load result (or merge models/configOptions from it when it arrives) instead of interrupting it.
  2. Let syntheticLoadSessionResponseFromInitialize reuse the last known SessionModelState for the session, for example from session/new or the provider probe.
  3. In applyAcpRegistryLiveConfiguration, fall back to the probe-discovered models when the live configuration has no model candidates, rather than collapsing to Default.

Happy to put up a PR if one of these matches the direction you want.

Version

T3 Code 0.1.2-nightly.20261021.3499 (Linux server, t3 serve), Kiro CLI 2.33.0.

Activity

  1. juliusmarminge commented on Oct 22, 2026

    @juliusmarminge
    Member

    Reproduced on Linux web at 3b95e7831b with a Local ACP v1 fixture that advertises models only in session setup and returns session/load five seconds after replaying history. A fresh thread selected Opus correctly. After settling and reopening it, selecting Sonnet produced a response with the fixture default, no session/set_model request, and a cached catalog containing only Default. Kiro itself is not installed on this VM.

  2. juliusmarminge commented on Oct 23, 2026

    @juliusmarminge
    Member

    Duplicate of #21739: reopening an ACP session loses model controls when replay idle wins before the final session/load response. The prior Linux web reproduction recorded above confirms the legacy SessionModelState variant. The existing fix in #23586 adopts the late response and forwards its models to the registry, covering this case as well. Tracking the repair there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions