fix: require idle workers for submit

This commit is contained in:
2026-09-23 00:36:54 +09:00
parent d8444e49bd
commit 9857bf04f7
16 changed files with 451 additions and 264 deletions
+9 -4
View File
@@ -205,7 +205,9 @@ impl From<WorkerStatus> for WorkerStateSnapshot {
#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
#[serde(tag = "method", content = "params", rename_all = "snake_case")]
pub enum Method {
/// Durably accept typed input for immediate activation or the session FIFO.
/// Durably accept typed input for immediate activation while the Worker is Idle.
/// Running or Paused Workers reject Submit; use Notify for advisory information
/// that should be incorporated into work already in progress.
///
/// `submission_request_id` is generated by the authenticated caller and is
/// used only for idempotent retry. Worker allocates the durable
@@ -724,6 +726,8 @@ pub enum ToolResultDisposition {
#[serde(rename_all = "snake_case")]
pub enum SubmissionDisposition {
Started,
/// Compatibility value for durable receipts created before Submit became
/// Idle-only. New submissions are never accepted with this disposition.
Queued,
}
@@ -859,9 +863,10 @@ pub struct SessionToolAttachment {
#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
#[serde(tag = "event", content = "data", rename_all = "snake_case")]
pub enum Event {
/// Durable Submit acceptance. A `Queued` receipt follows the durable FIFO
/// checkpoint. A `Started` receipt follows the pending activation checkpoint;
/// the corresponding [`Event::UserMessage`] marks the later history commit.
/// Durable Submit acceptance. New submissions are accepted only while Idle,
/// and a `Started` receipt follows the pending activation checkpoint; the
/// corresponding [`Event::UserMessage`] marks the later history commit.
/// `Queued` remains readable for receipts persisted by older runtimes.
/// Repeating the same request id and exact payload returns the same receipt
/// without appending or activating twice.
SubmissionAccepted {