ExperimentalOptionalidempotencyKey?: IdempotencyKeyIdentifies this submission. It is sent as idempotencyKey on
session/prompt.
Create one key when the user submits the input, for example with
crypto.randomUUID(), and store it with the pending input. Send the same
key on every attempt for that submission. While the agent recognizes the
key, a retry inserts no second user message and is answered with the
messageId of the message already inserted. An error response leaves the
key unused.
The agent recognizes a key for as long as it retains the inserted
message. For a message it does not retain, such as a locally handled
command, it may forget the key once the session is no longer active on a
connection. A prompt with a forgotten key is a new submission, and a
successful session/resume does not show which keys survived. After a
lost connection, do not resend an unanswered prompt automatically when a
duplicate would matter and you cannot rule one out. Tell the user that
the prompt might already have run and let them decide whether to retry.
The key is a string of 1 to 255 characters. Use a new key for a new submission. Do not send a key with a different prompt, derive it from the prompt's content, or put sensitive data in it. Without a key, sending the prompt again can insert a second user message.
Experimental draft ACP v2 options for
ActiveSession.prompt(...).