openclaw - ✅(Solved) Fix gemini-cli backend hardcodes unsupported --skip-trust flag — every call fails on gemini-cli ≥ 0.38.x [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74749Fetched 2026-05-01 05:41:48
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
3
Author
Timeline (top)
cross-referenced ×2commented ×1

The Google Gemini CLI backend at dist/extensions/google/cli-backend.js passes --skip-trust to gemini, but current gemini-cli (tested 0.38.1 and 0.38.2) doesn't recognize that flag. Yargs rejects with Unknown arguments: skip-trust, skipTrust and gemini exits non-zero, so every model attempt fails and the agent burns through the entire fallback chain.

Root Cause

The Google Gemini CLI backend at dist/extensions/google/cli-backend.js passes --skip-trust to gemini, but current gemini-cli (tested 0.38.1 and 0.38.2) doesn't recognize that flag. Yargs rejects with Unknown arguments: skip-trust, skipTrust and gemini exits non-zero, so every model attempt fails and the agent burns through the entire fallback chain.

Fix Action

Fix / Workaround

Local workaround that works: `sed -i '' '/"--skip-trust",/d' .../dist/extensions/google/cli-backend.js && openclaw daemon restart`.

PR fix notes

PR #74775: fix(google): drop unsupported --skip-trust flag from gemini-cli backend

Description (problem / solution / changelog)

Fix Summary

Drops the --skip-trust flag from the google-gemini-cli backend configuration. This flag is not recognized by gemini-cli ≥ 0.38.x (tested on 0.38.1 and 0.38.2), causing every gemini-cli model call to fail with:

Unknown arguments: skip-trust, skipTrust

The flag was presumably added to bypass interactive trust prompts during first-run, but modern gemini-cli handles this via ~/.gemini/trustedFolders.json (which openclaw workspaces typically populate via TRUST_PARENT). Removing the flag restores successful model calls.

Changes

  • extensions/google/cli-backend.ts: Removed "--skip-trust" from both args and resumeArgs arrays.

Verification

  • File-level TypeScript check passes (no type errors introduced by removing string literals from arrays)
  • The change is a pure removal with no new logic introduced
  • No regressions to existing gemini-cli functionality (the --output-format json, --prompt, --resume, and --model args remain intact)

Related

Closes #74749

Changed files

  • extensions/google/cli-backend.ts (modified, +1/-2)

PR #74834: fix: 5 targeted bug fixes (gemini-cli, plugin commands, openrouter thinking, cron summary, LLM-only tools)

Description (problem / solution / changelog)

Summary

Five independent targeted fixes, each addressing a distinct bug:

1. fix(google): remove unsupported --skip-trust flag from gemini-cli backend (#74749)

gemini-cli >= 0.38.x dropped --skip-trust. Passing it causes yargs to exit non-zero on every call, resulting in 100% failure rate for the gemini CLI backend. Removed from both args and resumeArgs.

2. fix(plugins): guard against undefined plugin command handler result (#74800)

Plugin command handlers typed as Promise<PluginCommandResult> can return undefined at runtime. The caller in commands-plugin.ts immediately destructures result.continueAgent, crashing with Cannot read properties of undefined. Added a ?? {} fallback at the execution boundary.

3. fix(openrouter): add resolveThinkingProfile with xhigh for reasoning models (#74788)

OpenRouter had no resolveThinkingProfile, so /think xhigh was rejected for all models including openrouter/deepseek/deepseek-v4-pro. Added a profile that exposes xhigh for models with reasoning: true (unless explicitly excluded via isOpenRouterProxyReasoningUnsupportedModel).

4. fix(cron): prefer finalAssistantVisibleText over raw error text in task summary (#74807)

When a cron agentTurn run had only error payloads (tool call failed, agent self-corrected but never sent an explicit reply via messaging tool), fallbackSummary fell through to pickSummaryFromOutput(firstText) where firstText was the tool error. Now prefers finalAssistantVisibleText as an intermediate fallback before resorting to raw payload text.

5. fix(agents): skip tool allowlist guard for LLM-only runs (#74810)

buildEmptyExplicitToolAllowlistError raised an error when callableToolNames was empty, even when disableTools: true. LLM-only runs intentionally disable tools, so an empty callable set is expected. Added early return when disableTools === true.

Testing

Each fix is independently testable:

  • #74749: pnpm test -- src/agents/cli-backends.test.ts
  • #74800: Trigger any plugin command whose handler returns undefined
  • #74788: pnpm test -- src/agents/pi-embedded-runner/openrouter-model-capabilities.test.ts
  • #74807: pnpm test -- src/cron/isolated-agent
  • #74810: pnpm test -- src/agents/tool-allowlist-guard

🤖 Generated with Claude Code

Changed files

  • extensions/google/cli-backend.ts (modified, +2/-10)
  • extensions/openrouter/index.ts (modified, +18/-0)
  • src/agents/cli-backends.test.ts (modified, +2/-10)
  • src/agents/tool-allowlist-guard.ts (modified, +4/-0)
  • src/cron/isolated-agent/helpers.ts (modified, +10/-2)
  • src/plugins/commands.ts (modified, +1/-1)

Code Example

[model-fallback/decision] decision=candidate_failed
  requested=google/gemini-3.1-flash-lite-preview
  detail=Unknown arguments: skip-trust, skipTrust
  Usage: gemini [options] [command]
RAW_BUFFERClick to expand / collapse

Summary

The Google Gemini CLI backend at dist/extensions/google/cli-backend.js passes --skip-trust to gemini, but current gemini-cli (tested 0.38.1 and 0.38.2) doesn't recognize that flag. Yargs rejects with Unknown arguments: skip-trust, skipTrust and gemini exits non-zero, so every model attempt fails and the agent burns through the entire fallback chain.

Impact

100% failure rate on the google-gemini-cli provider. With Google models prioritized in the chain, agents waste ~3.5s per turn cycling through 9 broken candidates before falling through to other providers. Symptom presents as "Gemini is slow" — it's not slow, it never succeeds.

Repro

  1. Install gemini-cli 0.38.2 (current homebrew stable: brew install gemini-cli).
  2. Configure any agent with a google-gemini-cli/<model> primary or fallback.
  3. Trigger an agent turn. Observe in ~/.openclaw/logs/gateway.err.log:
[model-fallback/decision] decision=candidate_failed
  requested=google/gemini-3.1-flash-lite-preview
  detail=Unknown arguments: skip-trust, skipTrust
  Usage: gemini [options] [command] …

Source

dist/extensions/google/cli-backend.js (also present in 2026.4.27):

```js args: ["--skip-trust", "--output-format", "json", "--prompt", "{prompt}"], resumeArgs: ["--skip-trust", "--resume", "{sessionId}", "--output-format", "json", "--prompt", "{prompt}"], ```

Suggested fix

Drop `--skip-trust` from `args` and `resumeArgs`. Trust prompts can be avoided by relying on `~/.gemini/trustedFolders.json` (which openclaw workspaces typically already populate via `TRUST_PARENT`), or by switching to a flag gemini-cli does support (e.g. `--yolo` if auto-approval is the intent — though that's broader than just trust).

Local workaround that works: `sed -i '' '/"--skip-trust",/d' .../dist/extensions/google/cli-backend.js && openclaw daemon restart`.

Versions

  • openclaw: 2026.4.25 and 2026.4.27 (both affected)
  • gemini-cli: 0.38.1, 0.38.2 (homebrew)
  • macOS 25.4.0 (Darwin)

extent analysis

TL;DR

Remove the --skip-trust flag from the args and resumeArgs in dist/extensions/google/cli-backend.js to resolve the compatibility issue with gemini-cli.

Guidance

  • Identify the lines in dist/extensions/google/cli-backend.js where --skip-trust is used and remove this flag.
  • As an alternative, consider using the --yolo flag if auto-approval is intended, but be aware it has broader implications than just trust.
  • Verify the fix by checking the ~/.openclaw/logs/gateway.err.log for the absence of Unknown arguments: skip-trust, skipTrust errors after triggering an agent turn.
  • If a quick fix is needed, apply the suggested local workaround using sed to remove the --skip-trust lines and restart the openclaw daemon.

Example

// Before
args: ["--skip-trust", "--output-format", "json", "--prompt", "{prompt}"],
resumeArgs: ["--skip-trust", "--resume", "{sessionId}", "--output-format", "json", "--prompt", "{prompt}"];

// After
args: ["--output-format", "json", "--prompt", "{prompt}"],
resumeArgs: ["--resume", "{sessionId}", "--output-format", "json", "--prompt", "{prompt}"];

Notes

This fix assumes that removing the --skip-trust flag does not introduce security vulnerabilities or significantly alter the intended behavior of the application. It's also important to note that using --yolo might have broader implications than just skipping trust prompts.

Recommendation

Apply the workaround by removing the --skip-trust flag from the args and resumeArgs as it directly addresses the compatibility issue with gemini-cli without introducing potential security risks associated with using --yolo.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix gemini-cli backend hardcodes unsupported --skip-trust flag — every call fails on gemini-cli ≥ 0.38.x [2 pull requests, 1 comments, 2 participants]