tractor/ai/prompt-io/opencode/20260818T193004Z_bf06b4f8_p...

1.2 KiB

Prompt

Release caller-side context state for every remote-task startup failure, not only local cancellation. Preserve the remote error, avoid unsafe follow-up sends and prove pre-publication serialization failures leave a reused portal healthy.

Response summary

Extend remote-task startup cleanup across send, acknowledgement and validation errors. Track completed publication, perform only safe best-effort cancellation and deterministically remove local state.

Files changed

  • tractor/runtime/_runtime.py - clean every startup failure path.
  • tests/test_context_stream_semantics.py - cover authorization and serialization failures before context entry.

Human edits

The human accepted the discovered edge-case fixes but required general startup cleanup to land separately from cancellation cleanup, transport integrity and the public API. This boundary preserves that behavioral distinction and its dedicated commit-message rationale.