Skip to content

Commit 8e2c875

Browse files
chore: upgrade copilot-sdk to v1.0.2 and re-bundle embedded CLI to 1.0.64-0 (fixes session.idle hang) (#333)
* chore: upgrade copilot-sdk to v1.0.2 and re-bundle embedded CLI to 1.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> * fix: preserve event type for transcript round-trip of uncovered events 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 #333 review comment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test: make hooks context-timeout test deterministic 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> * ci: exclude generated embedded bundler files from codecov 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> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 98aa1a3 commit 8e2c875

30 files changed

Lines changed: 91 additions & 48 deletions

codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Codecov configuration for the Go implementation.
2+
#
3+
# Generated files are excluded from coverage measurement. The
4+
# internal/embedded/zcopilot_*.go files are produced by the copilot-sdk bundler
5+
# ("Code generated by copilot-sdk bundler; DO NOT EDIT.") and contain only
6+
# trivial generated glue (//go:embed directives, an init() that registers the
7+
# embedded CLI, and base64/zstd decode helpers whose panic branches are not
8+
# exercised by tests), so they should not be coverage-gated.
9+
ignore:
10+
- "internal/embedded/zcopilot_*.go"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/Masterminds/semver/v3 v3.4.0
1919
github.com/azure/azure-dev/cli/azd v0.0.0-20260310201311-bf9ff08dc845
2020
github.com/charmbracelet/huh v1.0.0
21-
github.com/github/copilot-sdk/go v1.0.0
21+
github.com/github/copilot-sdk/go v1.0.2
2222
github.com/go-viper/mapstructure/v2 v2.5.0
2323
github.com/klauspost/compress v1.18.3
2424
github.com/mattn/go-runewidth v0.0.21

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/
117117
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
118118
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
119119
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
120-
github.com/github/copilot-sdk/go v1.0.0 h1:spzqYzKv8l3bpeK43jPBtDcI//TSR8rI2ZcUAO/zFN0=
121-
github.com/github/copilot-sdk/go v1.0.0/go.mod h1:I6YKZQzUXhHZd8a2TkSOcBa8FMVL34QiEg2yxiaXghw=
120+
github.com/github/copilot-sdk/go v1.0.2 h1:trjxOqsC9zH4hT1IVQRHwgUcIpIDan6boEEpif/GaXY=
121+
github.com/github/copilot-sdk/go v1.0.2/go.mod h1:I6YKZQzUXhHZd8a2TkSOcBa8FMVL34QiEg2yxiaXghw=
122122
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
123123
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
124124
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=

internal/embedded/path.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"time"
1616
)
1717

18-
const embeddedCLIVersion = "1.0.49"
18+
const embeddedCLIVersion = "1.0.64-0"
1919

2020
var pathOnce = sync.OnceValues(installEmbeddedCLI)
2121

internal/embedded/zcopilot_1.0.49_darwin_amd64.zst

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/embedded/zcopilot_1.0.49_darwin_arm64.zst

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/embedded/zcopilot_1.0.49_linux_amd64.zst

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/embedded/zcopilot_1.0.49_linux_arm64.zst

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/embedded/zcopilot_1.0.49_windows_amd64.exe.zst

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/embedded/zcopilot_1.0.49_windows_arm64.exe.zst

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)