-
-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Summary
acpx can lose session mode (for example plan) across reconnects when session/load fails and runtime falls back to session/new.
Observed behavior:
set-mode planreports success- next command reconnects,
loadSessionfails (Resource not found/ empty-session load failure) acpxcreates a fresh ACP session- effective mode silently reverts to default (
auto)
Why this happens
Mode switching is applied to the current ACP session id. When reconnect creates a fresh ACP session, there is no replay of the user's intended mode.
Reproduction
- Ensure a persistent session.
- Run
set-mode plan. - Trigger reconnect where
session/loadfalls back tosession/new. - Run another config command (for example
set reasoning_effort high) and inspectconfigOptions.mode.currentValue.
Expected: mode remains plan.
Actual: mode may be auto.
Proposed fix
Persist a desired mode at the acpx session-record level and replay it when a fresh ACP session is created:
- Persist
record.acpx.desired_mode_idon successful:set-mode <mode>set mode <value>
- In
connectAndLoadSession, if fallback creates a fresh ACP session, callsession/set_mode(desired_mode_id)before continuing. - Keep behavior best-effort: replay failures should warn in verbose mode but not hard-fail normal command flow.
Validation
Added regression coverage for fallback + replay in CLI tests:
- set
plan-> reconnect fallback -> verify mode stillplan - set back to
auto-> reconnect fallback -> verify mode stillauto
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels