Skip to content

chore: upgrade copilot-sdk to v1.0.2 and re-bundle embedded CLI to 1.0.64-0 (fixes session.idle hang)#333

Merged
spboyer merged 5 commits into
microsoft:mainfrom
sebastienlevert:chore/bump-copilot-sdk-1.0.2
Jun 18, 2026
Merged

chore: upgrade copilot-sdk to v1.0.2 and re-bundle embedded CLI to 1.0.64-0 (fixes session.idle hang)#333
spboyer merged 5 commits into
microsoft:mainfrom
sebastienlevert:chore/bump-copilot-sdk-1.0.2

Conversation

@sebastienlevert

Copy link
Copy Markdown
Contributor

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.idle hang:

  • github/copilot-sdk #558 — "Timeout waiting for session.idle"
  • github/copilot-sdk #794 — "processQueuedItems lacks error handling → session.idle never emitted"

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)

  • Event model: 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 path and args now flow through Connection: copilot.StdioConnection{Path, Args} (the SDK manages process start/restart).
  • Streaming: SessionConfig/ResumeSessionConfig.Streaming is now *bool (copilot.Bool).
  • Permissions: approval uses the built-in copilot.PermissionHandler.ApproveAll (replaces the removed PermissionRequestResultKindApproved path).
  • ProviderConfig: WireApiWireAPI.
  • Pointer fields: usage/limits became pointers (TotalPremiumRequests, model-metric Requests.Count/Cost, AssistantUsage token 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 in go.mod — bumped embeddedCLIVersion, and removed the old 1.0.49 .zst/.license assets.

Validation

  • go build ./..., go vet ./..., and the full go test ./... suite pass.
  • Built a side binary and confirmed it extracts/runs copilot_1.0.64-0.exe (waza models lists models).
  • Ran a real copilot-sdk eval: a 20-turn agent session completed in ~12s with zero stalls and zero watchdog recoveries — direct evidence the session.idle lifecycle no longer hangs.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…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>
@sebastienlevert sebastienlevert requested a review from spboyer as a code owner June 18, 2026 10:53
Copilot AI review requested due to automatic review settings June 18, 2026 10:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) to event.Type() (method) and adjust event construction to be Data: &copilot.XxxData{...}-driven.
  • Update Copilot client/connection configuration to SDK v1.0.x (ClientOptions.Connection with copilot.StdioConnection) and adopt the built-in PermissionHandler.ApproveAll.
  • Rebundle embedded Copilot CLI binaries/licenses to 1.0.64-0 and 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

Comment thread internal/models/events.go Outdated
sebastienlevert and others added 2 commits June 18, 2026 07:59
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
Copilot AI review requested due to automatic review settings June 18, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@98aa1a3). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #333   +/-   ##
=======================================
  Coverage        ?   75.67%           
=======================================
  Files           ?      161           
  Lines           ?    19440           
  Branches        ?        0           
=======================================
  Hits            ?    14711           
  Misses          ?     3655           
  Partials        ?     1074           
Flag Coverage Δ
go-implementation 75.67% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

sebastienlevert and others added 2 commits June 18, 2026 10:54
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>
Copilot AI review requested due to automatic review settings June 18, 2026 15:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 spboyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean — no issues found. LGTM.

@spboyer spboyer merged commit 8e2c875 into microsoft:main Jun 18, 2026
9 checks passed
@spboyer spboyer mentioned this pull request Jun 18, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants