agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

Side chats: follow-ups from #6481 review

Open ronishrohan opened this issue 1 month ago • 1 comments

Side chats shipped in #6481 behind Developer mode and a "Side chats" switch that is off by default. These review findings are still open and should be fixed before the switch is turned on for everyone.

P1

  • Restored running turns can block the queue after a daemon crash (backend/internal/service/chat/side.go, restore path). If a turn completes and the old daemon receives the completion but crashes before Electron's next snapshot, recovery restores the turn as running and waits for a completion that was already delivered. activeTurnID is never cleared, so queued questions stay blocked. Fix: reconcile the provider's current outcome before restoring running ownership, or fail the restored turn visibly when it cannot be verified.

P2

  • Host cleanup can be lost if the daemon dies during close (frontend/src/main.ts capture/close path). capture(sideId) drops the full recovery record before DELETE runs. If shutdown fails and the daemon dies before exporting its cleanup tombstone, nothing retries the host shutdown. Fix: keep a CleanupOnly record from the existing recovery record when close intent is captured.
  • /btw and /side from a side composer can run twice (IndependentSideChats.tsx). The command path runs before the sendingRef guard and creates a side with a new key each attempt, so a double Enter or a retry after a lost response creates a second side and sends the question again. Fix: reserve the submission first and reuse its destination, creation key, and message id, as the main composer path does.
  • /side from a side composer leaves staged files behind (IndependentSideChats.tsx). The handoff sends resources: []; the source draft's staged paths and image payloads are not transferred. Fix: freeze them into the destination delivery receipt before dispatch and clear the source only after the handoff succeeds.

Review threads: https://github.com/OrchestratorInc/agent-orchestrator/pull/6481

🤖 Generated with Claude Code

ronishrohan avatar Oct 11 '26 22:10 ronishrohan

Implementation is ready for review in #7088: https://github.com/OrchestratorInc/agent-orchestrator/pull/7088

  • Verified the existing restored-running-turn recovery through the launch recovery API; an unverifiable outcome visibly fails and holds queued work without replay.
  • Fixed duplicate /btw / /side handoffs with source submission ownership and stable destination/message identities across retries and remounts.
  • Included staged files, image payloads, and supported references in the frozen handoff; newer draft edits are preserved.
  • Preserved host/fork cleanup ownership across uncertain closes and daemon replacement, with a closing tab and Retry close.

Developer Mode gating is unchanged. Performance and visual redesign remain separate.

Local verification: 58 focused frontend tests, side/boundary Chat tests, frontend/E2E typechecks, backend build/vet, and bundle builds pass. The PR documents the Windows full-suite/lint failures and unavailable race, Docker, and native desktop checks.

CI validation complete (2026-10-22 18:52 UTC): all 24 PR checks passed on head 642c06e78ada104e93cd5b647a1dedb7f6759838. This includes the full frontend tests/typechecks, renderer smoke, Go build/vet and race suites, lint, SQL/API drift, CLI E2E on Linux/macOS/Windows and in a container, macOS update helpers, and security scanning.

The PR validation summary now records these verified results. The watch is being removed because all checks have passed. PR #7088 remains open for review and has not been merged. The previously documented manual real-provider Electron lab limitation remains; CI success is not a claim of that manual verification.

Vansh-Singhal avatar Oct 22 '26 17:10 Vansh-Singhal