Skip to content

fix(knowledge): drain analyze-harvested-repos stdout via process.exitCode - #3645

Merged
kyle-sexton merged 1 commit into
mainfrom
cursor/fix-3434-harvest-exitcode-df93
Sep 2, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
cursor/fix-3434-harvest-exitcode-df93

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #3434

Summary

The analyze-harvested-repos CLI called process.exit immediately after an async stdout write, which can truncate a piped report.

Fix

Set process.exitCode and return, matching the other video-digest CLIs. knowledge 0.13.33.

Verification

scripts/affected-tests.sh --run selected the vitest suite (NOT RUN from the shell runner, exit 3). npx vitest run harvesting/analyze-harvested-repos.test.js: 6 passed, including the exitCode source pin.

Related

N/A

Open in Web Open in Cursor 

…Code

Calling process.exit after an async write can truncate a piped report.
Match the other video-digest CLIs.

Closes #3434

Co-authored-by: ksextonmelodic <[email protected]>
@claude

claude Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 40s —— View job


Security review — no issues found

  • Gather context (PR diff, changed files)
  • Review changed files for security-relevant issues
  • Report findings or confirm none found

Skip gate hit: this PR has no security-relevant surface. The entire diff is:

  • analyze-harvested-repos.js — replaces process.exit(code) with process.exitCode = code (and the catch branch likewise) so the async stdout write finishes draining before the process exits. Pure control-flow fix, no new input handling or trust-boundary change.
  • .claude-plugin/plugin.json — version bump (0.13.32 → 0.13.33).
  • CHANGELOG.md — changelog entry for the fix.
  • analyze-harvested-repos.test.js — a source-pin test asserting the file no longer contains process.exit( and does contain process.exitCode = code.

No injection surfaces, no secrets/token handling, no authz/authn logic, and no GitHub Actions workflow changes are touched by this diff. No security findings to report.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-02T08:53:51.922193Z 61f6b7b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Last security-reviewed head: 61f6b7b471f10a6119a2e042ecb293666a05778d. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

@claude

claude Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 54s —— View job


Code review complete

  • Gather context (PR diff, CLAUDE.md, REVIEW.md)
  • Review changed files for correctness/maintainability
  • Post inline findings (if any)
  • Final summary

No blocking findings.

This is a small, well-scoped fix:

  • analyze-harvested-repos.js (harvesting/analyze-harvested-repos.js): the isMainModule block now sets process.exitCode via .then/.catch instead of calling process.exit right after the async writeStdout. I checked this against the 8 other CLIs in extraction/ that already use the same process.exitCode = code pattern (e.g. harvesting/run-harvest.js) — it's an exact match, not a one-off.
  • The new regression test (analyze-harvested-repos.test.js:105-114) pins the source text (process.exit( absent, process.exitCode = code present) rather than exercising runAnalyzeHarvestedReposCli behaviorally. That's a reasonable tradeoff here: a true behavioral test would need to mutate the real process.exitCode inside the test run, which risks bleeding into the test runner's own exit status. Not a blocker.
  • plugin.json version bump (0.13.32 → 0.13.33) and the CHANGELOG.md entry are consistent with each other and with repo convention.

Author-claimed verification (scripts/affected-tests.sh --run, npx vitest run .../analyze-harvested-repos.test.js: 6 passed) is unverified by me — I wasn't able to run the suite myself in this session (network fetch for origin/main history required approval I didn't have), so I reviewed by reading the changed files directly and cross-referencing sibling CLIs instead of running git diff/tests.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count.

@kyle-sexton
kyle-sexton merged commit 5893962 into main Sep 2, 2026
2 checks passed
@kyle-sexton
kyle-sexton deleted the cursor/fix-3434-harvest-exitcode-df93 branch September 2, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

knowledge: analyze-harvested-repos.js can truncate piped stdout by calling process.exit right after an async write

2 participants