🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

fix: audit-health JSON timeouts and partial results on large stores#1214

Merged
markus-lassfolk merged 8 commits into
mainfrom
claude/fix-audit-health-hang-issue
May 8, 2026
Merged

fix: audit-health JSON timeouts and partial results on large stores#1214
markus-lassfolk merged 8 commits into
mainfrom
claude/fix-audit-health-hang-issue

Conversation

@Claude

@Claude Claude AI commented May 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Bug: audit-health JSON command can hang without output on long-lived store</issue_title>
<issue_description>## Summary

On a long-lived Maeve instance, openclaw hybrid-mem audit-health --format json hung without producing output and had to be terminated after >30 seconds during a read-only maintenance audit.

This makes the new operator-facing audit/health surface hard to use in cron/watchdog contexts unless callers wrap it in an external timeout, and it can mask the same maintenance-health problems the command is meant to surface.

Environment / evidence

Host: Maeve / /home/markus/.openclaw
Plugin version observed in doctor/logs: openclaw-hybrid-memory v2026.5.70, memory-manager 3.0
OpenClaw version observed in logs: OpenClaw 2026.5.4 (325df3e)

Read-only audit date: 2026-05-08 UTC.

Command attempted:

openclaw hybrid-mem audit-health --format json

Observed behaviour:

  • no JSON output within >30 seconds
  • process was manually terminated by the audit runner
  • no destructive/fix action was requested

Related context from same audit:

Expected behaviour

For --format json, the command should be operator/cron-safe:

  • emit progress only to stderr, if any
  • emit valid JSON to stdout
  • complete within a bounded time or fail with a clear non-zero exit and machine-readable error
  • ideally support explicit timeout/section limits for expensive checks

Suggested fixes

  • Add per-section time budgets or skip/partial-report semantics.
  • Include a top-level status: "partial" | "failed" | "ok" and errors[] array in JSON output when a section times out.
  • Ensure any expensive LanceDB/graph/entity scans are bounded by default.
  • Add a regression test or smoke test for audit-health --format json completing on a synthetic larger store.

Acceptance criteria

  • openclaw hybrid-mem audit-health --format json completes or fails cleanly under a documented timeout on a large/long-lived store.
  • Cron callers can distinguish ok, partial, and failed from exit code and JSON.
  • No path leaves the command hanging indefinitely without output.

Priority

priority: medium — operator reliability / cron safety.
</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

Claude AI and others added 2 commits May 8, 2026 07:36
- Add `status` field ("ok"|"partial"|"failed") and `errors` array to AuditHealthReport schema
- Keep backward-compatible `ok` field (deprecated)
- Add 5000-row LIMIT to implicitFeedbackPrefixHistogram query to prevent scanning huge fact tables
- Wrap prefix histogram in try-catch with error tracking
- Add 5-second timeout for LanceDB size calculation (getStorageSizes)
- Update strict mode to check both status and ok fields
- Update markdown printer to show errors section
- Update tests to validate new schema fields

Fixes hang on long-lived stores by bounding expensive operations.

Agent-Logs-Url: https://github.com/markus-lassfolk/openclaw-hybrid-memory/sessions/64bfcd5d-27d4-4a78-b223-6142f3a0b1ab

