Skip to content

fix(memory): discard stdout for qmd update/embed to prevent output cap failure#28900

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
Glucksberg:fix/issue-24966
Mar 1, 2026
Merged

fix(memory): discard stdout for qmd update/embed to prevent output cap failure#28900
Takhoffman merged 2 commits intoopenclaw:mainfrom
Glucksberg:fix/issue-24966

Conversation

@Glucksberg
Copy link
Contributor

Summary

Test plan

  • Run pnpm vitest run src/memory/qmd-manager.test.ts
  • Verify regression test with 300K+ stdout passes

🤖 Generated with Claude Code

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Adds discardOutput option to the runQmd method that prevents accumulation of stdout while preserving stderr for diagnostics, then applies it to qmd update and qmd embed commands to prevent failures when large QMD indexes produce output exceeding the 200K character limit.

  • Modified runQmd to accept discardOutput boolean option that drains stdout without accumulating
  • Applied discardOutput: true to all update and embed command calls (3 total call sites)
  • stderr continues to be captured for error diagnostics regardless of discard setting
  • Added regression test verifying sync succeeds with 300K+ character stdout output

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is clean and focused, adds an optional parameter that doesn't affect existing behavior, and includes proper test coverage. The change only affects the specific commands (update/embed) that produce large output, while preserving normal behavior for other commands (search, collection operations). The regression test properly validates the fix with output exceeding the limit.
  • No files require special attention

Last reviewed commit: d6f2769

@chatgpt-codex-connector
Copy link

You have reached your Codex rate limits. Please try again later.

2 similar comments
@chatgpt-codex-connector
Copy link

You have reached your Codex rate limits. Please try again later.

@chatgpt-codex-connector
Copy link

You have reached your Codex rate limits. Please try again later.

@aisle-research-bot
Copy link

aisle-research-bot bot commented Mar 1, 2026

🔒 Aisle Security Analysis

✅ We scanned this PR and did not find any security vulnerabilities.

Aisle supplements but does not replace security review.


Analyzed PR: #28900 at commit 86fde69

Last updated on: 2026-03-01T18:17:36Z

Copy link

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

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: f653f60b52

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1088 to +1089
if (discard) {
return; // drain without accumulating

Choose a reason for hiding this comment

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

P2 Badge Keep stdout diagnostics on failed discard-output runs

Dropping all stdout when discardOutput is enabled means qmd update/embed failures can lose their only diagnostic text, even though the error path still formats messages as stderr || stdout. In the case where QMD exits non-zero but reports the error on stdout, the thrown message becomes empty and downstream recovery checks like tryRepairNullByteCollections cannot detect ENOTDIR/NUL markers from the process output, so automatic repair can be skipped. Preserve a bounded stdout tail for failure paths instead of discarding it completely.

Useful? React with 👍 / 👎.

Copy link

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

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: 86fde69f7a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

await this.runQmd(["update"], { timeoutMs: this.qmd.update.updateTimeoutMs });
await this.runQmd(["update"], {
timeoutMs: this.qmd.update.updateTimeoutMs,
discardOutput: true,

Choose a reason for hiding this comment

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

P2 Badge Preserve stdout text for failed qmd update repair checks

Passing discardOutput: true into runQmd(["update"]) drops stdout entirely, so a non-zero update that reports errors on stdout now throws with an empty detail string (stderr || stdout becomes empty). That breaks tryRepairNullByteCollections, which classifies recoverable ENOTDIR/null-byte failures from the thrown message and therefore may skip the one-time collection rebuild/retry path. Fresh evidence: both update attempts in runQmdUpdateOnce now set discardOutput: true, so there is no fallback attempt that preserves stdout for this classifier.

Useful? React with 👍 / 👎.

@Takhoffman Takhoffman merged commit 1342962 into openclaw:main Mar 1, 2026
25 of 26 checks passed
@Takhoffman
Copy link
Contributor

PR #28900 - fix(memory): discard stdout for qmd update/embed to prevent output cap failure (#28900)

Merged via squash.

  • Merge commit: 1342962
  • Verified: pnpm install --frozen-lockfile, pnpm build, pnpm check, pnpm test:macmini
  • Changes made:
    M CHANGELOG.md
  • Why these changes were made:
    Changelog entry was required by the autoland policy for this user-facing fix.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @Glucksberg!

zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 1, 2026
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
amitmiran137 pushed a commit to amitmiran137/openclaw that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
hanqizheng pushed a commit to hanqizheng/openclaw that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…p failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen added a commit to hanzoai/bot that referenced this pull request Mar 6, 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.

QMD boot update fails with large indexes: output exceeds 200K char limit

2 participants