Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(cli): register reconcile-links in CLI_ONLY so dispatch reaches its handler (#2900) (#2987)

Hanchen Qiuf815246eefc0
diff --git a/src/cli.ts b/src/cli.ts
index a23881671b..804d7dbf3c 100755
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -54,7 +54,7 @@ export function bigintToStringReplacer(_key: string, value: unknown): unknown {
}
// CLI-only commands that bypass the operation layer
-export const CLI_ONLY = new Set(['init', 'reinit-pglite', 'upgrade', 'post-upgrade', 'check-update', 'integrations', 'publish', 'check-backlinks', 'lint', 'report', 'import', 'export', 'files', 'embed', 'serve', 'call', 'config', 'doctor', 'migrate', 'eval', 'sync', 'extract', 'extract-conversation-facts', 'enrich', 'features', 'autopilot', 'graph-query', 'jobs', 'agent', 'apply-migrations', 'skillpack-check', 'skillpack', 'resolvers', 'integrity', 'repair-jsonb', 'orphans', 'sources', 'mounts', 'dream', 'check-resolvable', 'routing-eval', 'skillify', 'smoke-test', 'providers', 'storage', 'repos', 'code-def', 'code-refs', 'reindex', 'reindex-code', 'reindex-frontmatter', 'code-callers', 'code-callees', 'frontmatter', 'auth', 'friction', 'claw-test', 'book-mirror', 'takes', 'think', 'salience', 'anomalies', 'calibration', 'transcripts', 'models', 'remote', 'recall', 'forget', 'edges-backfill', 'cache', 'ze-switch', 'founder', 'brainstorm', 'lsd', 'schema', 'capture', 'onboard', 'conversation-parser', 'status', 'connect', 'skillopt', 'quarantine', 'self-upgrade', 'advisor', 'watch', 'reindex-search-vector']);
+export const CLI_ONLY = new Set(['init', 'reinit-pglite', 'upgrade', 'post-upgrade', 'check-update', 'integrations', 'publish', 'check-backlinks', 'lint', 'report', 'import', 'export', 'files', 'embed', 'serve', 'call', 'config', 'doctor', 'migrate', 'eval', 'sync', 'extract', 'extract-conversation-facts', 'enrich', 'features', 'autopilot', 'graph-query', 'jobs', 'agent', 'apply-migrations', 'skillpack-check', 'skillpack', 'resolvers', 'integrity', 'repair-jsonb', 'orphans', 'sources', 'mounts', 'dream', 'check-resolvable', 'routing-eval', 'skillify', 'smoke-test', 'providers', 'storage', 'repos', 'code-def', 'code-refs', 'reindex', 'reindex-code', 'reindex-frontmatter', 'code-callers', 'code-callees', 'reconcile-links', 'frontmatter', 'auth', 'friction', 'claw-test', 'book-mirror', 'takes', 'think', 'salience', 'anomalies', 'calibration', 'transcripts', 'models', 'remote', 'recall', 'forget', 'edges-backfill', 'cache', 'ze-switch', 'founder', 'brainstorm', 'lsd', 'schema', 'capture', 'onboard', 'conversation-parser', 'status', 'connect', 'skillopt', 'quarantine', 'self-upgrade', 'advisor', 'watch', 'reindex-search-vector']);
// CLI-only commands whose handlers print their own --help text. These are
// excluded from the generic short-circuit so detailed per-command and
// per-subcommand usage stays reachable.
diff --git a/test/reconcile-links-cli-reachability.test.ts b/test/reconcile-links-cli-reachability.test.ts
new file mode 100644
index 0000000000..7357d86c78
--- /dev/null
+++ b/test/reconcile-links-cli-reachability.test.ts
@@ -0,0 +1,21 @@
+/**
+ * #2900 — `reconcile-links` CLI reachability.
+ *
+ * `reconcile-links` is advertised in `gbrain --help` and fully implemented
+ * with a `case 'reconcile-links'` block in cli.ts's handleCliOnly switch, but
+ * it was missing from the CLI_ONLY Set. Dispatch only reaches handleCliOnly
+ * when the command is in CLI_ONLY, so every invocation fell through to the
+ * shared-operations lookup and hit the generic "Unknown command" branch —
+ * leaving the documented doc↔impl edge-rebuild tool silently unreachable.
+ *
+ * Same class of drift as #2035 (`calibration`).
+ */
+
+import { describe, test, expect } from 'bun:test';
+import { CLI_ONLY } from '../src/cli.ts';
+
+describe('CLI_ONLY command reachability (#2900)', () => {
+ test('`reconcile-links` is in CLI_ONLY so dispatch reaches its handler', () => {
+ expect(CLI_ONLY.has('reconcile-links')).toBe(true);
+ });
+});