Skip to content

fix(logging): reject blank diagnostic stability query fields - #145532

Merged
altaywtf merged 1 commit into
openclaw:mainfrom
hugenshen:cursor/fix-stability-blank-limit-e997
Oct 6, 2026
Merged

altaywtf merged 1 commit into
openclaw:mainfrom
hugenshen:cursor/fix-stability-blank-limit-e997

Conversation

@hugenshen

@hugenshen hugenshen commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Explicit blank stability-query fields silently selected defaults.

User Impact

Input Before After
Empty limit, sinceSeq, or type Treated as omitted Validation error
Omitted/null fields Defaults Unchanged
Valid values Filtered snapshot Unchanged

Callers using empty placeholders must omit unused fields instead.

Why This Change Was Made

Apply existing validation consistently across CLI, Gateway RPC, and bundle queries.

Evidence

  • Current-head recorder/RPC checks passed: 13.355s; changed-file suite: 3.947s. Reverted exemptions fail: 4.217s.
  • CI typecheck: 15m06s whole-job time.
  • Historical Gateway proof below shares the current parser; broader runtime identity is unverified.
Contributor’s historical running-Gateway proof

Running Gateway RPC proof

Captured against historical revision 6e8c092b743aa4ff3890372899993dca8aa9d6c6 through a running isolated Gateway (temp HOME/state, loopback token-auth; token redacted). Method: WebSocket RPC diagnostics.stability via callGateway / GatewayClient (bypasses CLI pre-validation so the Gateway parser path is exercised).

$ git rev-parse HEAD
6e8c092b743aa4ff3890372899993dca8aa9d6c6

# Gateway ready on ws://127.0.0.1:<PORT> (isolated HOME/state)

### A) explicit blank limit ""
$ GatewayClient.request("diagnostics.stability", {"limit":""})
{
  "ok": false,
  "error": {
    "type": "gateway_request_error",
    "code": "INVALID_REQUEST",
    "message": "limit must be a non-negative integer",
    "retryable": false
  }
}

### B) explicit blank type ""
$ GatewayClient.request("diagnostics.stability", {"type":""})
{
  "ok": false,
  "error": {
    "type": "gateway_request_error",
    "code": "INVALID_REQUEST",
    "message": "type must be a non-empty string",
    "retryable": false
  }
}

### C) explicit blank sinceSeq ""
$ GatewayClient.request("diagnostics.stability", {"sinceSeq":""})
{
  "ok": false,
  "error": {
    "type": "gateway_request_error",
    "code": "INVALID_REQUEST",
    "message": "sinceSeq must be a non-negative integer",
    "retryable": false
  }
}

### D) omitted-field control {}
$ GatewayClient.request("diagnostics.stability", {})
{
  "ok": true,
  "capacity": 1000,
  "count": 42,
  "firstSeq": 50,
  "lastSeq": 94,
  "eventCount": 42
}

Outcome: explicit blank limit / type / sinceSeq → Gateway INVALID_REQUEST validation errors; omitted fields → success snapshot (defaults applied). No stored-data contract changes.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 12:44 PM ET / 16:44 UTC (Revision 16).

ClawSweeper review

What this changes

The PR rejects empty diagnostic query fields for event limits, sequence filters, and event types, and adds regression coverage.

Merge readiness

✅ Ready for maintainer review

The PR remains useful: current main and the latest release still accept explicit empty fields. No actionable patch defect remains, and the maintainer’s acceptance covers the compatibility change.

