openclaw - 💡(How to fix) Fix No tests for any of the 12 owned CLI program files [1 comments, 2 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#83895Fetched 2026-05-20 03:47:20
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
1
Timeline (top)
closed ×1commented ×1labeled ×1mentioned ×1

Error Message

The only test file associated with this feature (src/agents/context.test.ts) covers context-window resolution in the agents subsystem, not CLI program logic. None of the 12 owned files (action-reparse, build-program, command-descriptor-utils, command-group-descriptors, command-registry-core, command-registry, command-tree, config-guard, context, core-command-descriptors, error-output, help) have colocated *.test.ts files. The presence of __test__.resetConfigGuardStateForTests in config-guard.ts is a test seam with no consumers, indicating tests were planned but not written. Critical behaviors—config validation gating, error output formatting, command deduplication, argv reparsing—are entirely untested. Add colocated unit tests at minimum for config-guard.ts (cache behavior, allowlist enforcement, invalid-config exit), error-output.ts (each regex branch), command-descriptor-utils.ts (name sanitization, deduplication), and command-tree.ts (remove round-trip). Use the existing __test__ seam in config-guard for state reset. config-guard: test that ensureConfigReady exits with code 1 for an invalid config when the command is not in ALLOWED_INVALID_COMMANDS, and does not exit for allowed commands. error-output: table-driven tests for each regex branch (unknownCommand, unknownOption, missingArgument, missingOption, tooManyArguments, fallthrough). New colocated *.test.ts files for config-guard, error-output, command-descriptor-utils, and command-tree

Fix Action

Fix / Workaround

Severity: medium / Confidence: high / Category: test-gap Triage: test-gap Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18) Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol


Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID: fnd_sig-feat-cli-command-0f69ccd6ad-_6f9ee2d456.

Code Example

import { describe, expect, it, vi } from "vitest";
import {
  ANTHROPIC_CONTEXT_1M_TOKENS,
  applyConfiguredContextWindows,

---

export const __test__ = {
  resetConfigGuardStateForTests,
};
RAW_BUFFERClick to expand / collapse

Severity: medium / Confidence: high / Category: test-gap Triage: test-gap Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18) Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol

Evidence

  • src/agents/context.test.ts:1-10 (None)
import { describe, expect, it, vi } from "vitest";
import {
  ANTHROPIC_CONTEXT_1M_TOKENS,
  applyConfiguredContextWindows,
  • src/cli/program/config-guard.ts:140-142 (test)
export const __test__ = {
  resetConfigGuardStateForTests,
};

Reasoning

The only test file associated with this feature (src/agents/context.test.ts) covers context-window resolution in the agents subsystem, not CLI program logic. None of the 12 owned files (action-reparse, build-program, command-descriptor-utils, command-group-descriptors, command-registry-core, command-registry, command-tree, config-guard, context, core-command-descriptors, error-output, help) have colocated *.test.ts files. The presence of __test__.resetConfigGuardStateForTests in config-guard.ts is a test seam with no consumers, indicating tests were planned but not written. Critical behaviors—config validation gating, error output formatting, command deduplication, argv reparsing—are entirely untested.

Recommendation

Add colocated unit tests at minimum for config-guard.ts (cache behavior, allowlist enforcement, invalid-config exit), error-output.ts (each regex branch), command-descriptor-utils.ts (name sanitization, deduplication), and command-tree.ts (remove round-trip). Use the existing __test__ seam in config-guard for state reset.

Why existing tests miss this

No test files exist for these modules; the gap is the finding itself.

Suggested regression test

config-guard: test that ensureConfigReady exits with code 1 for an invalid config when the command is not in ALLOWED_INVALID_COMMANDS, and does not exit for allowed commands. error-output: table-driven tests for each regex branch (unknownCommand, unknownOption, missingArgument, missingOption, tooManyArguments, fallthrough).

Minimum fix scope

New colocated *.test.ts files for config-guard, error-output, command-descriptor-utils, and command-tree


Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID: fnd_sig-feat-cli-command-0f69ccd6ad-_6f9ee2d456.

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 No tests for any of the 12 owned CLI program files [1 comments, 2 participants]