[upstream-sync] Port upstream PRs #722 and #730: agent param + onListModels handler#47
Closed
github-actions[bot] wants to merge 1 commit intomainfrom
Closed
[upstream-sync] Port upstream PRs #722 and #730: agent param + onListModels handler#47github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
…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>
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
Ports two upstream
github/copilot-sdkchanges (from v0.1.32 changelog):Upstream PR #722 —
agentparameter for session creationAdds
:agenttoSessionConfigandResumeSessionConfigin bothcreate-sessionandresume-session. When provided, the named custom agent is activated when the session starts (must match the:nameof one of the agents in:custom-agents). The value is forwarded asagenton the wire insession.create/session.resumeRPC calls.Changes:
specs.clj: Added(s/def ::agent ::non-blank-string), added:agenttosession-config-keysandresume-session-config-keysclient.clj: Forward:agentinbuild-create-session-paramsandbuild-resume-session-params; updated docstrings forcreate-sessionandresume-sessiondoc/reference/API.md: Added:agentrow to session config tableUpstream PR #730 —
onListModelscustom handler for BYOKAdds
:on-list-modelstoCopilotClientOptions. When provided,list-modelscalls 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-modelstoclient-options-keysclient.clj: Updatedlistfunction docstring; updatedlist-modelsto check for the handler and skipensure-connected!when it's setdoc/reference/API.md: Updatedlist-modelsdescriptiondoc/auth/byok.md: Added "Custom Model Listing" section with usage examplePRs Referenced
agentparameter to session creation for pre-selecting custom agents github/copilot-sdk#722PRs Skipped
isChildProcessis a JS-specific stdio transport concern not applicable to the Clojure SDKTesting
bb validate-docspassed (11 files, 0 warnings)list-modelschange is a minimal conditional wrapping the existing fetch logic