openclaw - ✅(Solved) Fix 2026.4.9: completion cache generation crashes on missing qa/scenarios/index.md [3 pull requests, 6 comments, 7 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#63510Fetched 2026-04-10 03:42:57
View on GitHub
Comments
6
Participants
7
Timeline
13
Reactions
7
Timeline (top)
commented ×6cross-referenced ×4subscribed ×2referenced ×1

After updating to 2026.4.9, openclaw completion --write-state (and the automatic completion cache update during openclaw update) crashes with:

Error: qa scenario pack not found: qa/scenarios/index.md
    at readQaScenarioPack (suite-BW4kSK9C.js:754:27)
    at readQaScenarioById (suite-BW4kSK9C.js:790:19)
    at readQaScenarioExecutionConfig (suite-BW4kSK9C.js:795:9)
    at readRequiredDiscoveryRefs (suite-BW4kSK9C.js:2834:9)

Error Message

Error: qa scenario pack not found: qa/scenarios/index.md at readQaScenarioPack (suite-BW4kSK9C.js:754:27) at readQaScenarioById (suite-BW4kSK9C.js:790:19) at readQaScenarioExecutionConfig (suite-BW4kSK9C.js:795:9) at readRequiredDiscoveryRefs (suite-BW4kSK9C.js:2834:9)

Root Cause

REQUIRED_DISCOVERY_REFS_LOWER (suite-BW4kSK9C.js:2840) is a module-level constant evaluated at import time. Its initializer calls readRequiredDiscoveryRefs(), which calls readQaScenarioById("source-docs-discovery-report").

readQaScenarioById throws when the scenario is not found, but the calling code uses optional chaining (?.) expecting undefined:

function readRequiredDiscoveryRefs() {
    return readQaScenarioExecutionConfig("source-docs-discovery-report")?.requiredFiles ?? [
        "repo/qa/scenarios/index.md",
        "repo/extensions/qa-lab/src/suite.ts",
        "repo/docs/help/testing.md"
    ];
}

The ?. and ?? fallback never execute because the exception is thrown before the return.

Two contributing factors:

  1. qa/scenarios/ is not shipped in the npm packagepackage.json files field includes dist/, docs/, assets/, skills/, but not qa/. The resolveRepoPath walk-up heuristic only works inside the development monorepo.

  2. The import chain is unavoidable during completioncompletion-cli registers all subclis → qa-cliapi-BPAYEtQE.jssuite-BW4kSK9C.js → module-level REQUIRED_DISCOVERY_REFS_LOWER → crash.

Fix Action

Fixed

PR fix notes

PR #63525: fix(qa-lab): catch missing qa scenario pack in discovery refs init

Description (problem / solution / changelog)

Closes #63510

Summary

  • wrap readRequiredDiscoveryRefs() in try/catch so the existing fallback array is reachable when qa/scenarios/index.md is not shipped in the npm package
  • prevents openclaw completion --write-state and openclaw update from crashing on module-level constant initialization

Root cause

REQUIRED_DISCOVERY_REFS is evaluated at import time. Its initializer calls through readQaScenarioExecutionConfigreadQaScenarioByIdreadQaScenarioPack, which throws when qa/scenarios/index.md is missing. The existing ?. and ?? fallback never executes because the exception is thrown before the return.

Test plan

  • verified the fix matches the suggested approach in the issue
  • the change is a defensive try/catch around an existing function; no behavioral change when qa/scenarios/ is present

Changed files

  • extensions/qa-lab/src/discovery-eval.ts (modified, +14/-10)

PR #63669: fix(qa-lab): wrap scenario pack read in try/catch for npm dist

Description (problem / solution / changelog)

Problem

Updating to v2026.4.9 causes completion cache generation to crash with Error: qa scenario pack not found: qa/scenarios/index.md.

Root Cause

The qa/scenarios/ directory is not included in the npm distribution. readQaScenarioPack() throws during module init before the ?? fallback can run.

Fix

Wrap the scenario pack lookup in try/catch so the built-in default refs are used when the pack is unavailable.

Closes #63510

Changed files

  • extensions/qa-lab/src/discovery-eval.ts (modified, +16/-10)

PR #63958: fix: package qa scenarios and guard discovery refs

Description (problem / solution / changelog)

Summary

  • include qa/ in the published npm package so qa/scenarios/index.md is available outside the monorepo
  • guard QA discovery ref loading so CLI startup falls back cleanly if the QA pack is unavailable
  • add a regression test covering the missing-pack fallback path

Testing

  • npm pack --ignore-scripts --silent
  • verified tarball contains package/qa/scenarios/index.md
  • verified tarball contains package/qa/scenarios/source-docs-discovery-report.md

Closes #63510

Changed files

  • extensions/qa-lab/src/discovery-eval.missing-pack.test.ts (added, +31/-0)
  • extensions/qa-lab/src/discovery-eval.ts (modified, +15/-7)
  • package.json (modified, +1/-0)

Code Example

Error: qa scenario pack not found: qa/scenarios/index.md
    at readQaScenarioPack (suite-BW4kSK9C.js:754:27)
    at readQaScenarioById (suite-BW4kSK9C.js:790:19)
    at readQaScenarioExecutionConfig (suite-BW4kSK9C.js:795:9)
    at readRequiredDiscoveryRefs (suite-BW4kSK9C.js:2834:9)

---

function readRequiredDiscoveryRefs() {
    return readQaScenarioExecutionConfig("source-docs-discovery-report")?.requiredFiles ?? [
        "repo/qa/scenarios/index.md",
        "repo/extensions/qa-lab/src/suite.ts",
        "repo/docs/help/testing.md"
    ];
}

---

function readRequiredDiscoveryRefs() {
    try {
        return readQaScenarioExecutionConfig("source-docs-discovery-report")?.requiredFiles ?? [
            "repo/qa/scenarios/index.md",
            "repo/extensions/qa-lab/src/suite.ts",
            "repo/docs/help/testing.md"
        ];
    } catch {
        return [
            "repo/qa/scenarios/index.md",
            "repo/extensions/qa-lab/src/suite.ts",
            "repo/docs/help/testing.md"
        ];
    }
}
RAW_BUFFERClick to expand / collapse

Description

After updating to 2026.4.9, openclaw completion --write-state (and the automatic completion cache update during openclaw update) crashes with:

Error: qa scenario pack not found: qa/scenarios/index.md
    at readQaScenarioPack (suite-BW4kSK9C.js:754:27)
    at readQaScenarioById (suite-BW4kSK9C.js:790:19)
    at readQaScenarioExecutionConfig (suite-BW4kSK9C.js:795:9)
    at readRequiredDiscoveryRefs (suite-BW4kSK9C.js:2834:9)

Root cause

REQUIRED_DISCOVERY_REFS_LOWER (suite-BW4kSK9C.js:2840) is a module-level constant evaluated at import time. Its initializer calls readRequiredDiscoveryRefs(), which calls readQaScenarioById("source-docs-discovery-report").

readQaScenarioById throws when the scenario is not found, but the calling code uses optional chaining (?.) expecting undefined:

function readRequiredDiscoveryRefs() {
    return readQaScenarioExecutionConfig("source-docs-discovery-report")?.requiredFiles ?? [
        "repo/qa/scenarios/index.md",
        "repo/extensions/qa-lab/src/suite.ts",
        "repo/docs/help/testing.md"
    ];
}

The ?. and ?? fallback never execute because the exception is thrown before the return.

Two contributing factors:

  1. qa/scenarios/ is not shipped in the npm packagepackage.json files field includes dist/, docs/, assets/, skills/, but not qa/. The resolveRepoPath walk-up heuristic only works inside the development monorepo.

  2. The import chain is unavoidable during completioncompletion-cli registers all subclis → qa-cliapi-BPAYEtQE.jssuite-BW4kSK9C.js → module-level REQUIRED_DISCOVERY_REFS_LOWER → crash.

Suggested fix

Wrap the call in a try/catch so the existing fallback is actually reachable:

function readRequiredDiscoveryRefs() {
    try {
        return readQaScenarioExecutionConfig("source-docs-discovery-report")?.requiredFiles ?? [
            "repo/qa/scenarios/index.md",
            "repo/extensions/qa-lab/src/suite.ts",
            "repo/docs/help/testing.md"
        ];
    } catch {
        return [
            "repo/qa/scenarios/index.md",
            "repo/extensions/qa-lab/src/suite.ts",
            "repo/docs/help/testing.md"
        ];
    }
}

Alternatively, readQaScenarioById could return undefined instead of throwing when a scenario is missing, which would let the existing ?. chain work as intended.

Environment

  • OpenClaw: 2026.4.9 (0512059)
  • Platform: macOS (darwin, arm64)
  • Installed via: Homebrew
  • Node: v22.x

Additional context

The lossless-claw plugin update also fails during openclaw update with a stale bundle hash reference (install.runtime-C-Y4HAqX.js no longer exists in 2026.4.9 dist), but that resolves by running openclaw plugins update lossless-claw manually afterwards.

extent analysis

TL;DR

Wrap the call to readQaScenarioExecutionConfig in a try/catch block to allow the existing fallback to be reached when the scenario is not found.

Guidance

  • Identify the readRequiredDiscoveryRefs function in suite-BW4kSK9C.js and modify it to handle the exception thrown by readQaScenarioById.
  • Consider changing readQaScenarioById to return undefined instead of throwing when a scenario is missing, allowing the existing optional chaining to work as intended.
  • Verify that the completion cache update during openclaw update no longer crashes after applying the fix.
  • Be aware that the qa/scenarios/ directory is not included in the npm package, which may require additional changes to the package.json files field.

Example

function readRequiredDiscoveryRefs() {
    try {
        return readQaScenarioExecutionConfig("source-docs-discovery-report")?.requiredFiles ?? [
            "repo/qa/scenarios/index.md",
            "repo/extensions/qa-lab/src/suite.ts",
            "repo/docs/help/testing.md"
        ];
    } catch {
        return [
            "repo/qa/scenarios/index.md",
            "repo/extensions/qa-lab/src/suite.ts",
            "repo/docs/help/testing.md"
        ];
    }
}

Notes

The provided fix assumes that the fallback values are correct and should be used when the scenario is not found. Additional testing may be necessary to ensure that the fix does not introduce any new issues.

Recommendation

Apply the suggested workaround by wrapping the call to readQaScenarioExecutionConfig in a try/catch block, as this is a straightforward and effective solution to the problem.

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