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 WebUI inbound flow and any existing idempotency patterns so we can add an accepted-message ledger.
- Assistant
Implementing user-scoped idempotency binding (excluding thread) and adding the missing contract tests.
- Assistant
Adding contract tests for idempotency behavior.
- Assistant
Implemented WebUI idempotency and accepted-message ledger behavior in
RebornServices.Changes
reborn_services.rs- Split binding IDs:
webui_idempotency_binding_id— user-scoped (tenant + agent + actor), used as the accepted-message ledger key withclient_action_idwebui_reply_binding_id— thread-scoped, used for reply routing
- Replay safety: if a ledger replay targets a different thread than the request, return
409 Conflictinstead of creating a second message/turn - Send flow:
accept_inbound_messagestores idempotency under the user-scoped binding; turn submission still usesclient_action_idas the turn idempotency key
reborn_services_contract.rs— new/updated testsTest Covers duplicate_submit_on_same_thread_replays_same_accepted_message_refSame-thread duplicate returns same ref cross_thread_duplicate_client_action_id_is_rejectedCross-thread duplicate → 409, no ghost message concurrent_duplicate_submit_creates_at_most_one_message_and_turn8 concurrent submits → 1 message, 1 turn retry_after_transient_unavailable_reuses_accepted_message_and_idempotency_keyTransient failure then retry reuses accepted message validation_errors_are_stable_and_sanitizedValidation failure creates no turn submission create_threadidempotency was already handled via deterministic thread ID generation fromclient_action_id.Behavior summary
- Duplicate send (same thread): replays
AlreadySubmittedwith the same accepted ref/outcome - Concurrent duplicate: thread-service mutex + turn idempotency → at most one accepted message/turn
- Cross-thread same
client_action_id: rejected with conflict - Validation failure: rejected before thread/turn mutation
- Transient unavailable: message accepted once; retry reuses it and the same idempotency key
All
ironclaw_product_workflowtests pass; clippy is clean. - Split binding IDs:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →