Skip to content

fix #34: preserve FIFO submitted turns#38

Merged
tuchg merged 1 commit into
mainfrom
codex/issue-34-turn-queue-fifo
Jun 1, 2026
Merged

fix #34: preserve FIFO submitted turns#38
tuchg merged 1 commit into
mainfrom
codex/issue-34-turn-queue-fifo

Conversation

@tuchg

@tuchg tuchg commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • make LucarneCore::submit_turn the single user-message live submission entry and remove the start_turn submitted-turn compatibility path
  • create durable turn records inside core submit, hold FIFO permits until terminal lifecycle, and route Telegram/WeChat user-message submission through that policy
  • keep Telegram projection cleanup after drain so late-registered permission callbacks cannot outlive completed turns; document the decision in docs/decisions/2026-06-01-turn-queue-fifo-admission.md

Verification

  • cargo +nightly check -Zbuild-dir-new-layout
  • cargo +nightly test -Zbuild-dir-new-layout --workspace --all-features -- --quiet
  • cargo +nightly test -Zbuild-dir-new-layout --workspace --all-features journey -- --nocapture
  • focused: FIFO core tests, core_service_stress, Telegram active-conversation notification test, and lucarne-telegram turn::

Fixes #34

@tuchg tuchg force-pushed the codex/issue-34-turn-queue-fifo branch from 627c81b to 651ae4e Compare June 1, 2026 05:20
@tuchg tuchg changed the title fix(telegram): preserve FIFO turn admission fix(core): preserve FIFO submitted turns Jun 1, 2026
@tuchg tuchg changed the title fix(core): preserve FIFO submitted turns fix #34: preserve FIFO submitted turns Jun 1, 2026
@tuchg tuchg force-pushed the codex/issue-34-turn-queue-fifo branch from 651ae4e to 0a520e9 Compare June 1, 2026 05:45
Root cause: user-message live submission had two independent paths. Core submit used FIFO admission, while Telegram could pre-open a turn and submit directly to the provider, and the compatibility reuse path let start_turn participate in submitted-turn state without owning a permit.

Fix: make LucarneCore::submit_turn the single user-message live submission entry, create the durable turn inside that path, remove start_turn submitted-turn compatibility, and route Telegram/WeChat user submissions through core admission. Telegram still completes lifecycle after projection drain to clear callbacks registered while draining already-queued events.

Regression guard: submit_turns_wait_for_prior_turn_completion_per_workspace covers same-workspace FIFO, core_service_stress covers open/submit/record/complete, Telegram active-conversation and turn projection tests cover no duplicate notification/final-message behavior, and full workspace + journey suites pass.
@tuchg tuchg force-pushed the codex/issue-34-turn-queue-fifo branch from 0a520e9 to 96ba98b Compare June 1, 2026 06:24
@tuchg tuchg merged commit a9c824a into main Jun 1, 2026
6 checks passed
@tuchg tuchg deleted the codex/issue-34-turn-queue-fifo branch June 1, 2026 06:25
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.

bug: queued inbound messages can overtake older unanswered messages

1 participant