fix: reflect --auto-approve flag in settings override so #wrapToolForAcpPermission sees yolo mode
This commit is contained in:
@@ -988,6 +988,10 @@ export async function runRootCommand(
|
||||
// Runtime override (not persisted): every settings.get("tools.approvalMode") downstream
|
||||
// sees this value. The wrapper still honours --auto-approve / --yolo on top of it.
|
||||
settingsInstance.override("tools.approvalMode", parsedArgs.approvalMode);
|
||||
} else if (parsedArgs.autoApprove) {
|
||||
// --auto-approve / --yolo without an explicit --approval-mode: reflect in settings so
|
||||
// setup-time checks (e.g. #wrapToolForAcpPermission) also see the yolo intent.
|
||||
settingsInstance.override("tools.approvalMode", "yolo");
|
||||
}
|
||||
if (parsedArgs.mode === "rpc" || parsedArgs.mode === "rpc-ui") {
|
||||
applyRpcDefaultSettingOverrides(settingsInstance);
|
||||
|
||||
@@ -3532,6 +3532,8 @@ export class AgentSession {
|
||||
*
|
||||
* In `yolo` mode, skips the gate unless the user policy explicitly requires a
|
||||
* prompt or deny (matching the behaviour of the normal approval wrapper).
|
||||
* `--auto-approve` / `--yolo` CLI flags also reach here because `main.ts`
|
||||
* reflects them into a `tools.approvalMode` settings override at startup.
|
||||
*/
|
||||
#wrapToolForAcpPermission<T extends AgentTool>(tool: T): T {
|
||||
const bridge = this.#clientBridge;
|
||||
|
||||
Reference in New Issue
Block a user