Skip to content

Provider diagnostics should load gbrain.env like updater and plugins #165

Description

@100yenadmin

TL;DR

gbrain providers test can report Embedding provider not configured in a raw shell even though the installed Eva Brain runtime is healthy, searchable, and the updater/OpenClaw/Codex plugin paths correctly load ~/.gbrain/gbrain.env. This is not blocking eva-v0.42.47.3, but it is a confusing diagnostic footgun for agents and operators.

Why it matters

Before fleet rollout, we validated the actual runtime path:

flowchart LR
  A[Updater / OpenClaw plugin / Codex plugin] --> B[Load ~/.gbrain/gbrain.env]
  B --> C[Voyage 4 Large 2048d provider]
  C --> D[GBrain search/query works]
Loading

That path works and reports 2048 dims.

But a raw shell can do this instead:

flowchart LR
  A[Raw operator shell] --> B[Does not source ~/.gbrain/gbrain.env]
  B --> C[gbrain providers test]
  C --> D[False-looking missing provider error]
Loading

Because agents often use raw shell commands during diagnostics, this can create false negatives even when GBrain is actually callable.

Evidence

Release/local checkpoint: eva-v0.42.47.3.

Works when env is loaded by updater/plugin path:

Probing embedding provider...
  ✓ 434ms, 2048 dims

All probes green.

Raw retrieval works even without provider env because the indexed brain is already searchable:

env -u VOYAGE_API_KEY -u OPENAI_API_KEY gbrain query \
  "Customer Support KB Agent Protocol openclaw-support-kb" \
  --source openclaw-support-kb --limit 1

returns:

[1.0000] agents -- # Customer Support KB Agent Protocol

But raw provider diagnostics fail:

env -u VOYAGE_API_KEY -u OPENAI_API_KEY gbrain providers test

returns:

Embedding provider not configured or not ready. Run `gbrain providers list` to see status.

gbrain providers list then shows Voyage missing VOYAGE_API_KEY, because the raw shell did not source ~/.gbrain/gbrain.env.

Expected behavior

One of these should be true:

  1. providers test loads the same configured env file used by updater/plugin runtime before deciding configured provider readiness, or
  2. providers test emits an explicit hint such as: ~/.gbrain/gbrain.env was not loaded; source it or run through the Eva updater/plugin runtime.

Preferred fix: load the configured env file consistently for diagnostics, without mutating global process env more broadly than existing CLI conventions allow.

Acceptance criteria

  • Raw gbrain providers test from an Eva install can validate the configured Voyage 2048d provider when ~/.gbrain/gbrain.env exists.
  • If env loading is intentionally not supported for this command, the command prints a clear operator hint instead of a generic missing provider failure.
  • Regression coverage proves the updater/plugin configured-provider path and raw diagnostic path do not diverge silently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions