-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(sdk): expose sandbox, safe_mode, insecure, worktree CLI flags #6479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -335,6 +335,22 @@ export class ProcessTransport implements Transport { | |||||||||
| args.push('--session-id', this.options.sessionId); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| if (this.options.sandbox) { | ||||||||||
| args.push('--sandbox'); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| if (this.options.safeMode) { | ||||||||||
| args.push('--safe-mode'); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| if (this.options.insecure) { | ||||||||||
| args.push('--insecure'); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| if (this.options.worktree) { | ||||||||||
| args.push('--worktree'); | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The CLI defines Passing an explicit empty string makes this position-independent:
Suggested change
Additionally, the CLI supports slug ( The same fix should be applied to the Python SDK's — qwen3.7-max via Qwen Code /review |
||||||||||
| } | ||||||||||
|
|
||||||||||
| return args; | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,10 @@ export type TransportOptions = { | |
| * When resume is provided, this should match the resume ID. | ||
| */ | ||
| sessionId?: string; | ||
| sandbox?: boolean; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] These four new fields in Consider adding JSDoc to match — qwen3.7-max via Qwen Code /review |
||
| safeMode?: boolean; | ||
| insecure?: boolean; | ||
| worktree?: boolean; | ||
| }; | ||
|
|
||
| export interface QuerySystemPromptPreset { | ||
|
|
@@ -465,6 +469,36 @@ export interface QueryOptions { | |
| */ | ||
| sessionId?: string; | ||
|
|
||
| /** | ||
| * Run in sandbox mode. | ||
| * Equivalent to CLI's `--sandbox` flag. | ||
| * @default false | ||
| */ | ||
| sandbox?: boolean; | ||
|
|
||
| /** | ||
| * Disable all customizations (context files, hooks, extensions, skills, MCP servers) | ||
| * for troubleshooting. | ||
| * Equivalent to CLI's `--safe-mode` flag. | ||
| * @default false | ||
| */ | ||
| safeMode?: boolean; | ||
|
|
||
| /** | ||
| * Skip TLS certificate verification for API connections. | ||
| * Equivalent to CLI's `--insecure` flag. | ||
| * WARNING: Removes protection against man-in-the-middle attacks. | ||
| * @default false | ||
| */ | ||
| insecure?: boolean; | ||
|
|
||
| /** | ||
| * Enable Git worktree mode. | ||
| * Equivalent to CLI's `--worktree` flag. | ||
| * @default false | ||
| */ | ||
| worktree?: boolean; | ||
|
|
||
| /** | ||
| * Timeout configuration for various SDK operations. | ||
| * All values are in milliseconds. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] The CLI logs a prominent warning to stderr when
--insecureis passed, but the SDK's default stderr handling ('ignore'unlessdebug: trueor astderrcallback is configured) silently discards it. An SDK consumer enablinginsecure: trueprogrammatically gets no visible indication that TLS verification is disabled.Consider emitting an SDK-side warning:
The same concern applies to the Python SDK's
transport.py, where stderr defaults tosubprocess.DEVNULL.— qwen3.7-max via Qwen Code /review