Co-authored-by: markus-lassfolk <3661143+markus-lassfolk@users.noreply.github.com>
Ralph and others added 2 commits May 8, 2026 11:40
- Pin CI/security to Node 22.16 (node:sqlite + FTS5, nodejs/node#57621)
- engines, .nvmrc, docs: require >=22.16.0; sync verify/maintenance copy
- Tests: storageGrowth null handling; EventLog CHECK relaxed
- CHANGELOG [Unreleased]: Node requirement under Changed

Co-authored-by: Cursor <cursoragent@cursor.com>
@markus-lassfolk markus-lassfolk changed the title [WIP] Fix audit-health JSON command hanging on long-lived store fix: audit-health JSON timeouts and partial results on large stores May 8, 2026
@markus-lassfolk markus-lassfolk marked this pull request as ready for review May 8, 2026 09:41
Copilot AI review requested due to automatic review settings May 8, 2026 09:41
@github-actions github-actions Bot added documentation Improvements or additions to documentation extensions github-actions packages labels May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Forge Feedback Loop

  • PR: fix: audit-health JSON timeouts and partial results on large stores #1214
  • Branch: claude/fix-audit-health-hang-issue
  • Head SHA: b3e45130268e5c515a11554579ea63a4d651ad28
  • Failed checks: 0
  • New PR comments since latest push: 0
  • New review summaries since latest push: 0
  • Unresolved review threads: 0
  • Status: ready for auto-merge checks
  • Reasons: none
  • Dispatch: skipped because CI is green and no open human feedback remains.

@github-actions github-actions Bot added the size/M label May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Changed Files Summary

Source (4)

  • extensions/memory-hybrid/cli/commands/manage/register-storage-and-stats.ts
  • extensions/memory-hybrid/cli/context.ts
  • extensions/memory-hybrid/cli/register.ts
  • extensions/memory-hybrid/setup/cli-context.ts

Tests (2)

  • extensions/memory-hybrid/tests/audit-health-cli.test.ts
  • extensions/memory-hybrid/tests/event-log.test.ts

Docs (1)

  • CHANGELOG.md

Total: 7 files changed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6accf8f712

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/memory-hybrid/cli/commands/manage/register-storage-and-stats.ts Outdated
Comment thread extensions/memory-hybrid/cli/commands/manage/register-storage-and-stats.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves operator reliability of the hybrid-mem audit-health CLI JSON output on large/long-lived stores by introducing bounded work (timeouts/limits) and adding machine-readable partial-result metadata, while also bumping the project’s minimum supported Node.js version to 22.16.0 for node:sqlite/FTS5 support.

Changes:

  • Add status and errors[] fields to the audit-health JSON report and surface errors in markdown output.
  • Bound potentially expensive audit-health work (row cap for implicit-feedback prefix scan; 5s timeout wrapper around LanceDB size probing).
  • Update Node.js minimum version to >=22.16.0 across engines, CI, docs, and related tests/messages.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Updates Node.js version badge to 22.16.0 minimum.
packages/openclaw-hybrid-memory-install/package.json Bumps Node.js engine requirement to >=22.16.0.
package.json Bumps root Node.js engine requirement to >=22.16.0.
extensions/memory-hybrid/tests/maintenance-log-analyzer.test.ts Updates expected Node.js minimum version text in classification tests.
extensions/memory-hybrid/tests/event-log.test.ts Adjusts expectation for relaxed event_type enforcement (no CHECK constraint).
extensions/memory-hybrid/tests/audit-health-cli.test.ts Extends audit-health JSON schema assertions to include status and errors, and tightens storageGrowth assertions.
extensions/memory-hybrid/services/maintenance-rules.json Updates operator guidance to Node.js >=22.16.0.
extensions/memory-hybrid/README.md Updates documented Node.js requirement to >=22.16.0.
extensions/memory-hybrid/package.json Bumps Node.js engine requirement to >=22.16.0.
extensions/memory-hybrid/package-lock.json Updates lockfile metadata (version/engines) to match Node.js requirement and package version.
extensions/memory-hybrid/cli/commands/manage/register-storage-and-stats.ts Implements audit-health partial/error reporting, caps an expensive query, and wraps LanceDB sizing in a timeout.
extensions/memory-hybrid/cli/cmd-verify.ts Updates Node.js-related verification guidance to >=22.16.0.
docs/QUICKSTART.md Updates onboarding Node.js requirement to >=22.16.0.
CHANGELOG.md Documents audit-health reliability changes and Node.js minimum bump.
.nvmrc Updates the pinned Node.js version to 22.16.0.
.github/workflows/security.yml Updates workflow Node.js version to 22.16.
.github/workflows/ci.yml Updates CI Node.js versions/caching keys from 22.12 to 22.16.
Files not reviewed (1)
  • extensions/memory-hybrid/package-lock.json: Language not supported

Comment thread extensions/memory-hybrid/cli/commands/manage/register-storage-and-stats.ts Outdated
Comment thread extensions/memory-hybrid/tests/event-log.test.ts Outdated
Comment thread CHANGELOG.md Outdated
…gelog ref

- Derive partial status when warnings or report errors exist; align legacy ok flag.
- Record LanceDB du timeout in report.errors; kill du via execFile timeout.
- Rename misleading EventLog test describe; changelog references #1214.

Co-authored-by: Cursor <cursoragent@cursor.com>
@markus-lassfolk markus-lassfolk enabled auto-merge (squash) May 8, 2026 10:14
@github-actions github-actions Bot added size/L and removed size/M labels May 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1da6cf32c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/memory-hybrid/cli/commands/manage/register-storage-and-stats.ts Outdated
Ralph and others added 2 commits May 8, 2026 13:25
@markus-lassfolk markus-lassfolk merged commit fea2dcb into main May 8, 2026
10 checks passed
@markus-lassfolk markus-lassfolk deleted the claude/fix-audit-health-hang-issue branch May 8, 2026 16:44
@github-actions github-actions Bot added size/M and removed size/L labels May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: audit-health JSON command can hang without output on long-lived store

3 participants