Skip to content

[upstream-sync] Port upstream PRs #722 and #730: agent param + onListModels handler#47

Closed
github-actions[bot] wants to merge 1 commit intomainfrom
upstream-sync/2026-03-09-d2d2a18922c36705
Closed

[upstream-sync] Port upstream PRs #722 and #730: agent param + onListModels handler#47
github-actions[bot] wants to merge 1 commit intomainfrom
upstream-sync/2026-03-09-d2d2a18922c36705

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 9, 2026

Summary

Ports two upstream github/copilot-sdk changes (from v0.1.32 changelog):

Upstream PR #722 — agent parameter for session creation

Adds :agent to SessionConfig and ResumeSessionConfig in both create-session and resume-session. When provided, the named custom agent is activated when the session starts (must match the :name of one of the agents in :custom-agents). The value is forwarded as agent on the wire in session.create / session.resume RPC calls.

Changes:

  • specs.clj: Added (s/def ::agent ::non-blank-string), added :agent to session-config-keys and resume-session-config-keys
  • client.clj: Forward :agent in build-create-session-params and build-resume-session-params; updated docstrings for create-session and resume-session
  • doc/reference/API.md: Added :agent row to session config table

Upstream PR #730 — onListModels custom handler for BYOK

Adds :on-list-models to CopilotClientOptions. When provided, list-models calls this zero-arg function instead of querying the CLI server. No connection is required in that case. Results are still cached.

Changes:

  • specs.clj: Added (s/def ::on-list-models fn?), added :on-list-models to client-options-keys
  • client.clj: Updated list function docstring; updated list-models to check for the handler and skip ensure-connected! when it's set
  • doc/reference/API.md: Updated list-models description
  • doc/auth/byok.md: Added "Custom Model Listing" section with usage example

PRs Referenced

PRs Skipped

  • #736, #733 — C# codegen only
  • #727, #723, #721, #720, #719, #717, #716, #714 — Documentation-only
  • #708, #705 — Changelog only
  • #706 — v2 protocol backward-compat adapters (already ported in v0.1.30.1)
  • #686 — Protocol v3 broadcast event model (already ported in v0.1.30.1); isChildProcess is a JS-specific stdio transport concern not applicable to the Clojure SDK

Testing

  • bb validate-docs passed (11 files, 0 warnings)
  • Unit/integration tests could not run (no Maven cache in this sandbox), but code review and syntax analysis show no issues
  • The spec changes follow existing patterns exactly; the list-models change is a minimal conditional wrapping the existing fetch logic

Generated by Upstream Sync Agent ·

  • expires on Mar 16, 2026, 2:11 PM UTC

…ndler)

- Add :agent parameter to create-session and resume-session config
  for pre-selecting a custom agent by name at session creation time.
  Upstream PR #722.

- Add :on-list-models client option: a zero-arg function returning
  a seq of model info maps. When provided, list-models uses this
  handler instead of querying the CLI server. Connection not required
  when handler is set. Upstream PR #730.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@krukow krukow closed this Mar 10, 2026
@krukow krukow deleted the upstream-sync/2026-03-09-d2d2a18922c36705 branch March 10, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant