Expose caller-supplied submissionId for direct agent prompts #474
odysseus0
started this conversation in
Feature Request
Replies: 1 comment
|
Possibly related contribution from @av-x — opened #501 which appears to be addressing this. Their summary: Adds Implementation: argonavis-labs/flue@art/run-5213-client-submission-id (diff) This comment was posted automatically when #501 was redirected. The implementation is preserved on the branch above so it can inform the work here. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
The direct agent prompt APIs appear to generate
submissionIdinside Flue rather than letting the caller provide one.That makes direct prompts hard to use safely from an application authority that needs durable, idempotent admission across retries. The issue is separate from #307: #307 fixed durable user-message replay after a direct prompt is admitted. This request is about exposing the admission identity at the public API boundary so the application can own retry/reconciliation semantics.
Current versions checked:
@flue/sdk,@flue/runtime, and@flue/react1.0.0-beta.9.Distributed-systems failure case
A typical application flow looks like this:
TaskEvent(task.continued, submissionId=sub_123).For this to be safe, the caller needs to retry with the same stable operation identity. If Flue generates
submissionIdonly after the call crosses the boundary, the caller cannot prove whether a retry is the same admission or a new admission. That pushes applications toward duplicate prompts, custom sidecar wrappers, or weaker reconciliation logic.This is the usual at-least-once distributed systems shape: exactly-once delivery is not available across the boundary, so the callee should accept a caller-owned idempotency key / operation identity for the mutation.
Desired behavior
Allow callers to pass an optional
submissionIdthrough direct prompt APIs. If omitted, Flue can keep today’s generated-id behavior.Sketch:
For React, the same should be possible from
sendMessageoptions:Expected semantics:
submissionIdbecomes the canonical submission identity for the direct prompt.submissionIdshould reconcile to the same durable submission/admission rather than create a second logical input.submissionIdis useful because it gives applications a stable correlation/fencing key for reconciliation.submissionIdis omitted, current behavior remains unchanged.Why this matters
Flue already has strong runtime/session machinery. Applications built on top of it still need to coordinate product authority with Flue admission. Without caller-supplied
submissionId, the boundary forces app-level wrappers around direct prompts just to recover from commit-success/response-lost and replacement races.With caller-supplied
submissionId, the clean layering is:Local patch shape that worked for us
We patched the public API and runtime path narrowly:
AgentPromptOptions/ ReactSendMessageOptionsacceptsubmissionId?: string;submissionId;options.submissionId ?? crypto.randomUUID();That was enough for our application boundary to use Flue’s own submission identity instead of inventing a separate wrapper identity.
All reactions