openclaw - 💡(How to fix) Fix Memory search CLI vs agent internal behavior inconsistency + poor error messages [2 comments, 3 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#52199Fetched 2026-04-08 01:14:24
View on GitHub
Comments
2
Participants
3
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×2

Multiple UX and reliability issues discovered during memory search configuration with a custom embedding provider (OpenAI-compatible proxy). Documented from a real debugging session on 2026-03-22.


Error Message

Root cause: CLI routes through the gateway socket (requires device identity pairing), while the agent tool calls the underlying layer directly. These two paths behave differently but the error gives no indication of which path failed or why.

Issue 2: fetch failed error provides no root cause

  • Endpoint returned an error (e.g. model not available) Expected: Detect and warn (or prevent) concurrent gateway processes.

Root Cause

Root cause: CLI routes through the gateway socket (requires device identity pairing), while the agent tool calls the underlying layer directly. These two paths behave differently but the error gives no indication of which path failed or why.

RAW_BUFFERClick to expand / collapse

Summary

Multiple UX and reliability issues discovered during memory search configuration with a custom embedding provider (OpenAI-compatible proxy). Documented from a real debugging session on 2026-03-22.


Issue 1: CLI openclaw memory search and agent internal memory_search take different code paths with no indication

Steps to reproduce:

  1. Configure memorySearch with provider: openai, custom baseUrl and apiKey
  2. Run openclaw memory index --force → succeeds
  3. Run openclaw memory search "query" → fails with fetch failed
  4. Use memory_search tool from within an agent → succeeds, returns correct results

Root cause: CLI routes through the gateway socket (requires device identity pairing), while the agent tool calls the underlying layer directly. These two paths behave differently but the error gives no indication of which path failed or why.

Expected: Either unify the two paths, or when CLI fails due to gateway connectivity, say so explicitly: e.g. "Cannot reach gateway: device identity required. Try openclaw device pair."

Time spent debugging: ~1.5 hours


Issue 2: fetch failed error provides no root cause

Observed: fetch failed is returned in multiple failure scenarios without distinguishing:

  • Network unreachable
  • Device identity / authentication failure
  • Endpoint returned an error (e.g. model not available)

Expected: Errors should indicate the category of failure. Even fetch failed (auth), fetch failed (network), fetch failed (upstream: 404) would cut debugging time significantly.


Issue 3: Warning-level config issues cause gateway startup to abort via SIGTERM

Steps to reproduce:

  1. Set channels.telegram.groupPolicy = "allowlist" but leave groupAllowFrom empty
  2. Run openclaw gateway restart
  3. Gateway process receives SIGTERM and fails to start

Expected: A warning-level configuration issue should print a warning and continue startup. Warnings ≠ errors. Do not abort.


Issue 4: Multiple gateway processes can run concurrently with no warning

Steps to reproduce:

  1. Gateway restart fails mid-way due to SIGTERM
  2. Old process remains alongside partially started new process
  3. systemctl status shows active, new config not applied, no log warning

Expected: Detect and warn (or prevent) concurrent gateway processes.


Issue 5: Custom embedding provider configuration is not discoverable

Context: Configuring memorySearch with a custom OpenAI-compatible baseUrl (e.g. OpenRouter, proxy API) is a common use case. The relevant config options (remote.baseUrl, remote.apiKey) were only findable deep in concepts/memory.md.

Suggested: Add a dedicated section: "Using a custom or proxy embedding provider" with a working example.


Environment

  • OpenClaw: stable channel, ~2026.3.x
  • OS: Ubuntu 22.04.5 LTS (server) / macOS Darwin 25.3.0 (client)
  • Embedding provider: OpenAI-compatible proxy
  • Model: text-embedding-3-small

extent analysis

Fix Plan

To address the issues, we'll focus on the following steps:

Issue 1: Unify Code Paths

  • Modify the CLI openclaw memory search to call the underlying layer directly, similar to the agent tool.
  • Add a check for device identity pairing and provide an explicit error message when it's required.

Example code:

# Check for device identity pairing
if not device_identity_paired():
    print("Cannot reach gateway: device identity required. Try `openclaw device pair`.")
    return

# Call the underlying layer directly
results = memory_search_tool(query)

Issue 2: Improve Error Messages

  • Enhance the fetch failed error to include the category of failure (e.g., auth, network, upstream).
  • Use a dictionary to map error codes to descriptive messages.

Example code:

error_messages = {
    "auth": "fetch failed (auth)",
    "network": "fetch failed (network)",
    "upstream": "fetch failed (upstream: {})"
}

# ...

try:
    response = fetch(url)
except AuthenticationError:
    print(error_messages["auth"])
except NetworkError:
    print(error_messages["network"])
except UpstreamError as e:
    print(error_messages["upstream"].format(e.status_code))

Issue 3: Handle Warning-Level Config Issues

  • Modify the gateway startup to print warnings for non-critical config issues and continue startup.

Example code:

# Check for warning-level config issues
if not group_allow_from_configured():
    print("Warning: groupAllowFrom is empty. Continuing startup.")
    # Continue startup

Issue 4: Detect Concurrent Gateway Processes

  • Implement a check to detect and warn about concurrent gateway processes.

Example code:

# Check for concurrent gateway processes
if is_gateway_process_running():
    print("Warning: concurrent gateway process detected.")
    # Prevent or warn about concurrent processes

Issue 5: Improve Custom Embedding Provider Configuration

  • Add a dedicated section to the documentation for using a custom or proxy embedding provider.
  • Provide a working example configuration.

Example configuration:

memorySearch:
  provider: openai
  remote:
    baseUrl: https://your-proxy-api.com
    apiKey: your-api-key

Verification

To verify the fixes, follow these steps:

  • Test the CLI openclaw memory search with and without device identity pairing.
  • Simulate different failure scenarios (e.g., auth, network, upstream) and verify that the error messages are descriptive.
  • Configure warning-level config issues and verify that the gateway startup continues.
  • Test concurrent gateway processes and verify that a warning is printed.
  • Configure a custom embedding provider and verify that it works as expected.

Extra Tips

  • Regularly review and update the documentation to ensure that it's accurate and discoverable

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