feat(python): add cli_args support to CopilotClientOptions for parity with Node.js SDK#399
Open
liuxiaopai-ai wants to merge 1 commit intogithub:mainfrom
Open
feat(python): add cli_args support to CopilotClientOptions for parity with Node.js SDK#399liuxiaopai-ai wants to merge 1 commit intogithub:mainfrom
liuxiaopai-ai wants to merge 1 commit intogithub:mainfrom
Conversation
… with Node.js SDK
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
This PR adds
cli_argssupport to the Python SDK'sCopilotClientOptions, resolving the cross-SDK feature inconsistency reported in #381.Problem
The Node.js SDK's
CopilotClientOptionsincludes acliArgs?: string[]field that allows users to pass extra arguments to the CLI executable. The Python SDK was missing this correspondingcli_argsfield, making it impossible to pass custom CLI arguments when using the Python SDK.Changes
python/copilot/types.pycli_args: list[str]field toCopilotClientOptionsTypedDictpython/copilot/client.pycli_argsin client options (defaults to[])cli_argsbefore SDK-managed args in_start_cli_server(), matching the Node.js SDK behavior wherecliArgsare spread before--headless,--no-auto-update, etc.python/test_client.pyTestCliArgstest class with 4 unit tests:test_cli_args_defaults_to_empty_listtest_cli_args_stored_in_optionstest_cli_args_empty_listtest_cli_args_single_argNode.js SDK Reference
The implementation mirrors the Node.js SDK behavior:
Closes #381