Untitled conversation
- User
[Reborn WebUI Beta] Add WebUI idempotency and accepted-message ledger Parent tracker: #3607 Module: M2 — Native Product Workflow / Inbound Facade Priority: P0
Goal
Make WebUI mutations idempotent so duplicate browser submits do not create duplicate turns/messages.
Scope
- Use client action id / idempotency key for create-thread and send-message.
- Preserve accepted-message ref/outcome for duplicate requests.
- Handle concurrent duplicate submissions safely.
Acceptance criteria
- Duplicate send returns the same accepted ref/outcome.
- Concurrent duplicate send creates at most one accepted message/turn.
- Failed validation does not create a ghost turn/message.
- Retry after transient unavailable state has deterministic behavior.
- Tests cover same-thread duplicate, cross-thread duplicate rejection, and concurrent duplicate behavior.
Interface
No new interfaces are introduced.
- Assistant
Exploring the codebase for WebUI mutation flows and any existing idempotency patterns.
- Assistant
Implementing a WebUI accepted-message ledger, fixing caller-scoped idempotency (not thread-scoped), and adding the required contract tests.
- Assistant
Refactoring the ledger to use explicit release instead of Drop with
tokio::spawn. - Assistant
Updating
reborn_services.rsto integrate the ledger and fix idempotency bindings. - Assistant
Adding contract tests to
reborn_services_contract.rs. - Assistant
Implemented WebUI idempotency and an accepted-message ledger in
ironclaw_product_workflow(#3607 / M2).What changed
WebUiAcceptedMessageLedger(src/webui_ledger.rs)- Tracks settled outcomes for
create-threadandsend-messagekeyed by caller +client_action_id - Concurrent duplicates wait on an in-flight reservation instead of creating a second message/turn
- Cross-thread reuse of the same
client_action_idreturns 409 Conflict - Transient failures release the in-flight reservation so retries can proceed deterministically
RebornServicesintegration (src/reborn_services.rs)submit_turn: validates first (no ghost messages), then ledger → thread accept → turn submit → ledger settle
- Tracks settled outcomes for
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.