Skip to content

fix(worker): preserve interactions across worker reconnects - #67

Merged
nixuuu merged 1 commit into
devfrom
test/interaction-reconnect
Nov 4, 2026
Merged

nixuuu merged 1 commit into
devfrom
test/interaction-reconnect

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 4, 2026

Copy link
Copy Markdown
Member

Pending permissions, questions and elicitations now have integration coverage across worker↔gateway network drops, and one real bug is fixed.

Fix: Grok rejected the StartTurn the outbox replays after a reconnect while the original prompt was still waiting for an interaction. The gateway then failed the running turn and expired its pending permission. A replayed StartTurn for the turn that is already running is now acknowledged without starting a second prompt.

Tests (tests/integration/interaction-reconnect.test.ts, durable-threads.test.ts):

  1. Asked while the link is down → after reconnect exactly one pending interaction and one timeline item.
  2. Answered while the worker is offline → the stored answer reaches the worker, the provider continues.
  3. Answer lost at the send boundary → delivered after reconnect, duplicates do not continue twice.
  4. Long outage → day-old permissions, questions and elicitations survive sweep/settle while their turns run.

Docs: no permission deadline exists in code, so protocol.md / execution.md now describe the real behaviour (wait until answered or the turn/thread stops); failure matrix row in durability.md.

Checks: install, gen:check, typecheck, lint, format:check, check:tmp (861 pass, 152 skip, 0 fail).

@nixuuu
nixuuu merged commit 97c4058 into dev Nov 4, 2026
2 checks passed
@nixuuu
nixuuu deleted the test/interaction-reconnect branch November 4, 2026 15:24
nixuuu added a commit that referenced this pull request Nov 4, 2026
Two integration tests failed intermittently on the new parallel CI
shards (#80).

- **agent-skills** ("folder/ZIP boundaries reject … without writes"): a
second worker's delayed registration bumped the environment revision (3
→ 4) after the test took its baseline. Reproduced deterministically with
controlled ordering. Setup now awaits every worker's registration and
current report before the baseline.
- **interaction-reconnect** ("an answer lost at the send boundary …"):
the test's snapshot read could straddle the interaction transaction and
see the pending request before its timeline item. Reproduced under load.
The existing wait now requires the matching timeline item.

No production changes, no sleeps, retries or weakened assertions. Each
file passed 30 runs in a row (270 + 120 tests); full suite 943 pass /
152 skip / 0 fail.

Fixes: #63
Fixes: #67
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