openclaw - 💡(How to fix) Fix [Bug]: web_search tool aborts silently with Gemini provider — instantaneous abort, no err.log entry [1 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#72995Fetched 2026-04-28 06:28:58
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

web_search with the Gemini provider (google_search grounding) intermittently aborts instantly with the message "This operation was aborted". The abort is near-instantaneous (<1s), ruling out timeout. The error is swallowed by the tool layer and never appears in gateway.err.log.

Error Message

web_search with the Gemini provider (google_search grounding) intermittently aborts instantly with the message "This operation was aborted". The abort is near-instantaneous (<1s), ruling out timeout. The error is swallowed by the tool layer and never appears in gateway.err.log. | gateway.err.log | No corresponding error — tool layer swallows it | Session-level runAbortController being triggered prematurely. The abort is too fast to be a network/timeout issue and too silent to be normal error handling. Suspect a race condition in the session run lifecycle where the abort controller fires before the search completes, and the error is caught but not logged.

Root Cause

Suspected Root Cause

RAW_BUFFERClick to expand / collapse

Summary

web_search with the Gemini provider (google_search grounding) intermittently aborts instantly with the message "This operation was aborted". The abort is near-instantaneous (<1s), ruling out timeout. The error is swallowed by the tool layer and never appears in gateway.err.log.

Environment

  • OpenClaw version: v2026.4.23
  • OS: macOS arm64
  • Provider: gemini (google_search grounding)

Repro Steps

  1. Call web_search with any query (short or long — not query-length dependent)
  2. Observe intermittent instant abort: returns "This operation was aborted" in <1s
  3. Retry — sometimes succeeds (takes ~22s), sometimes fails repeatedly

Key Observations

ObservationDetail
Abort speedInstantaneous (<1s), not a timeout
timeoutSeconds configSetting to 60 in openclaw.json had no effect
gateway.err.logNo corresponding error — tool layer swallows it
Gemini API healthDirect curl to Gemini API responds fine; API is healthy
IntermittencySometimes succeeds in ~22s, sometimes fails repeatedly
Query lengthNot a factor — short queries also fail

Suspected Root Cause

Session-level runAbortController being triggered prematurely. The abort is too fast to be a network/timeout issue and too silent to be normal error handling. Suspect a race condition in the session run lifecycle where the abort controller fires before the search completes, and the error is caught but not logged.

Additional Context

  • The tool returns the abort message to the caller but does not write anything to gateway.err.log, making it invisible to normal debugging.
  • Not reproducible 100% — suggests a timing-dependent race condition rather than a config issue.

extent analysis

TL;DR

Investigate and potentially adjust the session-level runAbortController to prevent premature triggering, which is suspected to cause the instantaneous aborts.

Guidance

  • Review the implementation of runAbortController in the context of the Gemini provider (google_search grounding) to understand under what conditions it triggers an abort.
  • Since the issue is intermittent and not reproducible 100%, consider adding logging or debugging statements around the runAbortController to capture more information about when and why it's being triggered prematurely.
  • Given that setting timeoutSeconds to 60 in openclaw.json had no effect, explore other configuration options or environmental factors that could influence the behavior of runAbortController.
  • To mitigate the issue, consider implementing a retry mechanism with a backoff strategy for the web_search calls that fail with the "This operation was aborted" message, as sometimes retries succeed.

Example

No specific code example can be provided without more details on the runAbortController implementation, but a generic approach to handling such aborts might involve wrapping the search call in a retry loop:

import time

def web_search_with_retry(query, max_retries=3, backoff_factor=1):
    for attempt in range(max_retries):
        try:
            # Call web_search here
            result = web_search(query)
            return result
        except AbortError:
            if attempt < max_retries - 1:
                time.sleep(backoff_factor * (2 ** attempt))
            else:
                raise

# Usage
try:
    result = web_search_with_retry("your_query")
except AbortError:
    print("Failed after retries")

Notes

The solution may require deeper understanding of the runAbortController and its integration with the Gemini provider. The intermittent nature suggests a race condition, which can be challenging to debug and fix.

Recommendation

Apply a workaround by implementing a retry

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 - 💡(How to fix) Fix [Bug]: web_search tool aborts silently with Gemini provider — instantaneous abort, no err.log entry [1 participants]