openclaw - ✅(Solved) Fix [Bug]: `openclaw matrix verify status` throws "Matrix runtime client requires a resolved runtime config" [1 pull requests, 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#70992Fetched 2026-04-24 10:36:58
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

The openclaw matrix verify status command fails with an error indicating that the runtime config is not passed to the Matrix client resolver, despite the config being loaded internally.

Error Message

Error: Matrix runtime client requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.

Root Cause

Root cause analysis:

Fix Action

Fixed

PR fix notes

PR #71102: fix(matrix): pass loaded cfg to verify CLI subcommands (#70992) [AI-assisted]

Description (problem / solution / changelog)

🤖 AI-assisted (built with Claude Code via Hermes orchestration). Test level: fully tested locally (pnpm test extensions/matrix → 1147/1147 pass, including 2 new regression tests; oxfmt --check clean on changed files). Prompt summary available on request.

Summary

  • Problem: openclaw matrix verify status (and the other 5 verify subcommands) crashes with Error: Matrix runtime client requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.
  • Why it matters: All 6 Matrix verify CLI subcommands are broken and unusable for end users trying to inspect or repair their encrypted Matrix setup.
  • What changed: Added a small resolveMatrixCliAccountContext helper that returns both accountId and the loaded cfg. The 6 verify subcommand action handlers now use it and forward cfg to their action functions.
  • What did NOT change (scope boundary): resolveMatrixCliAccountId and its 4 non-verify call sites are intentionally untouched; behavior of unrelated CLI commands is unchanged.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Integrations

Linked Issue/PR

  • Closes #70992
  • This PR fixes a bug or regression

Root Cause

  • Root cause: resolveMatrixCliAccountId (in extensions/matrix/src/cli.ts) loaded the runtime config via getMatrixRuntime().config.loadConfig() to resolve the account ID, but then returned only the accountId and discarded the loaded cfg. Each verify subcommand handler called its action function (e.g. getMatrixVerificationStatus, getMatrixRoomKeyBackupStatus, …) with only { accountId } and no cfg. Downstream, resolveRuntimeMatrixClient in extensions/matrix/src/matrix/client-bootstrap.ts requires opts.cfg and throws when it is undefined.
  • Missing detection / guardrail: No unit test asserted that the CLI action handlers actually pass the resolved cfg to their action functions, so the contract drift between CLI and action layer was invisible.
  • Contributing context: The cfg parameter appears to have been added to the action function signatures during a runtime refactor without updating the CLI call sites for the verify family.

Regression Test Plan

  • Coverage level that should have caught this:
    • Unit test
  • Target test or file: extensions/matrix/src/cli.test.ts
  • Scenario the test should lock in: each verify CLI subcommand passes the loaded cfg (not undefined) to its corresponding action function.
  • Why this is the smallest reliable guardrail: the bug lives entirely at the CLI/action boundary; a unit-level mock assertion on the action call arguments is sufficient and does not require a real Matrix runtime client.
  • Existing test that already covers this: N/A — this defect was previously uncovered.
  • If no new test is added, why not: N/A — tests added.

User-visible / Behavior Changes

The following commands no longer crash with the runtime-config error and now run as documented:

  • openclaw matrix verify status
  • openclaw matrix verify backup status
  • openclaw matrix verify backup reset
  • openclaw matrix verify backup restore
  • openclaw matrix verify bootstrap
  • openclaw matrix verify device <key>

Diagram (if applicable)

N/A

Security Impact (required)

  • New permissions/capabilities? No.
  • Secrets/tokens handling changed? Nocfg was already loaded by the same code path; it is now simply forwarded instead of discarded.
  • New/changed network calls? No.
  • Command/tool execution surface changed? No — same CLI surface, just no longer crashing.
  • Data access scope changed? No.

Compatibility / Migration

  • Backward compatible? Yes.
  • Config/env changes? No.
  • Migration needed? No.

Risks and Mitigations

Minimal risk. The new helper is additive; the original resolveMatrixCliAccountId is retained for the non-verify call sites that do not need cfg. All 1147 matrix-extension tests pass locally, including the 2 new regression tests in cli.test.ts.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/matrix/src/cli.test.ts (modified, +93/-7)
  • extensions/matrix/src/cli.ts (modified, +23/-9)

Code Example

Error: Matrix runtime client requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.

---

jerry@jserver:~$ openclaw matrix verify status

🦞 OpenClaw 2026.4.22 (unknown)
 I'm the middleware between your ambition and your attention span.

Error: Matrix runtime client requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.

---

verify.command("status").action(async (options) => {
    const accountId = resolveMatrixCliAccountId(options.account);
    await runMatrixCliCommand({
        run: async () => await getMatrixVerificationStatus({
            accountId,  // ← missing cfg
            includeRecoveryKey: options.includeRecoveryKey === true
        }),
        ...
    });
});

---

if (!opts.cfg) throw new Error("Matrix runtime client requires a resolved runtime config...");

---

const cfg = getMatrixRuntime().config.loadConfig();
await getMatrixVerificationStatus({
    cfg,
    accountId,
    ...
});
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The openclaw matrix verify status command fails with an error indicating that the runtime config is not passed to the Matrix client resolver, despite the config being loaded internally.

Steps to reproduce

  1. Install OpenClaw 2026.4.22
  2. Configure a Matrix account with encryption enabled
  3. Run openclaw matrix verify status
  4. Observe the error message

Expected behavior

The command should display the Matrix verification status for the configured account, including cross-signing status, backup status, and pending verifications.

Actual behavior

The command throws an error:

Error: Matrix runtime client requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.

OpenClaw version

2026.4.22

Operating system

Linux (Ubuntu 24.04)

Install method

docker

Model

NOT_ENOUGH_INFO (not relevant to this CLI bug)

Provider / routing chain

NOT_ENOUGH_INFO (not relevant to this CLI bug)

Additional provider/model setup details

NOT_ENOUGH_INFO

Logs, screenshots, and evidence

jerry@jserver:~$ openclaw matrix verify status

🦞 OpenClaw 2026.4.22 (unknown)
 I'm the middleware between your ambition and your attention span.

Error: Matrix runtime client requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.

Impact and severity

  • Affected: Users attempting to check Matrix verification status via CLI
  • Severity: Medium (blocks a specific CLI feature, but gateway functionality is not affected)
  • Frequency: Always reproducible
  • Consequence: Users cannot check verification status via CLI, which is needed for troubleshooting encrypted Matrix setups

Additional information

Root cause analysis:

In extensions/matrix/src/cli.ts, the verify status command handler calls getMatrixVerificationStatus({ accountId }) without passing the resolved runtime config (cfg):

verify.command("status").action(async (options) => {
    const accountId = resolveMatrixCliAccountId(options.account);
    await runMatrixCliCommand({
        run: async () => await getMatrixVerificationStatus({
            accountId,  // ← missing cfg
            includeRecoveryKey: options.includeRecoveryKey === true
        }),
        ...
    });
});

The resolveMatrixCliAccountId helper loads the config via getMatrixRuntime().config.loadConfig(), but only returns the accountId, discarding the config object.

Downstream in client-bootstrap.ts, resolveRuntimeMatrixClient() throws when opts.cfg is undefined:

if (!opts.cfg) throw new Error("Matrix runtime client requires a resolved runtime config...");

Suggested fix:

Pass the loaded config to the action functions in CLI handlers:

const cfg = getMatrixRuntime().config.loadConfig();
await getMatrixVerificationStatus({
    cfg,
    accountId,
    ...
});

This issue likely affects other verify subcommands as well, since they follow the same pattern.

extent analysis

TL;DR

Pass the loaded runtime config to the getMatrixVerificationStatus function in the verify status command handler.

Guidance

  • Verify that the getMatrixRuntime().config.loadConfig() function is correctly loading the runtime config.
  • Update the verify status command handler to pass the loaded config to the getMatrixVerificationStatus function, as suggested in the issue.
  • Review other verify subcommands to ensure they are also passing the loaded config to their respective functions.
  • Test the updated command handler to ensure it resolves the error and displays the expected verification status.

Example

verify.command("status").action(async (options) => {
    const cfg = getMatrixRuntime().config.loadConfig();
    const accountId = resolveMatrixCliAccountId(options.account);
    await runMatrixCliCommand({
        run: async () => await getMatrixVerificationStatus({
            cfg,
            accountId,
            includeRecoveryKey: options.includeRecoveryKey === true
        }),
        ...
    });
});

Notes

This fix assumes that the getMatrixRuntime().config.loadConfig() function is correctly loading the runtime config. If this function is not working as expected, additional debugging may be necessary.

Recommendation

Apply the suggested fix by passing the loaded config to the getMatrixVerificationStatus function, as this should resolve the error and allow the verify status command to function correctly.

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…

FAQ

Expected behavior

The command should display the Matrix verification status for the configured account, including cross-signing status, backup status, and pending verifications.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING