-
Notifications
You must be signed in to change notification settings - Fork 981
Open
Description
Client does not capture CLI stderr, making startup failures opaque
When the CLI process exits during startup, the SDK reports:
panic: process exited unexpectedly
failed to kill CLI process: os: process already finished
There is no indication of why the process exited. The actual error (e.g. version incompatibility, auth failure) is written to stderr, which the SDK never captures.
Cause
client.gonever setsexec.Cmd.Stderr, so CLI stderr is discarded.internal/jsonrpc2/jsonrpc2.gohas a race inSetProcessDone— it copies the process error in a goroutine that can run afterRequest()already checked for it, so even exit code info can be missed.
Suggested fix
- Set
c.process.Stderr = &bytes.Buffer{}and include its contents in the error frommonitorProcess. - In
SetProcessDone, store the error pointer directly instead of copying it asynchronously.
Environment
- SDK:
github.com/github/copilot-sdk/go(source, commit:ea90f076091371810c66d05590f65e2863f79bdf main) - Go: 1.24.5 linux/amd64
- OS: Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 (WSL2)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels