Skip to content

feat: port upstream v0.1.31–v0.1.32 features#48

Merged
krukow merged 3 commits intomainfrom
upstream-sync/v0.1.32
Mar 10, 2026
Merged

feat: port upstream v0.1.31–v0.1.32 features#48
krukow merged 3 commits intomainfrom
upstream-sync/v0.1.32

Conversation

@krukow
Copy link
Collaborator

@krukow krukow commented Mar 9, 2026

Summary

Port 4 features from upstream copilot-sdk (v0.1.31–v0.1.32) to the Clojure SDK.

Added (v0.1.32 sync)

  • :agent parameter (upstream PR #722) — Optional string in create-session/resume-session configs to pre-select a custom agent by name. Must match a name in :custom-agents.
  • :is-child-process? client option (upstream PR #737) — When true, 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)

  • specs.clj — New specs: ::agent, ::on-list-models, ::is-child-process?, ::level, ::log-options
  • CHANGELOG.md — Unreleased entries for all 4 features
  • build.clj / README.md — Version bump to 0.1.32.0
  • Tests — 13 new test assertions across integration_test, copilot_sdk_test, mock_server

Validation

  • ✅ 93 tests, 315 assertions, 0 failures (COPILOT_E2E_TESTS=true bb test)
  • ✅ Documentation valid (12 files, 0 warnings)
  • ✅ All 15 examples pass (./run-all-examples.sh)
  • ✅ JAR builds: copilot-sdk-clojure-0.1.32.0.jar

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>
Copilot AI review requested due to automatic review settings March 9, 2026 21:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 :agent support in session create/resume configs and forward it on the wire.
  • Add :is-child-process? client option (parent-stdio transport) and :on-list-models handler 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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

- 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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

@krukow krukow merged commit c448d8e into main Mar 10, 2026
5 checks passed
@krukow krukow deleted the upstream-sync/v0.1.32 branch March 10, 2026 06:58
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.

2 participants