Skip to content

feat: make compatibility mode a setting that follows the Agents using it - #269

Open
yujiezhang-ops wants to merge 1 commit into
mainfrom
claude/compat-mode-inline
Open

yujiezhang-ops wants to merge 1 commit into
mainfrom
claude/compat-mode-inline

Conversation

@yujiezhang-ops

Copy link
Copy Markdown
Collaborator

Summary

Compatibility mode is an implementation detail of one Agent using one model service, so it no longer has a page or a sidebar entry of its own.

  • Turning it on is unchanged: the setup wizard, an Agent's Profile list, or a failed model check, with one confirmation. The question about starting with the system moves there from the removed page and is asked once per session.
  • Leaving it happens on the Agent. Applying an ordinary Profile drops that Agent's route, and the adapter stops when the last Agent has left (SettleConversion).
  • Settings holds what is left to set by hand: one switch that names the Agents depending on it, and a fold with the listen address, local keys and model aliases. /conversion redirects there.

Fixes

Found by running the current release's real backend against state written by v0.9.0.

  • A leftover route locked compatibility mode. An Agent that moved back to an ordinary Profile kept its route, and once that route's Profile was deleted every later save failed: the adapter could not be stopped, no other Agent could be switched to it, and its keys could not be regenerated. A save no longer checks other Agents' routes. A route is checked when it is set, and a request through a dead one is refused on its own.
  • Changing a forwarded Profile's API type broke its Agents. Every request then failed with 401. The edit is now refused while an Agent is forwarded to the Profile, as deleting it already was.
  • Changing settings failed while an answer was streaming. Settings that keep the listen address are now swapped in place instead of restarting the listener, so other Agents' answers are not interrupted. A rollback no longer stops a running adapter first, which could leave it down while the settings still said it ran.
  • The new-Profile form on an Agent page could preselect the adapter's own Provider, which the picker hides, and save a Profile bound to it.

Behaviour to be aware of

  • Stopping compatibility mode from Settings while an Agent is mid-answer waits five seconds and then closes that response. The confirmation names the Agents affected.
  • After a manual stop, the Agents stay pointed at the adapter until it is switched back on or they are given another Profile, as before.

Test plan

  • go test -race ./..., go vet, staticcheck
  • Frontend unit tests (717) and pnpm run build
  • Playwright e2e (18), including a new case: an Agent given an ordinary Profile leaves compatibility mode
  • scripts/check-docs.py and the third-party licence check
  • Each new regression test fails with its fix removed
  • The lock, the 401, the mid-stream change and the new-Profile default replayed against the non-e2e server build with a local fake upstream
  • Native desktop window (not run: verified in server mode only)
  • Windows

🤖 Generated with Claude Code

Compatibility mode is an implementation detail of one Agent using one model
service, so it no longer has a page or a sidebar entry of its own.

- It is still switched on where an Agent needs it: the setup wizard, an
  Agent's Profile list, a failed model check. The question about starting
  with the system moves there from the removed page, asked once per session.
- It ends on the Agent too. Applying an ordinary Profile drops that Agent's
  route, and the adapter stops when the last Agent has left
  (SettleConversion).
- Settings holds what is left to set by hand: one switch that names the
  Agents depending on it, and a fold with the listen address, local keys and
  model aliases. /conversion redirects there.

Fixes found while testing the current release against its real backend:

- A route left behind by an Agent that had moved on failed every later save
  once its Profile was deleted, so compatibility mode could not be stopped,
  no other Agent could be switched to it and its keys could not be
  regenerated. A save no longer checks other Agents' routes; a route is
  checked when it is set, and a request through a dead one is refused on its
  own.
- A Profile that compatibility mode forwards to can no longer be changed to
  another API type, which made every request of the Agents behind it fail
  with 401. Deleting it was already refused.
- Settings that keep the listen address are swapped in place instead of
  restarting the listener, which waited five seconds on any answer still
  streaming and then failed the change. A stop or a move to another address
  now closes open responses after that grace period instead of failing, and
  a rollback no longer stops a running adapter first.
- The new-Profile form on an Agent page could preselect the adapter's own
  Provider, which the picker hides, and save a Profile bound to it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@yujiezhang-ops
yujiezhang-ops requested a review from a team November 20, 2026 10:05
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