chore: upgrade copilot-sdk to v1.0.2 and re-bundle embedded CLI to 1.0.64-0 (fixes session.idle hang)#333
Conversation
…0.64-0
Upgrades the embedded GitHub Copilot SDK from v0.3.0 to v1.0.2 (GA) and
re-bundles the embedded Copilot CLI from 1.0.49 to 1.0.64-0, which ships
the fix for the tracked session.idle hang (copilot-sdk #558 "Timeout
waiting for session.idle" and #794 "processQueuedItems lacks error
handling -> session.idle never emitted"). Previously sessions could wedge
mid-turn with no output, recovered only by waza's external watchdog.
SDK v1.0.x migration:
- SessionEvent.Type is now a method Type() derived from the Data field;
events are constructed via Data: &copilot.XxxData{} and read with Type().
- ClientOptions dropped CLIArgs/CLIPath/AutoStart/AutoRestart; CLI args and
path now flow through Connection: copilot.StdioConnection{Path, Args}.
- SessionConfig/ResumeSessionConfig.Streaming is now *bool (copilot.Bool).
- Permission approval uses the built-in copilot.PermissionHandler.ApproveAll
(replaces the removed PermissionRequestResultKindApproved path).
- ProviderConfig.WireApi renamed to WireAPI.
- Usage/limits fields became pointers (TotalPremiumRequests, ModelMetric
Requests Count/Cost, AssistantUsage token counts, MaxContextWindowTokens).
Validated: go build/vet/test all pass; a real copilot-sdk eval completed a
20-turn agent session in ~12s with zero stalls or watchdog recoveries.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR upgrades the GitHub Copilot SDK to v1.0.2 and re-bundles the embedded Copilot CLI to 1.0.64-0, updating waza’s Copilot integration code to the SDK v1.0.x event model (notably SessionEvent.Type() and pointer-based usage/limits fields) and refreshing embedded platform assets.
Changes:
- Migrate session event handling from
event.Type(field) toevent.Type()(method) and adjust event construction to beData: &copilot.XxxData{...}-driven. - Update Copilot client/connection configuration to SDK v1.0.x (
ClientOptions.Connectionwithcopilot.StdioConnection) and adopt the built-inPermissionHandler.ApproveAll. - Rebundle embedded Copilot CLI binaries/licenses to
1.0.64-0and update module deps (go.mod/go.sum).
Show a summary per file
| File | Description |
|---|---|
| internal/webapi/store.go | Use TranscriptEvent.Type() when mapping transcript events for the web API |
| internal/webapi/additional_test.go | Update test events to SDK v1-style Data-driven type derivation |
| internal/utils/logging.go | Switch logging to event.Type() and keep structured fields consistent |
| internal/utils/logging_test.go | Update tests to construct events via Data instead of Type |
| internal/utils/copilot_log_iterator_test.go | Update iterator tests to assert on Type() |
| internal/orchestration/runner_orchestration_test.go | Adjust expected transcript event typing to Type() |
| internal/models/events.go | Update transcript JSON marshaling to Type() and adjust tool-call filtering to evt.Type() |
| internal/models/events_test.go | Update transcript event tests for v1 event typing model (Type()) |
| internal/graders/prompt_grader_test.go | Remove v0-era client option usage (AutoStart) in tests |
| internal/graders/inline_script_grader_test.go | Remove direct Type: assignment in test event literals |
| internal/execution/session_usage_collector.go | Handle pointer-based usage/limits fields and switch on event.Type() |
| internal/execution/session_usage_collector_test.go | Update usage collector tests for pointer-based SDK fields and Data-driven types |
| internal/execution/session_events_collector.go | Switch event routing to event.Type() (v1 SDK model) |
| internal/execution/session_events_collector_test.go | Remove explicit Type: assignment in collector tests |
| internal/execution/sdkclient.go | Migrate client options to Connection: copilot.StdioConnection{Path, Args} |
| internal/execution/sdkclient_test.go | Update expectations to read Path/Args from ClientOptions.Connection |
| internal/execution/engine.go | Use evt.Type() when extracting assistant messages |
| internal/execution/engine_response_test.go | Update response test events to be Data-constructed |
| internal/execution/copilot.go | Migrate provider config (WireAPI), permissions (ApproveAll), and streaming (copilot.Bool) |
| internal/execution/copilot_test.go | Validate SDK’s ApproveAll decision shape (rpc decision type) |
| internal/execution/copilot_engine_test.go | Update tests for *bool streaming and connection-carried CLI args |
| internal/embedded/zcopilot_windows_arm64.go | Point embeds/hashes/version to 1.0.64-0 (windows arm64) |
| internal/embedded/zcopilot_windows_amd64.go | Point embeds/hashes/version to 1.0.64-0 (windows amd64) |
| internal/embedded/zcopilot_linux_arm64.go | Point embeds/hashes/version to 1.0.64-0 (linux arm64) |
| internal/embedded/zcopilot_linux_amd64.go | Point embeds/hashes/version to 1.0.64-0 (linux amd64) |
| internal/embedded/zcopilot_darwin_arm64.go | Point embeds/hashes/version to 1.0.64-0 (darwin arm64) |
| internal/embedded/zcopilot_darwin_amd64.go | Point embeds/hashes/version to 1.0.64-0 (darwin amd64) |
| internal/embedded/zcopilot_1.0.64-0_windows_arm64.exe.zst | Add embedded CLI binary asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.64-0_windows_arm64.exe.license | Add embedded CLI license text |
| internal/embedded/zcopilot_1.0.64-0_windows_amd64.exe.zst | Add embedded CLI binary asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.64-0_windows_amd64.exe.license | Add embedded CLI license text |
| internal/embedded/zcopilot_1.0.64-0_linux_arm64.zst | Add embedded CLI binary asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.64-0_linux_arm64.license | Add embedded CLI license text |
| internal/embedded/zcopilot_1.0.64-0_linux_amd64.zst | Add embedded CLI binary asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.64-0_linux_amd64.license | Add embedded CLI license text |
| internal/embedded/zcopilot_1.0.64-0_darwin_arm64.zst | Add embedded CLI binary asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.64-0_darwin_arm64.license | Add embedded CLI license text |
| internal/embedded/zcopilot_1.0.64-0_darwin_amd64.zst | Add embedded CLI binary asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.64-0_darwin_amd64.license | Add embedded CLI license text |
| internal/embedded/zcopilot_1.0.49_windows_arm64.exe.zst | Remove old embedded CLI asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.49_windows_amd64.exe.zst | Remove old embedded CLI asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.49_linux_arm64.zst | Remove old embedded CLI asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.49_linux_amd64.zst | Remove old embedded CLI asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.49_darwin_arm64.zst | Remove old embedded CLI asset pointer (LFS) |
| internal/embedded/zcopilot_1.0.49_darwin_amd64.zst | Remove old embedded CLI asset pointer (LFS) |
| internal/embedded/path.go | Bump embeddedCLIVersion constant to 1.0.64-0 |
| go.sum | Update dependency checksums for copilot-sdk v1.0.2 |
| go.mod | Bump github.com/github/copilot-sdk/go from v0.3.0 to v1.0.2 |
| cmd/waza/newtask/converters.go | Update log-to-task conversion to switch on e.Type() |
| cmd/waza/cmd_run_suggest.go | Update transcript/type summarization to use evt.Type() / evt.Type() |
| cmd/waza/cmd_run_suggest_test.go | Update tests to build events via Data and assert Type() behavior |
| cmd/waza/cmd_models.go | Handle pointer MaxContextWindowTokens from SDK v1 |
| cmd/waza/cmd_models_test.go | Update limits to use copilot.Int(...) pointers |
Copilot's findings
Files not reviewed (4)
- internal/embedded/zcopilot_darwin_amd64.go: Generated file
- internal/embedded/zcopilot_darwin_arm64.go: Generated file
- internal/embedded/zcopilot_linux_amd64.go: Generated file
- internal/embedded/zcopilot_linux_arm64.go: Generated file
- Files reviewed: 42/53 changed files
- Comments generated: 1
TranscriptEvent.UnmarshalJSON reconstructs SessionEvent.Data via transcriptData, whose default case wrapped the payload in RawSessionEventData without setting EventType. Since RawSessionEventData.Type() returns exactly that field, every event kind without a dedicated Data struct (session.start/idle/shutdown, assistant.turn_start/turn_end/usage, etc.) round-tripped to Type() == "", losing the type. The web API mapTranscriptEvents relies on Type(), so stored transcripts surfaced empty/incorrect event types. Set EventType in copilotevents.RawData so Type() round-trips for all event kinds, and add a regression test covering session.idle/shutdown and assistant.usage. Addresses PR microsoft#333 review comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…k-1.0.2 # Conflicts: # go.mod # go.sum # internal/copilotevents/events.go # internal/execution/copilot.go # internal/execution/copilot_engine_test.go # internal/execution/copilot_test.go # internal/execution/engine.go # internal/execution/engine_response_test.go # internal/execution/sdkclient.go # internal/execution/sdkclient_test.go # internal/execution/session_events_collector.go # internal/execution/session_usage_collector.go # internal/execution/session_usage_collector_test.go # internal/models/events.go # internal/utils/logging_test.go
There was a problem hiding this comment.
Copilot's findings
Files not reviewed (6)
- internal/embedded/zcopilot_darwin_amd64.go: Generated file
- internal/embedded/zcopilot_darwin_arm64.go: Generated file
- internal/embedded/zcopilot_linux_amd64.go: Generated file
- internal/embedded/zcopilot_linux_arm64.go: Generated file
- internal/embedded/zcopilot_windows_amd64.go: Generated file
- internal/embedded/zcopilot_windows_arm64.go: Generated file
- Files reviewed: 15/28 changed files
- Comments generated: 0 new
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #333 +/- ##
=======================================
Coverage ? 75.67%
=======================================
Files ? 161
Lines ? 19440
Branches ? 0
=======================================
Hits ? 14711
Misses ? 3655
Partials ? 1074
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TestExecute_ContextTimeout used context.WithTimeout(1ms)+Sleep(5ms), which races the deadline-timer goroutine: on a loaded runner Execute could observe ctx.Err()==nil, run the hook, and swallow the resulting deadline error as a non-fatal WARN (ErrorOnFail defaults false), so the test saw nil and failed (intermittently on windows-latest CI). Use a deadline already in the past so WithDeadline cancels synchronously (dur <= 0), keeping the timeout-path coverage without the timer race. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov flagged 0% patch coverage on internal/embedded/zcopilot_linux_amd64.go,
whose only uncovered lines are the panic branches of the generated base64/zstd
decode helpers. These zcopilot_*.go files are produced by the copilot-sdk
bundler ("DO NOT EDIT") and contain only trivial generated glue, so they should
not be coverage-gated. Add a codecov.yml ignore entry for them (validated via
codecov/validate).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot's findings
Files not reviewed (6)
- internal/embedded/zcopilot_darwin_amd64.go: Generated file
- internal/embedded/zcopilot_darwin_arm64.go: Generated file
- internal/embedded/zcopilot_linux_amd64.go: Generated file
- internal/embedded/zcopilot_linux_arm64.go: Generated file
- internal/embedded/zcopilot_windows_amd64.go: Generated file
- internal/embedded/zcopilot_windows_arm64.go: Generated file
- Files reviewed: 17/30 changed files
- Comments generated: 0 new
spboyer
left a comment
There was a problem hiding this comment.
Clean — no issues found. LGTM.
Summary
Upgrades the embedded GitHub Copilot SDK from v0.3.0 → v1.0.2 (GA) and re-bundles the embedded Copilot CLI from 1.0.49 → 1.0.64-0, which ships the fix for the tracked
session.idlehang:Before this, sessions could wedge mid-turn with no output and were recovered only by waza's external watchdog. The embedded CLI bump is what actually ships the runtime fix.
SDK v1.0.x migration (breaking changes ported)
SessionEvent.Typeis now a methodType()derived from theDatafield. Events are constructed viaData: &copilot.XxxData{}and read withType().CLIArgs/CLIPath/AutoStart/AutoRestart; CLI path and args now flow throughConnection: copilot.StdioConnection{Path, Args}(the SDK manages process start/restart).SessionConfig/ResumeSessionConfig.Streamingis now*bool(copilot.Bool).copilot.PermissionHandler.ApproveAll(replaces the removedPermissionRequestResultKindApprovedpath).WireApi→WireAPI.TotalPremiumRequests, model-metricRequests.Count/Cost,AssistantUsagetoken counts,ModelLimits.MaxContextWindowTokens).Embedded CLI re-bundle
Regenerated all 6 platform assets via the SDK bundler (
internal/embedded/generate) — the CLI version (1.0.64-0) is auto-detected from the copilot-sdk version ingo.mod— bumpedembeddedCLIVersion, and removed the old 1.0.49.zst/.licenseassets.Validation
go build ./...,go vet ./..., and the fullgo test ./...suite pass.copilot_1.0.64-0.exe(waza modelslists models).copilot-sdkeval: a 20-turn agent session completed in ~12s with zero stalls and zero watchdog recoveries — direct evidence thesession.idlelifecycle no longer hangs.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com