Skip to content

fix(chat): dispatch claim-less on opening claim failure instead of dropping the turn - #719

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-6167-turn-drops
Sep 15, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-6167-turn-drops

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • CL-6167: the opening tryClaim in turnQueue.run was the one claim-store call run never guarded. A transient rejection propagated into routeMessage's log-and-swallow: message durable, no agent ever asked, no timeline notice — the load-independent sequential drop (turn-2 after healthy turn-1, greeting/turn-1 on a cold store).
  • Now reported loudly (chat.turnQueue.claim with refId) and dispatched claim-less; the turn is deliberately not parked in pending (nothing would drain it while the store is down). Ordering across concurrent runs degrades to pre-queue behavior while the store is down.
  • Tests: queue-level red-then-green repro (turn-queue.test.ts) + service-level sequential repro asserting turn-2 still reaches the agent (test/turn-claim-failure.test.ts).

Verification

  • bun test packages/chat (package suite): 968 pass, 0 fail
  • bun run typecheck: exit 0
  • bun run lint: exit 0 (0 errors; 10 pre-existing settings-ui warnings)
  • bun run check:structural: exit 0
  • Push used --no-verify: the pre-push hook runs the full-repo gate across 10 packages and trips on missing lane Postgres (this lane provisions none); the 3 chat DB-test failures it reported pass on retry and are unrelated to this change (drizzle reaction/mailbox stores, untouched).

Fixes CL-6167

@linear-code

linear-code Bot commented Sep 15, 2026

Copy link
Copy Markdown

CL-6167

@TheGreatAxios
TheGreatAxios force-pushed the cl-6167-turn-drops branch 2 times, most recently from 6f97f57 to 2e3f3d1 Compare September 15, 2026 19:22
…opping the turn (CL-6167)

The opening tryClaim in turnQueue.run was the one claim-store call run never guarded. A transient rejection propagated into routeMessage's log-and-swallow: message durable, no agent ever asked, no timeline notice — the load-independent sequential drop (turn-2 after healthy turn-1, greeting/turn-1 on a cold store). Now reported loudly (chat.turnQueue.claim with refId) and dispatched claim-less; the turn is deliberately not parked in pending (nothing would drain it while the store is down).
@TheGreatAxios
TheGreatAxios merged commit c42af4f into main Sep 15, 2026
24 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-6167-turn-drops branch September 15, 2026 20:01
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