Priority: P2
Reviewed head: 12a07913cbb6f5b568930abcfeb0d61416928082

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct patch with relevant Gateway proof, regression coverage, and an explicitly accepted compatibility tradeoff.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The historical running-Gateway transcript exercises the shared parser through real diagnostics.stability RPC requests: all three empty fields return INVALID_REQUEST and omitted fields succeed. Inspected historical source preserves the relevant runtime branches at the updated head; current-head regression/revert checks supplement that proof. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The historical running-Gateway transcript exercises the shared parser through real diagnostics.stability RPC requests: all three empty fields return INVALID_REQUEST and omitted fields succeed. Inspected historical source preserves the relevant runtime branches at the updated head; current-head regression/revert checks supplement that proof. No stored-data contract changes.
Evidence reviewed 10 items Verified introduced patch: The pinned introduction removes only the two empty-string exemptions and adds regression assertions for blank query values; it introduces no alternate parser or unrelated production changes.
Still necessary on current main: Current main explicitly treats empty strings as omitted for numeric fields and event type; the requested validation is therefore not already implemented.
Released behavior: The supplied latest release, v2026.9.8, contains the same empty-string exemptions. This PR changes a released input alias rather than repairing behavior already shipped elsewhere.
Findings None None.
Security None None.

How this fits together

OpenClaw’s stability recorder collects bounded operational diagnostics. CLI commands, Gateway RPC requests, and saved-bundle queries share a parser that validates filters before returning diagnostic snapshots.

flowchart TD
  A[CLI query] --> D[Shared query validation]
  B[Gateway RPC request] --> D
  C[Saved bundle query] --> D
  D --> E{Valid fields?}
  E -->|No| F[Validation error]
  E -->|Yes| G[Filtered diagnostic snapshot]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +15. Total +15 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 1 15 0 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 17 2 +15

Review metrics

None.

Technical review

Best possible solution:

Keep one shared parser that rejects explicit blanks, preserves omitted/null defaults, and reports clear validation errors across diagnostic entrypoints.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes that current-main diagnostics.stability requests with empty limit, sinceSeq, or type select defaults instead of rejecting them. This read-only review did not execute that path.

Is this the best way to solve the issue?

Yes, removing the exemptions in the existing shared parser is the narrowest repair; the maintainer has accepted the resulting external-caller adjustment.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 817706084620.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded diagnostic-input validation improvement with limited user impact.
  • merge-risk: 🚨 compatibility: External callers using released empty-string placeholders must omit those fields; the maintainer explicitly accepted this exact tradeoff.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The historical running-Gateway transcript exercises the shared parser through real diagnostics.stability RPC requests: all three empty fields return INVALID_REQUEST and omitted fields succeed. Inspected historical source preserves the relevant runtime branches at the updated head; current-head regression/revert checks supplement that proof. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The historical running-Gateway transcript exercises the shared parser through real diagnostics.stability RPC requests: all three empty fields return INVALID_REQUEST and omitted fields succeed. Inspected historical source preserves the relevant runtime branches at the updated head; current-head regression/revert checks supplement that proof. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit a08f241 adds src/logging/diagnostic-stability-query.ts:56 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a08f2411e985; files: src/logging/diagnostic-stability-query.ts)
  • Vincent Koc: Raw commit 904f9c0 adds src/logging/diagnostic-stability-query.ts:59 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 904f9c03a317; files: src/logging/diagnostic-stability-query.ts)
  • altaywtf: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-24T02:17:05.511Z sha 7a7f561cf79081c3aa9fe5641e73a38f895e2fe5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-24T02:55:48.477Z sha b2607b4e350bd7fd45cce88e5a8fcc752d26d1b2 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-24T03:06:09.226Z sha 93239595128e3d4f89c5a3d21c6177751c496c4b :: blocked before merge. :: none
  • reviewed 2026-09-24T03:56:16.702Z sha 6e8c092b743aa4ff3890372899993dca8aa9d6c6 :: blocked before merge. :: none
  • reviewed 2026-09-24T04:53:13.329Z sha 87d02f9bb896a88605a23af20febd5c447c23ca7 :: blocked before merge. :: none
  • reviewed 2026-09-24T06:52:48.127Z sha b8e03706b82fb08ff5a50fefa1eef922a194597f :: blocked before merge. :: none
  • reviewed 2026-10-05T09:45:58.597Z sha b8e03706b82fb08ff5a50fefa1eef922a194597f :: blocked before merge. :: none
  • reviewed 2026-10-06T13:59:52.771Z sha b8e03706b82fb08ff5a50fefa1eef922a194597f :: needs maintainer review before merge. :: none

