Repo/version: github/copilot-sdk, tag rust/v1.0.14 (e60d903); CLI runtime cli-1.0.84-5.
Behaviour: With a SessionFsProvider bound on the client, session.create never returns. The CLI issues sessionFs.* requests during create; nothing on the client side answers them yet, so the RPC waits forever (RpcSessionFs carries no request timeout).
Cause: start_prepared_create (rust/src/session.rs:1167) sends the session.create RPC (call_with_inline_callback, :1394) before it spawns the event loop (spawn_event_loop, :1419) that dispatches inbound sessionFs.* requests. session.resume spawns its event loop before its RPC (:1636) and does not hang.
Fix shape: Spawn the event loop for the non-cloud create arm before the RPC, as resume does. The inline stash grows from (SessionId, SessionRegistration) to (SessionId, Option<SessionChannels>, RegistrationToken) so the early loop takes the channels while the cancel-safety guard keeps the token. The existing guard cancels shutdown on every early return and the loop exits on shutdown.cancelled(), so no extra abort plumbing is needed.
Regression test: bind a provider, drive create against a scripted CLI that issues sessionFs.stat during create, assert create completes within a bounded timeout. Must time out on current code.
Downstream: a consumer of this crate carries a local patch for this and cannot drop it until it is fixed upstream.
Repo/version:
github/copilot-sdk, tagrust/v1.0.14(e60d903); CLI runtimecli-1.0.84-5.Behaviour: With a
SessionFsProviderbound on the client,session.createnever returns. The CLI issuessessionFs.*requests during create; nothing on the client side answers them yet, so the RPC waits forever (RpcSessionFscarries no request timeout).Cause:
start_prepared_create(rust/src/session.rs:1167) sends thesession.createRPC (call_with_inline_callback, :1394) before it spawns the event loop (spawn_event_loop, :1419) that dispatches inboundsessionFs.*requests.session.resumespawns its event loop before its RPC (:1636) and does not hang.Fix shape: Spawn the event loop for the non-cloud create arm before the RPC, as resume does. The inline stash grows from
(SessionId, SessionRegistration)to(SessionId, Option<SessionChannels>, RegistrationToken)so the early loop takes the channels while the cancel-safety guard keeps the token. The existing guard cancelsshutdownon every early return and the loop exits onshutdown.cancelled(), so no extra abort plumbing is needed.Regression test: bind a provider, drive create against a scripted CLI that issues
sessionFs.statduring create, assert create completes within a bounded timeout. Must time out on current code.Downstream: a consumer of this crate carries a local patch for this and cannot drop it until it is fixed upstream.