Skip to content

Comments

chore: sync upstream main (29 commits)#538

Closed
yazelin wants to merge 28 commits intogithub:mainfrom
yazelin:upstream-sync/test-merge-20260223
Closed

chore: sync upstream main (29 commits)#538
yazelin wants to merge 28 commits intogithub:mainfrom
yazelin:upstream-sync/test-merge-20260223

Conversation

@yazelin
Copy link

@yazelin yazelin commented Feb 23, 2026

Summary

  • Sync with upstream github/copilot-sdk main branch (29 new commits)
  • No merge conflicts — all 3 overlapping files (client.ts, types.ts, client.test.ts) merged cleanly
  • TypeScript compilation passes, all 80 unit tests pass

Notable upstream changes

Breaking Change

  • Deny all permissions by default (Breaking change: deny all permissions by default #509) — requestPermission is now always true in Copilot protocol. No impact on ACP: our ACP adapter already had deny-by-default behavior via outcome: "cancelled" in handleAcpPermissionRequest()

New Features

Fixes

Docs

  • New setup guides: GitHub OAuth, BYOK, Azure Managed Identity, bundled CLI, scaling

Test plan

  • git merge-tree confirms no conflicts
  • TypeScript tsc --noEmit passes
  • All 80 unit tests pass (including new upstream clientName tests)
  • CI pipeline passes
  • ACP E2E tests pass (manual, requires ACP CLI)

🤖 Generated with Claude Code

yazelin and others added 28 commits February 5, 2026 13:46
Enable direct connection to ACP-compatible agents (e.g., Gemini CLI)
without requiring a protocol translation proxy.

- Add protocol adapter abstraction layer
- Implement NDJSON transport for ACP wire format
- Translate Copilot SDK methods to ACP: ping→initialize,
  session.create→session/new, session.send→session/prompt
- Map ACP session/update notifications to SessionEvent format
- Add 'protocol' option to CopilotClientOptions ("copilot" | "acp")
- Include comprehensive unit tests and e2e tests

Usage:
```typescript
const client = new CopilotClient({
  cliPath: "gemini",
  cliArgs: ["--experimental-acp"],
  protocol: "acp"
});
```
Gemini returns stopReason in the session/prompt response instead of
sending a separate end_turn notification. Emit session.idle event
when stopReason is "end_turn" to properly signal turn completion.

Changes:
- Add stopReason to AcpSessionPromptResult type definition
- Emit session.idle via queueMicrotask when stopReason is "end_turn"
- Add unit test for stopReason handling
Implement support for ACP tool calls and permission requests:

- Add types for tool_call, tool_call_update, and permission requests
- Map ACP tool_call to tool.execution_start event
- Map ACP tool_call_update to tool.execution_progress/complete events
- Handle session/request_permission requests from ACP server
- Add sendResponse and onRequest to AcpTransport for server requests
- Remove tool.call and permission.request from unsupported methods

Tests: 53 passing (21 mapper + 17 transport + 15 adapter)
- Add test for receiving tool events when agent uses tools
- Add test for tool.execution_start and tool.execution_complete events
- Tests prompt Gemini to read files/list directory to trigger tool usage
- Tests are skipped when ACP_CLI_PATH is not set
The Node.js process would hang after calling client.stop() because
the child process streams (stdin, stdout, stderr) were not properly
cleaned up.

Changes:
- Store bound event handlers for proper removal on cleanup
- Remove all event listeners from streams before closing
- Call destroy() on stdin/stdout/stderr to properly close pipes
- Clean up both in stop() and forceStop() methods

This ensures the Node.js event loop can exit normally without
requiring process.exit() in user code.
JSON-RPC errors may include a 'data' field with additional details.
Now the error message includes this data, e.g.:
  Before: 'Internal error'
  After:  'Internal error: {"details":"Requested entity was not found."}'
Registers handlers for exit, SIGINT, and SIGTERM to ensure
the gemini child process is killed when Node.js exits unexpectedly.
Gemini expects env as array of "KEY=value" strings, not object.
Also ensure args and env are always present (empty array if not set).
Gemini only sends agent_message_chunk (message_delta), never the
complete agent_message. Accumulate delta content per session and
emit a synthesized assistant.message event before session.idle.

This fixes sendAndWait() returning undefined in ACP mode.
- Implement applySessionConfig in ACP adapter to auto-call session/set_model
  after session/new when model is specified in createSession()
- Add AcpSetModelParams/Result and AcpSetModeParams/Result types
- Add upstream-sync GitHub Action for daily sync with ACP file protection
- Fix mockProcess missing removeAllListeners in adapter tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge ACP protocol support to main
Fork repos have restricted GITHUB_TOKEN permissions that prevent
creating pull requests. Use a Personal Access Token (PAT) stored
in repo secrets instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GitHub needs time to index a newly pushed branch before
gh pr create can reference it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add sleep after push for branch indexing
…ssion/set_model

session/set_model was a Gemini-specific method not part of the ACP spec.
The standard method is session/set_config_option with configId + value params.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use standard ACP session/set_config_option
@yazelin yazelin requested a review from a team as a code owner February 23, 2026 06:27
@yazelin yazelin closed this Feb 23, 2026
@yazelin yazelin deleted the upstream-sync/test-merge-20260223 branch February 23, 2026 06:35
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.

1 participant