src/runtime/server.rs:551 tears down a connection by cancelling the connection token and then iterating jobs.list_for_session(&s.session_id, None) to call jobs.cancel for every job from that session. That makes a normal transport drop cancel in-flight work. The behavior contradicts the durable job and resume model described in README.md:105, README.md:117, docs/guides/resume.md:3, and docs/conformance.md:12, and it also makes a reconnect unable to resume a job because the original connection has already fired the cancellation token.
Fix prompt: Separate transport lifetime from job lifetime. On connection close, stop only the per-connection reader, writer, and subscription forwarder tasks, and keep job tasks running unless the client sent session.close or an explicit cancel that is authorized for the job. Add a regression test that starts a long-running tool, drops the transport without sending cancel, reconnects or observes via another authorized session, and verifies that the job reaches its natural terminal state instead of job.cancelled.
src/runtime/server.rs:551tears down a connection by cancelling the connection token and then iteratingjobs.list_for_session(&s.session_id, None)to calljobs.cancelfor every job from that session. That makes a normal transport drop cancel in-flight work. The behavior contradicts the durable job and resume model described inREADME.md:105,README.md:117,docs/guides/resume.md:3, anddocs/conformance.md:12, and it also makes a reconnect unable to resume a job because the original connection has already fired the cancellation token.Fix prompt: Separate transport lifetime from job lifetime. On connection close, stop only the per-connection reader, writer, and subscription forwarder tasks, and keep job tasks running unless the client sent
session.closeor an explicit cancel that is authorized for the job. Add a regression test that starts a long-running tool, drops the transport without sending cancel, reconnects or observes via another authorized session, and verifies that the job reaches its natural terminal state instead ofjob.cancelled.