fix(scan): propagate Ctrl-C cancellation to scan runs - #996
Open
AllenMuu wants to merge 2 commits into
Open
Conversation
Contributor
|
🔍 OpenCodeReview found 2 issue(s) in this PR.
📄
|
AllenMuu
force-pushed
the
feat/scan-cancellation-resume
branch
from
August 18, 2026 12:26
1d5eba3 to
3dcc865
Compare
Contributor
Author
|
Fixed in 3dcc865.
Validated with |
AllenMuu
marked this pull request as ready for review
August 18, 2026 13:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Propagates the
ocr scancommand context from the Cobra entrypoint to preview, telemetry,scan.Agent.Run, and result emission. Ctrl-C can therefore reach the scan runtime's existing cancellation and checkpoint/resume handling.This also fixes the scan trace ID to read from the context returned by the
scan.runspan, and removes obsolete non-context wrappers after updating their test call sites.Type of Change
How Has This Been Tested?
make testpasses locallyDeterministic regression coverage verifies:
scan.runspan.Also ran
make check, including formatting, license, andgo vetchecks.Live LLM verification with Volcengine Ark (
glm-5.2):ocr llm testpassed.max_completion_tokens=58888reached/chat/completionsbut received HTTP 400InvalidParameter.--max-tokens 4096reached the model and completed OpenAI function-tool calls, so the basic scan request/tool format is accepted at that limit. The model did not call OCR's requiredtask_donetool, so that file did not become reusable.context canceled; the session persisted bothreview_item_failedandsession_end(session882e75fb-d251-49c0-9e14-2f19d2ba7f75).--resumerun with a completed file remains pending because the configured model did not complete a scan item. The deterministic test covers checkpoint-to-resume reuse.Checklist
go fmt,go vet)Related Issues
Closes #995