Switchbordswitchbord
v0.18.108

v0.18.108 — GB-Agent autosend stuck-violet timeout + retry cap

Per-workspace GBCA generation timeout and outbox retry cap with a client-side self-timeout safety net for the autosend / Draft-with-me violet 'thinking' cell.

Fixed


  • GB-Agent autosend stuck-violet cell. The 240s per-call GBCA timeout was hard-coded in the worker, and the only path to retire the violet 'thinking' cell on a per-conversation run was the realtime connector_draft_run_failed broadcast. A missed broadcast (realtime drop, app tab backgrounded) could keep the cell violet indefinitely while the worker kept retrying silently. The per-call timeout is now per-workspace (proactiveDraftGenerationTimeoutSeconds, default 300, range 30–600) and the outbox retry cap is also per-workspace (proactiveDraftGenerationMaxRetries, default 3, range 0–6); both surface in the GB-Agent settings panel. The app also writes a startedAt + timeoutMs into the per-conversation run store on the connector_draft_run_started broadcast and runs a client-side self-timeout that flips the cell red if the worker's failed broadcast is missed — bounded by the workspace's per-call timeout × (retries + 1) + 30s grace.
  • Operator triage for stuck cells. Worker surfaces a structured [proactive-draft] generation timed out log on retry exhaustion with workspaceId, conversationId, attempt, maxAttempts, timeoutMs, maxRetries, and a truncated reason so a single grep finds the dead-lettered generation.

Security / Data


  • No data-handling change. The two new gb_agent_workspace_settings columns are workspace-scoped, additive, and default-on. The PATCH route validates the new fields via zod (min(30) / max(600) for the timeout, min(0) / max(6) for the retry cap) and the database normalizer clamps to the same bounds.

Tests


  • 14 new tests across @repo/domain (clamp helpers), @repo/database (queue max_attempts + payload forwarding), worker (timeout override), and @repo/app (settings panel rendering + PATCH payload); updates 3 existing test factories to include the new defaults so the prior proactiveDraftAutoSendAllInbound and customer-travel-context tests still pass. The full database suite (736 tests) and worker suite (127 tests) pass.

Verification


  • pnpm --filter @repo/domain exec tsc --noEmit (clean)
  • pnpm --filter @repo/database exec tsc --noEmit (clean)
  • pnpm --filter @repo/database test (736 tests pass)
  • pnpm --filter worker test (127 tests pass)
  • pnpm --filter @repo/app exec vitest run gb-agent-settings-panel (8 tests pass)
  • pnpm release:hygiene (after CHANGELOG + version bump)