Skip to content

fix(deep-scan): recheck empty targets before a resumed scan's first dispatch - #2346

Merged
mldangelo-oai merged 11 commits into
openai:mainfrom
0xABCD01:fix/2014-empty-target-residual
Nov 5, 2026
Merged

mldangelo-oai merged 11 commits into
openai:mainfrom
0xABCD01:fix/2014-empty-target-residual

Conversation

@0xABCD01

@0xABCD01 0xABCD01 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Deep Scan can record its discovery phase and stop before dispatching its first worker. If the target is empty when another coordinator takes over, the persisted phase used to let the scan start a worker. The replacement coordinator now checks the current target before dispatch. This addresses the resume case in #2014.

Changes

  • Use the existing target check when the run has zero dispatches, no persisted non-setup workers, and no saved deduplication inputs.
  • Exercise the real workbench handoff with both an empty target and a target that still has a source file.

Testing

  • Confirmed the resumed-empty regression test fails on main and passes on this branch.
  • Ran the empty-target and workbench store integration suites on Linux. Twelve tests passed, with one Windows-only skip.
  • MCP type checking and formatting, both plugin Ruff checks, the SDK CI build, and the portable source check passed. All nine source-compatibility tests passed.

Risk and rollout

Runs with recorded dispatches or recoverable work keep their existing recovery path. Fresh scans continue using the physical target check. Git directories containing only ignored files remain a separate case under #2014. No database migration is required.

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.

A Deep Scan stopped after its discovery phase was persisted but before
any worker was dispatched was never re-admitted on resume: isFreshRun
required discoveryStarted to be false, and the workbench derives that
flag from the persisted phase. Nothing has been dispatched for such a
run, so there is no accepted discovery work to protect.

Relax isFreshRun to key on the dispatch evidence alone (zero dispatches,
no non-setup persisted workers, no persisted dedup inputs). The existing
dispatchedCount = 1 bypass keeps its behavior.

Refs openai#2014
…mpty

Admission's physical probe admits a directory holding only an empty
subdirectory or only files the source inventory ignores, so discovery
and reduction still ran on a zero-file scope (openai#2014). The workbench
already computes the registered scope's regular-file count at scan
start (scan_progress.scope_file_count, counting an explicitly selected
file itself); deep_scan_state() now surfaces it as scopeFileCount and
the coordinator stops a fresh run with the existing empty-target
outcome when that count is zero. Unknown counts (legacy records) are
not gated, and the physical probe semantics are unchanged.

Refs openai#2014
@github-actions github-actions Bot added the bug Something isn't working label Nov 5, 2026
@mldangelo-oai mldangelo-oai changed the title fix(deep-scan): stop empty-inventory dispatch for fresh and zero-dispatch resumed runs fix(deep-scan): recheck empty targets before a resumed scan's first dispatch Nov 5, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator

Thank you!

@mldangelo-oai
mldangelo-oai merged commit 93ec970 into openai:main Nov 5, 2026
67 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
3 tasks done
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.

2 participants