Support VS Code-compatible Copilot hook payloads#888
Draft
peyton-alt wants to merge 2 commits intomainfrom
Draft
Support VS Code-compatible Copilot hook payloads#888peyton-alt wants to merge 2 commits intomainfrom
peyton-alt wants to merge 2 commits intomainfrom
Conversation
Entire-Checkpoint: 8a4fafbfc826
Entire-Checkpoint: 73d1f5733517
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a compatibility layer so Entire can parse and handle VS Code (Insiders) Copilot hook payloads that differ slightly from Copilot CLI, preventing hard failures and preserving session/checkpoint tracking.
Changes:
- Introduces a normalized “hook envelope” parser that accepts alternate timestamp and transcript path formats.
- Updates Copilot CLI lifecycle hook parsing to consume the normalized envelope.
- Adds unit + integration tests covering VS Code-shaped payloads and generated
.github/hooks/entire.jsoncommands.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/integration_test/hooks.go | Extends integration hook runner to execute agent-specific hooks and to execute generated shell hook commands. |
| cmd/entire/cli/integration_test/copilot_vscode_hooks_test.go | Adds integration coverage for VS Code-compatible Copilot hook payloads and generated hook commands. |
| cmd/entire/cli/agent/copilotcli/lifecycle.go | Switches Copilot lifecycle parsing to read from a normalized hook envelope (incl. timestamp/transcript variants). |
| cmd/entire/cli/agent/copilotcli/lifecycle_test.go | Adds unit tests for VS Code-shaped payload parsing across lifecycle events and pass-through hooks. |
| cmd/entire/cli/agent/copilotcli/compat.go | Adds hook payload normalization (host detection, alternate keys, timestamp parsing). |
| cmd/entire/cli/agent/copilotcli/compat_test.go | Adds focused unit tests for host detection and envelope parsing of alternate fields. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VS Code Insiders can auto-load
.github/hooks/entire.json, but its Copilot hook payload shape differs slightly from Copilot CLI. Entire was hard-failing on those differences, which surfaced as hook warnings in VS Code.This change adds compatibility parsing for Copilot-like hook payloads so Entire continues to track sessions and checkpoints when VS Code invokes the same hook file.
What changed
timestamptranscriptPathandtranscript_pathcopilot-clihook commands and generated.github/hooks/entire.jsoncommandsVerification
go test ./cmd/entire/cli/agent/copilotcli -run 'TestDetectHookHost|TestParseHookEnvelope_AcceptsAlternateTranscriptPathAndTimestampFormats|TestParseHookEvent_.*VSCode|TestParseHookEvent_PassthroughHooks_VSCodePayload_ReturnNil' -count=1go test -tags=integration ./cmd/entire/cli/integration_test -run 'TestCopilotVSCodeHooks_' -count=1mise run test:ciUser impact
Note
Medium Risk
Moderate risk because it changes Copilot hook input parsing and event timestamps/session refs, which directly affects session tracking and checkpoint creation; coverage is added via unit and integration tests to reduce regressions.
Overview
Copilot hook payload parsing is now schema-tolerant. The Copilot agent introduces a normalized
hookEnvelopethat can parse both Copilot CLI and VS Code hook shapes, includingtimestampas either millis or RFC3339 string and transcript path astranscriptPathortranscript_path.Lifecycle event parsing is updated to use the envelope. Copilot lifecycle handlers now read raw stdin once, populate
Event.Timestampfrom the incoming payload (falling back totime.Now()), and prefer the provided transcript path (only computing it fromsessionIdwhen missing).Test coverage expands for VS Code invocations. Adds unit tests for host detection/envelope parsing and lifecycle parsing with VS Code payloads, plus integration tests that run both direct
entire hooks copilot-cli ...and generated.github/hooks/entire.jsonshell commands to ensure sessions/checkpoints are still created.Reviewed by Cursor Bugbot for commit a54f070. Configure here.