-
Notifications
You must be signed in to change notification settings - Fork 13k
feat/fast and no save sessions flag for quick one shot prompt execution #24717
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 |
|---|---|---|
|
|
@@ -404,6 +404,12 @@ export class CodeAssistServer implements ContentGenerator { | |
| signal?: AbortSignal, | ||
| retryDelay: number = 100, | ||
| ): Promise<T> { | ||
| if ( | ||
| this.config?.getSkipPreflightRequests() && | ||
| method !== 'generateContent' | ||
| ) { | ||
| return {} as T; | ||
| } | ||
|
Comment on lines
+407
to
+412
Contributor
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. The References
|
||
| const res = await this.client.request<T>({ | ||
| url: this.getMethodUrl(method), | ||
| method: 'POST', | ||
|
|
@@ -432,6 +438,9 @@ export class CodeAssistServer implements ContentGenerator { | |
| url: string, | ||
| signal?: AbortSignal, | ||
| ): Promise<T> { | ||
| if (this.config?.getSkipPreflightRequests()) { | ||
| return {} as T; | ||
| } | ||
| const res = await this.client.request<T>({ | ||
| url, | ||
| method: 'GET', | ||
|
|
@@ -458,6 +467,12 @@ export class CodeAssistServer implements ContentGenerator { | |
| req: object, | ||
| signal?: AbortSignal, | ||
| ): Promise<AsyncGenerator<T>> { | ||
| if ( | ||
| this.config?.getSkipPreflightRequests() && | ||
| method !== 'streamGenerateContent' | ||
| ) { | ||
| return (async function* () {})() as AsyncGenerator<T>; | ||
| } | ||
| const res = await this.client.request<AsyncIterable<unknown>>({ | ||
| url: this.getMethodUrl(method), | ||
| method: 'POST', | ||
|
|
||
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.
The
--fastCLI flag disables the hook system, which is used for security policies such as Data Loss Prevention (DLP). Allowing users to bypass these hooks via a CLI flag undermines the security model. Security-sensitive settings should not allow less-trusted configuration scopes (like a user-provided CLI flag) to completely override or bypass more-trusted security enforcement mechanisms. Ensure security-critical hooks remain active even when performance optimizations are requested.References