feat: port upstream v0.1.31–v0.1.32 features#48
Merged
Conversation
Add 4 features from upstream copilot-sdk: - :agent param in create-session/resume-session for pre-selecting custom agents (upstream PR #722) - :on-list-models handler in client options for BYOK custom model listing, bypasses RPC with same promise-based cache (upstream PR #730) - log! session method for timeline logging via session.log RPC with level and ephemeral options (upstream PR #737) - :is-child-process? client option for child process mode connecting via stdio to parent CLI process (upstream PR #737) Version bumped to 0.1.32.0. All 93 tests (315 assertions) pass, docs valid, all examples green, JAR builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Ports upstream @github/copilot-sdk v0.1.31–v0.1.32 features into the Clojure SDK, extending client/session configuration and adding a new session logging API while keeping specs, docs, and tests in sync.
Changes:
- Add
:agentsupport in session create/resume configs and forward it on the wire. - Add
:is-child-process?client option (parent-stdio transport) and:on-list-modelshandler to bypass/cached model listing. - Add
log!session API backed by"session.log"RPC, with spec + doc updates and new integration/mock coverage.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/github/copilot_sdk/client.clj |
Adds :is-child-process? validation/connection path and :on-list-models handler-backed caching for list-models. |
src/github/copilot_sdk/session.clj |
Adds log! session method calling "session.log" and returning an event id. |
src/github/copilot_sdk.clj |
Public API wrapper for log!. |
src/github/copilot_sdk/specs.clj |
Adds specs/closed-keys updates for :agent, :is-child-process?, :on-list-models, and log! options. |
src/github/copilot_sdk/instrument.clj |
Instruments the new session/log! public API with an s/fdef. |
test/github/copilot_sdk_test.clj |
Adds client option spec assertions and mutual-exclusion/requirement tests for :is-child-process?. |
test/github/copilot_sdk/mock_server.clj |
Adds mock handling for "session.log". |
test/github/copilot_sdk/integration_test.clj |
Adds integration coverage for :on-list-models, log!, and :agent wire forwarding. |
doc/reference/API.md |
Documents new client options and adds log! API reference section. |
CHANGELOG.md |
Adds Unreleased entries for the ported upstream features. |
build.clj |
Bumps project version to 0.1.32.0. |
README.md |
Updates dependency version to 0.1.32.0. |
Prevents proto/disconnect from closing the JVM's global System/in and System/out when tearing down a child-process connection. Uses FilterInputStream/FilterOutputStream proxies with no-op close(). Addresses review feedback on PR #48. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Sanitize ex-info data in is-child-process? validations to avoid leaking :github-token (only include relevant keys) - Flush wrapped OutputStream on close instead of pure no-op, ensuring buffered bytes are sent before disconnect - Tighten log! return spec from nilable to required ::event-id since the RPC contract guarantees eventId Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Port 4 features from upstream copilot-sdk (v0.1.31–v0.1.32) to the Clojure SDK.
Added (v0.1.32 sync)
:agentparameter (upstream PR #722) — Optional string increate-session/resume-sessionconfigs to pre-select a custom agent by name. Must match a name in:custom-agents.:is-child-process?client option (upstream PR #737) — Whentrue, connects via own stdio to a parent Copilot CLI process instead of spawning. Mutually exclusive with:cli-url; requires:use-stdio?true.Files changed (12)
::agent,::on-list-models,::is-child-process?,::level,::log-optionsValidation
COPILOT_E2E_TESTS=true bb test)./run-all-examples.sh)copilot-sdk-clojure-0.1.32.0.jar