loopx icon indicating copy to clipboard operation
loopx copied to clipboard

[Bug]: ACP Chat conversations cannot be resumed after a restart when the provider restores a different model or reasoning setting

Open JasonBuildAI opened this issue 1 month ago • 0 comments

Preflight

  • [x] I searched existing issues and discussions for this behavior.
  • [x] This report is not an unpatched security vulnerability.
  • [x] The report and attachments contain no credentials or private/internal material.

Issue origin

Observed or reproduced in a real environment.

LoopX version or commit

a54c030ee (current main at report time).

Host or runtime surface

Other: LoopX Chat ACP endpoints, including the built-in Kiro CLI ACP route and owner-registered ACP agents.

LoopX area

Host or runtime integration.

Problem

Impact. A Chat restart permanently ends every ACP conversation that was opened with an explicit model or reasoning setting: recovery raises CodexChatAgentError("The previous Agent conversation could not be restored."), the stored session is marked resume_failed, and every later resume attempt fails the same way. This covers the whole ACP adapter family (the built-in Kiro CLI route and registered ACP endpoints), not an edge case: ACP recovery deliberately restores the provider's own configuration and some providers omit configOptions from session/load, so the restored value can legitimately differ from the original request. The same check failed in the 2026-10-17 daily full-public fleet run (full-public-smokes (3, 330), loopx-chat-acp-adapter-smoke.py), one of the failures that made smoke-fleet-health report ready=false.

The regression comes from #6699 (0cec1c0c5): the recovery path calls _observed_model_settings(adapter, requested_agent_reasoning_effort, requested_agent_model_id). That confirmation was designed for session creation, where LoopX has just applied the user's choice. Recovery does not apply it: ACPStdioAdapter.start skips config_values on resume, and session/load may legally return no configuration options. A provider-restored model or effort therefore raises unsupported_configuration, which the outer handler rewrites to resume_failed.

Minimal reproduction

Public, offline, at a54c030ee, from the repository root:

uv sync --extra test
uv run python examples/loopx-chat-acp-adapter-smoke.py

The shipped smoke opens a registered ACP fixture with agent_model_id="fixture/fast", closes the controller, then resumes with mode="resume_latest" (the restart scenario).

Actual: exit 1 at second.open_session (line 290):

CodexChatAgentError: The previous Agent conversation could not be restored.
  direct cause: CodexChatAgentError: The Agent did not confirm the requested model; no message was sent.

The same check failed in the daily fleet: https://github.com/loopx-project/loopx/actions/runs/39068476762 (job full-public-smokes (3, 330)); the fleet-health job then reports ready=false.

Expected behavior

Recovery succeeds and returns the same session, recording the provider-restored model and reasoning effort as agent_model_id/agent_reasoning_effort; the original request remains stored as requested_agent_model_id/requested_agent_reasoning_effort. The shipped smoke expects exactly this: after the restart, the restored session reports the fixture default.

Actual behavior

Recovery fails, the session is marked resume_failed, and the UI reports that the previous Agent conversation could not be restored.

Sanitized diagnostics

File "loopx/chat_runtime.py", line 355, in _observed_model_settings
    raise CodexChatAgentError("The Agent did not confirm the requested model; no message was sent.", ...)
loopx.chat_agent.CodexChatAgentError: The Agent did not confirm the requested model; no message was sent.
The above exception was the direct cause of the following exception:
loopx.chat_agent.CodexChatAgentError: The previous Agent conversation could not be restored.

Additional context

The creation path should keep the confirmation check; only recovery needs to observe the restored identity. The smoke fixture is public and offline, so the reproducer is deterministic and needs no credentials.

JasonBuildAI avatar Oct 18 '26 07:10 JasonBuildAI