openclaw - 💡(How to fix) Fix [gateway] CLI transcript persistence broken: default context engine "legacy" never registered (Available engines: (none))

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…

Error Message

if (isDefaultEngine) throw new Error( Two facts from the live error string:

  • The error appears on every turn, polluting logs and masking other failures.

Fix Action

Fix / Workaround

Non-fatal at the surface — agent turns, skill dispatch, and hooks still work — but the throw means agents/agent-command cannot persist CLI session transcripts. Practical consequences:

Code Example

[agents/agent-command] CLI transcript persistence failed for agent:main:main:
  Context engine "legacy" is not registered. Available engines: (none)

---

openclaw agent --agent main --message "ack" --json

---

const entry = getContextEngineRegistryState().engines.get(engineId);
if (!entry) {
  if (isDefaultEngine) throw new Error(
    `Context engine "${engineId}" is not registered. Available engines: ${list || "(none)"}.`
  );
  return resolveDefaultContextEngine(defaultEngineId, factoryCtx);
}
RAW_BUFFERClick to expand / collapse

Reproduction

OpenClaw 2026.5.7 (eeef486), macOS Darwin 25.4.0 (arm64), Node v24.14.0, Claude Code v2.1.133 backend.

On every CLI agent turn routed through agent:main:main, the gateway logs:

[agents/agent-command] CLI transcript persistence failed for agent:main:main:
  Context engine "legacy" is not registered. Available engines: (none)

This fires on a clean install with default config — no user-side context-engine configuration is set. It reproduces by simply running, e.g.:

openclaw agent --agent main --message "ack" --json

The agent turn itself completes (text payload returns), but the persistence layer throws and is swallowed at the agent-command boundary.

Source

The throw originates in /usr/local/lib/node_modules/openclaw/dist/registry-CxcGD4Pv.js inside the context-engine resolver:

const entry = getContextEngineRegistryState().engines.get(engineId);
if (!entry) {
  if (isDefaultEngine) throw new Error(
    `Context engine "${engineId}" is not registered. Available engines: ${list || "(none)"}.`
  );
  return resolveDefaultContextEngine(defaultEngineId, factoryCtx);
}

Two facts from the live error string:

  • The requested engineId is "legacy" and it is flagged as the default engine (the isDefaultEngine branch is what fires this throw form, not the silent fallback path).
  • getContextEngineRegistryState().engines is empty on this build (Available engines: (none)), so no factory ever called registerContextEngine for "legacy" during gateway bootstrap. Looks like a missing registration step rather than a user-config issue — the default engine is referenced by ID before any plugin/initializer registers it.

Impact

Non-fatal at the surface — agent turns, skill dispatch, and hooks still work — but the throw means agents/agent-command cannot persist CLI session transcripts. Practical consequences:

  • --session-id resume across CLI restarts is unreliable.
  • Any history/replay feature that reads from the persisted transcript store is silently degraded.
  • The error appears on every turn, polluting logs and masking other failures.

A fix likely belongs in whatever module is supposed to call registerContextEngine("legacy", …) during gateway startup, or — if the default ID has been renamed — updating the resolver's default to match the actually-registered engine ID.

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 [gateway] CLI transcript persistence broken: default context engine "legacy" never registered (Available engines: (none))