fix(brain): drop --approval-mode yolo from Gemini CLI search
yolo auto-approves every tool call, so a real-time search query could in principle trigger write/shell tools. Default approval mode still auto-runs the CLI's read-only web search in headless mode but never silently approves destructive tools. Verified end-to-end: a grounded query returns a current answer in ~23s with the account OAuth login. Test asserts yolo is absent; specs and docs/llm_contexts.md updated. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -131,7 +131,11 @@ def gemini_cli_search(query: str, timeout: int = 30) -> Optional[str]:
|
||||
env["GOOGLE_GENAI_USE_GCA"] = "true"
|
||||
try:
|
||||
proc = subprocess.run(
|
||||
[binary, "-p", query, "-o", "json", "--skip-trust", "--approval-mode", "yolo"],
|
||||
# Default approval mode (no --yolo): the CLI auto-runs read-only
|
||||
# tools like its web search in headless mode but will not silently
|
||||
# approve write/shell tools, so a search query can't trigger
|
||||
# destructive actions.
|
||||
[binary, "-p", query, "-o", "json", "--skip-trust"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=timeout,
|
||||
|
||||
@@ -17,7 +17,7 @@ Before the DuckDuckGo cascade, `run()` routes by the env flag `STREAM_BROWSER`
|
||||
- **false**: Gemini answers, with the sub-mode chosen by `cfg.gemini_auth`
|
||||
(env `GEMINI_AUTH`, default `oauth`):
|
||||
- `oauth` (default): `gemini_cli_search()` shells out to the Gemini CLI
|
||||
(`gemini -p <query> -o json --skip-trust --approval-mode yolo`) using the
|
||||
(`gemini -p <query> -o json --skip-trust`, default approval mode) using the
|
||||
user's Google-account login and the CLI's built-in web-search grounding.
|
||||
`GEMINI_API_KEY` / `GOOGLE_API_KEY` are stripped from the child env so the
|
||||
CLI uses the account login, not API-key auth. Requires a one-time
|
||||
|
||||
Reference in New Issue
Block a user