Skip to content

fix(multiscan): preserve scan outcome and record receipt when checkout cleanup fails - #740

Open
Ultron09 wants to merge 1 commit into
openai:mainfrom
Ultron09:fix/multiscan-cleanup-receipt
Open

fix(multiscan): preserve scan outcome and record receipt when checkout cleanup fails#740
Ultron09 wants to merge 1 commit into
openai:mainfrom
Ultron09:fix/multiscan-cleanup-receipt

Conversation

@Ultron09

Copy link
Copy Markdown

Summary

Preserve multiscan attempt outcomes and ensure attempt receipts are durably recorded in results.jsonl when checkout directory removal encounters secondary filesystem errors (such as EACCES, EPERM, or EBUSY).

Fixes #211.

Changes

  • In sdk/typescript/src/multiscan.ts, decouple the checkout removal cleanup step from the primary scan outcome capture and receipt appending.
  • Treat checkout removal as best-effort cleanup: capture cleanup exceptions without aborting the worker, record the authentic scan attempt status (completed, completed_with_incomplete_coverage, or failed) in the ledger receipt, and emit a non-fatal warning on progress notifications.
  • Ensure that if an abort signal is triggered, checkout removal is attempted before rethrowing.
  • In sdk/typescript/tests-ts/multiscan.test.ts, add regression tests verifying:
    1. A scan failure followed by a checkout cleanup error preserves the original scan failure in the ledger receipt and progress notifications.
    2. A scan success followed by a checkout cleanup error preserves the completed status in the ledger receipt, counts the completion, and does not crash the campaign.

Testing

  • bun test ./tests-ts/multiscan.test.ts (53 pass, 2 skip, 0 fail)
  • pnpm --dir sdk/typescript run types (passed with 0 errors)
  • pnpm --dir sdk/typescript run format (passed with all files formatted)
  • python .github/scripts/check_plugin_source_compatibility.py (passed)

Risk and rollout

Low. This change makes multiscan worker cleanup resilient without modifying the scan execution or ledger format contract.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiscan cleanup failure masks the scan outcome and skips the repository receipt

1 participant