openclaw - ✅(Solved) Fix Bug: proxy sessions --limit abc crashes with SQLite datatype mismatch [1 pull requests, 2 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#84253Fetched 2026-05-20 03:42:06
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
1
Author
Timeline (top)
labeled ×6commented ×2cross-referenced ×1

Error Message

[openclaw] Reason: datatype mismatch [openclaw] Stack: [openclaw] Error: datatype mismatch [openclaw] at DebugProxyCaptureStore.listSessions (.../src/proxy-capture/store.sqlite.ts:211:8) [openclaw] at Module.runDebugProxySessionsCommand (.../src/cli/proxy-cli.runtime.ts:294:81) [openclaw] at Command.<anonymous> (.../src/cli/proxy-cli.ts:113:21)

Fix Action

Fix / Workaround

The CLI should reject invalid debug proxy numeric options before runtime dispatch, with an argument error such as --limit must be a positive integer, and it should not expose the SQLite implementation error.

PR fix notes

PR #84260: fix(cli): validate debug proxy numeric options

Description (problem / solution / changelog)

Summary

  • Reject invalid debug proxy numeric CLI options before runtime dispatch
  • Keep --port bounded to an integer 0-65535
  • Require positive integers for proxy validate --timeout-ms and proxy sessions --limit
  • Add Commander-level regression coverage for bad proxy numeric values

Fixes #84253

Real behavior proof

Behavior or issue addressed: openclaw proxy sessions --limit abc should fail as an invalid CLI argument instead of reaching the debug proxy SQLite store and surfacing datatype mismatch.

Real environment tested: Fresh OpenClaw source checkout rebased onto current origin/main on macOS, using the real source CLI entry with isolated debug-proxy DB/blob/cert paths under /tmp.

Exact steps or command run after this patch:

env OPENCLAW_DEBUG=1 OPENCLAW_DEBUG_PROXY_DB_PATH=/tmp/openclaw-proxy-proof-rebased-invalid.sqlite OPENCLAW_DEBUG_PROXY_BLOB_DIR=/tmp/openclaw-proxy-proof-rebased-invalid-blobs OPENCLAW_DEBUG_PROXY_CERT_DIR=/tmp/openclaw-proxy-proof-rebased-invalid-certs NO_COLOR=1 pnpm exec tsx src/entry.ts proxy sessions --limit abc

Evidence after fix:

OpenClaw could not parse this command: option '--limit <count>' argument 'abc' is invalid. --limit must be an integer.
Try: openclaw proxy sessions --help

Observed result after fix: The invalid --limit abc value is rejected by the CLI parser before runDebugProxySessionsCommand() calls DebugProxyCaptureStore.listSessions(), so the SQLite datatype mismatch no longer leaks to the user. A valid command still works:

env OPENCLAW_DEBUG=1 OPENCLAW_DEBUG_PROXY_DB_PATH=/tmp/openclaw-proxy-proof-rebased-valid.sqlite OPENCLAW_DEBUG_PROXY_BLOB_DIR=/tmp/openclaw-proxy-proof-rebased-valid-blobs OPENCLAW_DEBUG_PROXY_CERT_DIR=/tmp/openclaw-proxy-proof-rebased-valid-certs NO_COLOR=1 pnpm exec tsx src/entry.ts proxy sessions --limit 1
[]

What was not tested: I did not rebuild the packaged dist/entry.js launcher in this source worktree; proof used the real TypeScript source CLI entry. I also did not connect through a live debug proxy, because the changed behavior is argument parsing before proxy runtime startup.

Before-fix evidence

On fresh origin/main (e00cb664ad), the same actual source CLI path accepted the invalid value far enough to hit SQLite:

env OPENCLAW_DEBUG=1 OPENCLAW_DEBUG_PROXY_DB_PATH=/tmp/openclaw-proxy-proof-2.sqlite OPENCLAW_DEBUG_PROXY_BLOB_DIR=/tmp/openclaw-proxy-proof-2-blobs OPENCLAW_DEBUG_PROXY_CERT_DIR=/tmp/openclaw-proxy-proof-2-certs NO_COLOR=1 pnpm exec tsx src/entry.ts proxy sessions --limit abc
[openclaw] Reason: datatype mismatch
[openclaw] Stack:
[openclaw] Error: datatype mismatch
[openclaw]     at DebugProxyCaptureStore.listSessions (.../src/proxy-capture/store.sqlite.ts:211:8)
[openclaw]     at Module.runDebugProxySessionsCommand (.../src/cli/proxy-cli.runtime.ts:294:81)

Checks

  • pnpm test src/cli/proxy-cli.test.ts
  • pnpm exec oxfmt --check --threads=1 src/cli/proxy-cli.ts src/cli/proxy-cli.test.ts
  • git diff --check origin/main...HEAD
  • git merge-tree --write-tree HEAD origin/main
  • pnpm check:changed

Collision checks

Before filing and again immediately before publishing, I searched open issues and PRs for:

  • datatype mismatch proxy
  • proxy sessions --limit
  • debug proxy sessions limit
  • store.sqlite listSessions

No open PR covered this debug-proxy CLI option-validation path.

Changed files

  • src/cli/proxy-cli.test.ts (modified, +24/-0)
  • src/cli/proxy-cli.ts (modified, +34/-10)

Code Example

env OPENCLAW_DEBUG=1 OPENCLAW_DEBUG_PROXY_DB_PATH=/tmp/openclaw-proxy-proof-2.sqlite OPENCLAW_DEBUG_PROXY_BLOB_DIR=/tmp/openclaw-proxy-proof-2-blobs OPENCLAW_DEBUG_PROXY_CERT_DIR=/tmp/openclaw-proxy-proof-2-certs NO_COLOR=1 pnpm exec tsx src/entry.ts proxy sessions --limit abc

---

[openclaw] Reason: datatype mismatch
[openclaw] Stack:
[openclaw] Error: datatype mismatch
[openclaw]     at DebugProxyCaptureStore.listSessions (.../src/proxy-capture/store.sqlite.ts:211:8)
[openclaw]     at Module.runDebugProxySessionsCommand (.../src/cli/proxy-cli.runtime.ts:294:81)
[openclaw]     at Command.<anonymous> (.../src/cli/proxy-cli.ts:113:21)

---

env OPENCLAW_DEBUG=1 OPENCLAW_DEBUG_PROXY_DB_PATH=/tmp/openclaw-proxy-proof-3.sqlite OPENCLAW_DEBUG_PROXY_BLOB_DIR=/tmp/openclaw-proxy-proof-3-blobs OPENCLAW_DEBUG_PROXY_CERT_DIR=/tmp/openclaw-proxy-proof-3-certs NO_COLOR=1 pnpm exec tsx src/entry.ts proxy sessions --limit 1
[]
RAW_BUFFERClick to expand / collapse

Observed problem

openclaw proxy sessions --limit abc accepts the invalid numeric option far enough to reach the debug proxy SQLite store, then fails with a low-level datatype mismatch instead of rejecting the CLI argument.

Current behavior on upstream main

Fresh origin/main at e00cb664ad in a clean worktree:

env OPENCLAW_DEBUG=1 OPENCLAW_DEBUG_PROXY_DB_PATH=/tmp/openclaw-proxy-proof-2.sqlite OPENCLAW_DEBUG_PROXY_BLOB_DIR=/tmp/openclaw-proxy-proof-2-blobs OPENCLAW_DEBUG_PROXY_CERT_DIR=/tmp/openclaw-proxy-proof-2-certs NO_COLOR=1 pnpm exec tsx src/entry.ts proxy sessions --limit abc

Output ends with:

[openclaw] Reason: datatype mismatch
[openclaw] Stack:
[openclaw] Error: datatype mismatch
[openclaw]     at DebugProxyCaptureStore.listSessions (.../src/proxy-capture/store.sqlite.ts:211:8)
[openclaw]     at Module.runDebugProxySessionsCommand (.../src/cli/proxy-cli.runtime.ts:294:81)
[openclaw]     at Command.<anonymous> (.../src/cli/proxy-cli.ts:113:21)

Control proof that the actual command path works when the value is valid:

env OPENCLAW_DEBUG=1 OPENCLAW_DEBUG_PROXY_DB_PATH=/tmp/openclaw-proxy-proof-3.sqlite OPENCLAW_DEBUG_PROXY_BLOB_DIR=/tmp/openclaw-proxy-proof-3-blobs OPENCLAW_DEBUG_PROXY_CERT_DIR=/tmp/openclaw-proxy-proof-3-certs NO_COLOR=1 pnpm exec tsx src/entry.ts proxy sessions --limit 1
[]

Expected behavior

The CLI should reject invalid debug proxy numeric options before runtime dispatch, with an argument error such as --limit must be a positive integer, and it should not expose the SQLite implementation error.

Duplicate searches performed

I searched open issues and PRs for:

  • datatype mismatch proxy
  • proxy sessions --limit
  • debug proxy sessions limit
  • store.sqlite listSessions

No open issue or PR covered this option-validation path. The closest issue search result was #79854, which is about session history metadata and unrelated to debug proxy sessions.

Candidate fix shape

Tighten the debug proxy CLI option parsers in src/cli/proxy-cli.ts so:

  • proxy sessions --limit accepts only positive integers
  • proxy validate --timeout-ms accepts only positive integers
  • proxy start/run --port rejects non-integer or out-of-range ports before starting the proxy

Then add focused CLI parser tests and rerun the actual CLI repro.

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 CLI should reject invalid debug proxy numeric options before runtime dispatch, with an argument error such as --limit must be a positive integer, and it should not expose the SQLite implementation error.

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 - ✅(Solved) Fix Bug: proxy sessions --limit abc crashes with SQLite datatype mismatch [1 pull requests, 2 comments, 2 participants]