Skip to content

fix(scan): report a --max-duration timeout as partial, not complete - #81

Open
harshitgavita-07 wants to merge 3 commits into
perplexityai:mainfrom
harshitgavita-07:fix-timeout-partial-status
Open

harshitgavita-07 wants to merge 3 commits into
perplexityai:mainfrom
harshitgavita-07:fix-timeout-partial-status

Conversation

@harshitgavita-07

Copy link
Copy Markdown

bumblebee scan --max-duration <d> stops walking at the deadline and sets timed_out: true, but the trailing scan_summary still says status: "complete". docs/state-model.md tells receivers to promote only status=complete runs, so a truncated snapshot can replace a fuller one.

Reported in #79 (suggested change 1).

What changed:

  • runScan sets status to partial (with an error message) when res.TimedOut is true and the status was otherwise complete. timed_out stays in the record.
  • The exit code is unchanged (0), as suggested in the issue. Easy to flip if you want a timeout to exit non-zero.
  • docs/transport.md widens the partial definition to include a --max-duration stop, as the issue noted it must.

Tests: TestRunScanTimedOutIsPartial runs a real scan with --max-duration 1ns and checks the summary. It fails on main (status=complete) and passes here. TestRunScanCompleteWhenNotTimedOut guards the normal path. go vet, gofmt and go test ./... are clean.

Not covered: the issue also asks whether complete was meant to describe process end rather than coverage. If so, this PR is the wrong call and the docs-only option in the issue applies instead.

A run stopped by --max-duration emitted status=complete with timed_out=true, so a receiver following docs/state-model.md would promote a truncated snapshot. Report it as partial. Exit code is unchanged. Fixes perplexityai#79.
Clarified the 'partial' state to include timeout conditions.
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.

1 participant