A companion answers for its own session
What changes
- Companions, every runtime: a companion's session is its own when its stored parent is the companion's parent. An answer about one that is not carries
errorDetail.code: 'state_child_session_taken':companion__sendMessage:{ delivered: false, reason: 'child_entry_failed', errorDetail };companion__waitForResultand a blocking park:{ name, status: 'failed', message, errorDetail }(companionWaitResultSchema()'sfailedarm gains an optionalerrorDetail);- a spawn of the name:
{ status: 'not_spawned', reason: 'child_entry_failed', errorDetail }. A live or interrupted ref over it is releasedfailed; a completed ref keeps its word.
- agent-server (breaking): a bound
/resumeof another delegation's session answers 409state_child_session_taken, with or without a request key. It answered 409state_run_start_conflictwithcause: 'child_binding_mismatch'. A/resumewith no binding on a bound session still answerschild_binding_mismatch. The CF Durable Object already answeredstate_child_session_taken. - Remote starts: a keyed, bound
/startwhose dispatch could not be named after its commit answers 503transport_error; a parent re-sends a keyed start's retryabletransport_errorwith the same key, withinKEYED_START_RESENDS, and the repeat is answered from the key.
What to do
- A caller of agent-server's
/resumethat matchedchild_binding_mismatchfor a bound resume of another delegation: matchcode === 'state_child_session_taken'. - Code that reads a companion's failed answers: read
errorDetail?.codeto tell a session that is not the companion's own from a failed child.