Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix: send backupsEnabled config before pending messages to prevent race

7 months ago

ac8c9ff
Authored
Max Weinbach3/11/2026, 6:23:41 PM
When "Workspace backups" was disabled, backups were still being created
due to two race conditions:

1. At thread startup, applyWorkspaceDefaultsToThread was async/void'd
   and would yield before set_config could arrive, while the pending
   first message was sent synchronously — starting a turn (and backup)
   before the disabled setting reached the session.

2. applyWorkspaceDefaultsToThread deferred ALL config (including
   backupsEnabled) when the thread was busy, so auto-checkpoints kept
   happening during the entire turn.

Fix: send set_config { backupsEnabled } synchronously in the
server_hello handler before any pending messages, and in
applyWorkspaceDefaultsToThread send it immediately regardless of busy
state (only defer model/provider changes).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Parent01b5f2b

3 files changed
  • apps/desktop/src/app/store.actions/workspaceDefaults.ts+25−23
  • apps/desktop/src/app/store.helpers/threadEventReducer.ts+17−0
  • apps/desktop/test/workspace-settings-sync.test.ts+28−8