@cursor
cursor Bot force-pushed the cursor/fix-stability-blank-limit-e997 branch from 19bf48f to 712c6f8 Compare September 12, 2026 03:07
@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added exact-head real behavior proof to the PR body (RED→GREEN CLI/Gateway transcripts). Please re-evaluate the needs-proof gate.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 12, 2026
@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the PR body with the additional exact-head real CLI controls you requested. Please re-check the needs-proof gate.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 12, 2026
@hugenshen
hugenshen force-pushed the cursor/fix-stability-blank-limit-e997 branch from 712c6f8 to d734dfc Compare September 15, 2026 01:55
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 23, 2026
@hugenshen
hugenshen force-pushed the cursor/fix-stability-blank-limit-e997 branch from d734dfc to b437312 Compare September 24, 2026 02:07
@hugenshen
hugenshen force-pushed the cursor/fix-stability-blank-limit-e997 branch from b437312 to fef7413 Compare September 24, 2026 02:08
@hugenshen
hugenshen force-pushed the cursor/fix-stability-blank-limit-e997 branch 2 times, most recently from 7a7f561 to b2607b4 Compare September 24, 2026 02:48
@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact-head running-Gateway RPC proof added for diagnostics.stability:

  • explicit blank limit / type / sinceSeq → INVALID_REQUEST validation errors
  • omitted-field control {} → success snapshot

Remade onto latest upstream/main (881ad1ca49d8) as b2607b4e350 (prior CI red was unrelated flake in server.agent-database-recreation-product-proof.test.ts). Focused vitest 23/23 green. PR body Evidence refreshed with the new SHA + Gateway RPC transcripts.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@hugenshen
hugenshen force-pushed the cursor/fix-stability-blank-limit-e997 branch from b2607b4 to 9323959 Compare September 24, 2026 02:59
@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Remade again onto latest upstream/main 4f6eb26b1beda60044ee9b94cd352f37c63718e9 (was b2607b4e350bd7fd45cce88e5a8fcc752d26d1b2 on 881ad1ca49d8) for unrelated CI flakes outside this PR's logging files:

  • checks-node-changed-compact-large-31: src/agents/harness/context-engine-turn-maintenance.test.ts mock call count
  • checks-node-changed-compact-large-44: src/agents/embedded-agent-runner/compact.foreground-resources.test.ts timing (expected 72… to be less than 50)

New exact head: 93239595128e3d4f89c5a3d21c6177751c496c4b (still 1 squashed commit; same 2 files).

Refreshed running Gateway diagnostics.stability RPC proof at exact head (isolated temp HOME, loopback):

  • blank limit / type / sinceSeq → INVALID_REQUEST
  • omitted {} → success snapshot

Focused vitest diagnostic-stability.test.ts: 23/23 passed. Evidence section updated with new SHA + Gateway proof (CLI-path section labeled CLI-only).

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 24, 2026
@hugenshen
hugenshen force-pushed the cursor/fix-stability-blank-limit-e997 branch from 9323959 to 6e8c092 Compare September 24, 2026 03:47

Copy link
Copy Markdown

@clawsweeper re-review

Exact-head remade onto upstream/main 048cc4ec481af17d20a027f895c13ccef8fb6095 (prior head 93239595128e had unrelated CI flakes: context-engine-turn-maintenance + compact.foreground-resources timing).

New product head: 6e8c092b743aa4ff3890372899993dca8aa9d6c6 (still 1 squashed commit / same 2 files).

