Skip to content

Saving a General, Tasks, Sandbox or Docker setting deletes an agent's account list #308

Closed

Description

@GabrielDumbrava

Environment
macOS 26.6.2, arm64.
Termic 1.4.6, reproduced on main.

The problem

An agent's account list disappears from settings.json, together with its default, adopted account and auto-switch flag.
The footer switcher is gone for any task that loads it afterwards, and a task that never had its own account override falls back to the agent's ordinary login.
Tasks with an explicit override keep running on their account, which hides the loss until one of them is reopened.

This happened on 1.4.6, which already has 0cdfb58 ("a stale Settings snapshot no longer deletes a second account").

Reproduction

  1. Open Settings → General.
  2. Add accounts to an agent from somewhere else (the footer panel, the Agents section, or account_add).
  3. Change an unrelated General field, for example the browser, and save it.

The agent's accounts is now empty.
credentials.e2e.ts reproduces it: three accounts before the General save, [] after.

Cause

0cdfb58 made agents_save carry the account fields across from the stored entry.
settings_save has the same hole and was not covered: it receives the WHOLE Settings, agent registry included, and General, Tasks, Sandbox and Docker build that object as { ...settings, field } from a snapshot taken when the section mounted.
Any account added after that snapshot is written back out of existence by the next save of an unrelated field in those sections.

The registry cannot simply be ignored on that path: Docker writes docker_env through settings_save.

Proposed fix

Apply the same by-id carry in settings_save: keep accounts, default_account, adopted_account and auto_switch_account from the stored entry, and take everything else from the request.
I have a PR with a Rust unit test and the e2e reproduction above.

Only the account fields are protected that way.
The rest of a stale agent entry is still written back by those sections, which is the general snapshot problem they have; noted in docs/agent-accounts.md.

Accounts already lost are not restored by the fix and have to be added again.

Activity

  1. simion commented on Sep 17, 2026

    @simion
    Owner

    This shipped in v1.5.0, released today. Thanks for reporting!

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