You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 77f74c8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: contracts/agents-api/harness-onboarding.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ For example, the Codex adapter keeps its app-server and thread, the Claude adapt
63
63
| Interface or contract | Required handling | Obligation |
64
64
| --- | --- | --- |
65
65
|`ExecutorFactory`, `Executor.StartTurn`, `Executor.Close`| Real implementation | Prepare without model input; keep ownership of failed or uncertain resources; confirm cleanup |
66
-
|`Turn`, `Session.Cancel`, `CancellationOutcome`, `AwaitSettlement`| Real implementation | Cancel the exact Turn, keep observed results and confirm settlement independently of cancellation requests |
66
+
|`Session`, `Turn`, `CancellationOutcome`, `AwaitSettlement`| Real implementation | Cancel the exact Turn, keep observed results and confirm settlement independently of cancellation requests |
67
67
|`DurableSteerer`| Real implementation on every Turn | Distinguish a complete write from the native application receipt; keep retry identity |
|`FunctionResultSubmitter`| Explicit implementation or Unsupported | Match native call and result identity and acknowledge application |
@@ -112,7 +112,8 @@ A Session owns one reusable Executor in its connected Runtime; a Turn owns one i
112
112
- An error means settlement is unconfirmed and frees neither ownership nor capacity. Caller deadlines stop the wait, not the tracked cleanup. Retry the same cleanup target serially; a failed cleanup blocks replacement and keeps its resource slot.
113
113
-`Executor.Close` confirms resource retirement independently of the Turn outcome: an immutable Turn error must not prevent closing the native transport once its work and output have stopped.
114
114
- Include owned background work in settlement and keep the exact native cleanup target after a failure. Native termination belongs to the adapter; a bulk cleanup acknowledgement alone does not establish quiescence.
115
-
- The observed cancellation outcome keeps native identity, Usage and output without fabricating missing evidence.
115
+
- Every `Session`, including a direct-call factory result, declares `CancellationOutcome`. `Turn` and `PreparedCancellation` inherit it. The snapshot keeps observed native identity, Usage and output and remains readable after cancellation. Missing evidence stays unset; an empty `DonePayload` means nothing has been observed, not that cancellation succeeded or is unsupported. Reading the snapshot does not wait for settlement.
116
+
- Direct-call `Session.Cancel` requests cancellation; output closure signals teardown. Executable `PreparedCancellation.Cancel` waits for local cleanup and output writes to stop. Turn settlement still requires `AwaitSettlement` and any required `Executor.Close`; neither a successful cancellation request nor its snapshot replaces those waits.
116
117
117
118
**What the Runtime does around a Turn.** One output consumer starts before native Start, drains the bounded 64-frame channel and keeps the terminal observation until Start publication, Turn settlement and admitted operation receipts finish. Natural completion never calls Cancel. Input, function and interaction admission close before settlement; operations already admitted hold their barrier through native receipts and outbound acknowledgement. The Runtime sends cancellation to the Turn before waiting on that barrier, because a written input may need a native interrupt to produce its receipt. It joins native settlement, any required confirmed Executor close, output drain and all admitted operations before an applied acknowledgement or reuse, and only then forwards Done or an applied cancellation receipt. A failed Close can report failure while keeping the same Run and outstanding operations for retry; a closed caller wait cannot manufacture an applied input receipt. The Runtime commits native continuity and releases the old Run's admission before publishing Done, since the receiver may start another Turn at once; a late terminal-send failure belongs to the old Run and cannot invalidate a successor that already owns the Executor. Connection shutdown owns transport-loss cleanup. The settlement wait is ten seconds and the receipt send budget five seconds; a timeout is not proof of quiescence.
0 commit comments