Go Copilot SDK v1.0.9: session/client teardown is not caller-deadline-bounded after SendAndWait cancellation
#209829
Replies: 2 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
I went through the Go source on main (v1.0.19) and your points 2 and 3 still hold there. The escape hatch the SDK documents is in the The catch is that Per worker it'd look roughly like this: abortCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
_ = session.Abort(abortCtx)
cancel()
done := make(chan error, 1)
go func() { done <- session.Disconnect() }()
select {
case <-done:
case <-time.After(10 * time.Second):
client.ForceStop()
}The leaked For an actual fix (a ctx-aware |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Copilot SDK
Body
We encountered a substantial deadline overrun in a concurrent review application using the Go Copilot SDK. Workers had 300-second deadlines, but some recorded execution durations reached approximately 1,732 seconds. The overall invocation took 29 minutes before returning a technical failure.
Our investigation identified SDK lifecycle behavior that prevents the application from guaranteeing bounded cleanup using its current integration. We are not claiming that these source observations conclusively explain every minute of the production overrun; we would appreciate help establishing the supported cancellation/shutdown contract.
Environment
github.com/github/copilot-sdk/gov1.0.9gpt-5.6-sol, high reasoning effortOne SDK client is shared across isolated worker sessions.
Observed production failure
Exactly one authorized review ran on October 7, 2026:
2026-10-07T16:33:31.1596500-04:002026-10-07T17:02:40.1259785-04:001748.9599613secondssession.idle, followed bycontext deadline exceeded2026-10-07T20:38:46.2575066Z36fe9d92-32ef-48cd-8817-dabbd6764581Representative error:
Four classifier sessions completed. The subsequent review phase recorded three completed, nine failed, and eight canceled tasks. Seven canceled tasks never started. No second attempts or throttle retries occurred.
Some workers returned after approximately 350–356 seconds; others recorded durations around 1,732 seconds despite their 300-second deadlines.
Seven completed raw worker submissions survived. The application failed closed and did not produce an authoritative review result.
SDK lifecycle findings
Relevant pinned source:
Our investigation found:
Session.SendAndWaitcancellation stops waiting but does not abort agent work. The SDK documentation explicitly describes this distinction. Applications therefore need a separate cancellation/abort step.Session.Disconnectuses a background context for session destruction. The application's expired worker context does not bound that cleanup operation.Client.Stopdisconnects sessions before reaching its runtime-shutdown timeout. Consequently, that shutdown timeout does not bound the preceding session-disconnection phase.ForceStopthat resolves these boundaries while preserving correct lifecycle handling.Our previous application cleanup deferred
DisconnectafterSendAndWait. It explicitly aborted retryable throttle failures, but not ordinary deadline/cancellation failures. We recognize that as an application-side gap and are addressing it with a fresh, bounded abort context and explicit cleanup diagnostics.However, bounding an abort attempt does not by itself bound subsequent context-free cleanup.
Evidence limitations
We retained the full failed run, worker diagnostics, schedules, partial outputs, and SDK session metadata.
External-tool request/completion metadata pairs were present, but we do not have a raw transport RPC trace. Tool-completion metadata is not proof that every SDK reply or destruction RPC completed.
We therefore cannot yet distinguish conclusively between:
No live throttling was observed. We are not treating these deadline failures as evidence of throttling.
Suggested deterministic reproduction
Please validate this without model inference using a controlled JSON-RPC peer:
session.send.session.idleuntil the caller’s short deadline expires.Session.Disconnectand subsequentlyClient.Stopreturn within a caller-controlled bound.This is a proposed isolation procedure, not a claim that a completed standalone reproducer is already attached.
Requested SDK guidance or fix
Please clarify or provide:
SendAndWaitdeadline/cancellation;If a newer SDK already addresses these boundaries, please identify the relevant release and supported migration path.
The confirmed lifecycle observations concern the Go Copilot SDK integration. We do not have evidence that every Copilot language SDK—or unrelated application distributions—has the same defect.
All reactions