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
I'll explore the codebase for WebUI send-message/create-thread flows and any existing idempotency patterns.
- Assistant
Implementing a WebUI accepted-message ledger and fixing idempotency binding so
client_action_idis caller-scoped (enabling cross-thread rejection and safe concurrent handling). - Assistant
Simplifying concurrent-wait logic in the ledger.
- Assistant
Adding cross-thread rejection on ledger replay when the stored outcome targets a different thread.
- Assistant
Implemented WebUI idempotency and an accepted-message ledger in
ironclaw_product_workflow.What changed
Accepted-message ledger (
accepted_message_ledger.rs)- Caller-scoped ledger keyed by
(tenant, user, agent, project, client_action_id) - Tracks in-flight reservations and settled outcomes for
create_threadandsubmit_turn - Concurrent callers wait on the in-flight reservation and replay the settled outcome
RebornServicesupdatessubmit_turnandcreate_threadgo through the ledger before any thread/turn side effects- Validation still runs first (no ghost messages/turns on bad input)
- Idempotency binding is now caller-scoped (
webui_idempotency_binding_id) — separate from thread-scoped turn source bindings
- Caller-scoped ledger keyed by
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.