Skip to content

Refine batch failure handling#591

Draft
dnagoda wants to merge 1 commit into
dc.batch-2-preserve-json-orderfrom
dc.batch-3-failure-handling
Draft

Refine batch failure handling#591
dnagoda wants to merge 1 commit into
dc.batch-2-preserve-json-orderfrom
dc.batch-3-failure-handling

Conversation

@dnagoda

@dnagoda dnagoda commented Jul 6, 2026

Copy link
Copy Markdown

📚 Stack (bottom → top)

  1. Add batch mode for JSONL function runs #595 Add batch mode for processing multiple inputs via JSONL
  2. Preserve JSON input object order #590 Preserve JSON input object order
  3. Refine batch failure handling #591 Refine batch failure handling
  4. Reuse the compiled provider across runs #592 Reuse the compiled provider across runs
  5. Compute humanized bytes lazily #593 Compute humanized bytes lazily
  6. Add minimal batch output with --batch-full-output opt-in #594 Add minimal batch output with --batch-full-output opt-in

Stacked PRs — review bottom-up.


Why

The initial batch mode counted every run that returned Ok as a success — even
when the function itself returned success: false — so batch summaries were
wrong.

What

  • Keep --batch-continue-on-error (opt-in; batch stops on the first error by
    default
    ). No new flag.
  • Count real successes/failures from FunctionRunResult.success; track
    processed / successful / failed.
  • Treat a function-level failure (success: false) like an error: it stops the
    batch by default, and is recorded-but-skipped under --batch-continue-on-error.
  • The stderr summary reports processed, successful, and failed counts.
  • Switch integration tests to assert_cmd::cargo::cargo_bin! (the
    non-deprecated API) in place of Command::cargo_bin.

Testing

  • cargo test batch_
  • cargo test

Keep --batch-continue-on-error (opt-in; batch stops on the first error by
default) but fix the success/failure accounting. Previously every run that
returned Ok was counted as a success, even when the function itself returned
success: false.

Now batch mode tracks processed/successful/failed counts from
FunctionRunResult.success, and a function-level failure is treated like an
error: it stops the batch by default and is skipped (still recorded) under
--batch-continue-on-error. The stderr summary reports processed, successful,
and failed counts.

Add integration coverage for default stop-on-failure behavior and for
--batch-continue-on-error processing every row with accurate counts. Also
switch integration tests to assert_cmd::cargo::cargo_bin! instead of the
deprecated Command::cargo_bin helper.

Verified with:
- cargo test batch_
- cargo test

Assisted-By: devx/c659e918-9568-4750-b122-e3890447348a
@dnagoda dnagoda force-pushed the dc.batch-2-preserve-json-order branch from 02f146c to da2da97 Compare July 6, 2026 23:33
@dnagoda dnagoda force-pushed the dc.batch-3-failure-handling branch from 388e7a4 to 3e431cf Compare July 6, 2026 23:33
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