Refreshed exact-head running-Gateway diagnostics.stability RPC proof (blank limit/type/sinceSeq → INVALID_REQUEST; omitted {} → success). Focused vitest 23/23. PR body Evidence section updated.

1 similar comment
@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Exact-head remade onto upstream/main 048cc4ec481af17d20a027f895c13ccef8fb6095 (prior head 93239595128e had unrelated CI flakes: context-engine-turn-maintenance + compact.foreground-resources timing).

New product head: 6e8c092b743aa4ff3890372899993dca8aa9d6c6 (still 1 squashed commit / same 2 files).

Refreshed exact-head running-Gateway diagnostics.stability RPC proof (blank limit/type/sinceSeq → INVALID_REQUEST; omitted {} → success). Focused vitest 23/23. PR body Evidence section updated.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@hugenshen
hugenshen force-pushed the cursor/fix-stability-blank-limit-e997 branch 3 times, most recently from 4dd2654 to b8e0370 Compare September 24, 2026 06:45
@altaywtf

altaywtf commented Oct 6, 2026

Copy link
Copy Markdown
Member

@clawsweeper re-review

I reviewed the blank-field compatibility concern and am retaining the validation change. Callers should omit unused limit, sinceSeq, and type fields; explicitly empty strings now return validation errors.

The released parser accepted empty placeholders, but the documented numeric/event-type contract does not promise that alias and bundled callers omit unused values. External callers relying on empty strings need that adjustment. Omitted/null fields and valid values keep their behavior.

The updated body distinguishes historical Gateway proof from current-head checks and records measured execution time. No merge requested.

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Reject blank diagnostic stability query fields so invalid limit/type/sinceSeq cannot slip through.
@altaywtf
altaywtf force-pushed the cursor/fix-stability-blank-limit-e997 branch from b8e0370 to 12a0791 Compare October 6, 2026 16:30
@altaywtf

altaywtf commented Oct 6, 2026

Copy link
Copy Markdown
Member

@clawsweeper re-review

Rebased onto current main. Independent P0–P2 review is clean; fresh Linux regression tests, formatting, and lint pass. Please review the updated head.

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@altaywtf
altaywtf merged commit edb858f into openclaw:main Oct 6, 2026
114 checks passed
@altaywtf

altaywtf commented Oct 6, 2026

Copy link
Copy Markdown
Member

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 6, 2026
* commit 'c39d9b0692dbaafa5b1bfe02514c9f6411ab5546': (30 commits)
  fix(ci): clear MCP audit and service-worker test blockers (#166217)
  test(gateway): wait for steering admission in FIFO fixtures
  fix(llama-cpp): managed setup crashes and loops on macOS below 13.3 (#163358)
  perf(worktrees): avoid full session parsing during GC (#166072)
  fix(update): recover stopped legacy managed services (#166232)
  perf(gateway): stream bounded link preview metadata (#166195)
  perf(diagnostics): release completed Git operation state (#166214)
  chore(deps): update fs-safe to 0.24.1 and clone plugin source captures (#166189)
  feat(clients): adopt worker-local inference placement (#163647)
  test: serialize PowerShell completion process suites (#166229)
  test: stabilize release timing boundaries (#166218)
  refactor(sessions): persist run outcomes only; liveness comes from the run registry (#165733)
  test(gateway): prove mention refresh after config retargeting
  fix(team-reports): keep the missed closed day when catch-up runs after midnight (#165780)
  test(gateway): join WebChat queue admission and drain completion
  fix(logging): reject blank diagnostic stability query fields (#145532)
  fix(agents): report unparseable serialized edit arguments (#163577)
  improve(anthropic): log Claude Code version probe failures (#157697)
  fix(agents): clarify prompt-size provider failures (#159712)
  fix(memory): re-throw non-ENOENT/ENOTDIR errors in root memory file lookup (#107921)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…w#145532)

Reject blank diagnostic stability query fields so invalid limit/type/sinceSeq cannot slip through.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants