-
Notifications
You must be signed in to change notification settings - Fork 0
Actions with all records guard-skipped show OK in tally instead of SKIP #93
Description
Summary
When a per-record guard skips ALL records in an action (e.g., severity != "low" when all tickets are low-severity), the action is marked as "completed" and counted as OK in the tally. The IDE/LSP correctly identifies these as "skipped", but the CLI tally does not.
Root Cause
Per-record guard skips and action-level skips follow different code paths:
- Action-level skip (WHERE clause /
should_skip_action): handled byexecutor._handle_action_skip()→ returnsstatus="skipped"→ counted in tally as SKIP - Per-record guard skip: each record evaluates the guard individually →
GuardStatus.SKIPPED→ProcessingResult.unprocessed()with tombstone data →collect_resultsextends output with tombstones →save_main_outputwrites tombstones (non-empty output) → action returnsstatus="completed"→ counted as OK
When ALL records are guard-skipped, the action technically "completed" (no exception, non-empty output with tombstones), but no actual LLM work was done. The tally should reflect this.
Reproduction
agac run -a support_resolutiondraft_response has guard severity != "low" with on_false: "skip". When all 4 tickets have low severity:
10:05:54 | Completed in 23.42s | 7 OK | 0 PARTIAL | 0 SKIP | 0 ERROR
But the DB shows all 4 records in draft_response have disposition unprocessed | guard_skip, and all 4 records in format_output have disposition unprocessed | upstream_unprocessed. Neither action did any real work, yet both count as OK.
The IDE/LSP correctly shows format_output as "⏭ skipped".
Evidence from DB
-- record_disposition table
draft_response | 2362b687... | unprocessed | guard_skip
draft_response | 473e7a5b... | unprocessed | guard_skip
draft_response | fde829a7... | unprocessed | guard_skip
draft_response | 1b49812d... | unprocessed | guard_skip
format_output | 2362b687... | unprocessed | upstream_unprocessed
format_output | 473e7a5b... | unprocessed | upstream_unprocessed
format_output | fde829a7... | unprocessed | upstream_unprocessed
format_output | 1b49812d... | unprocessed | upstream_unprocessedSuggested Fix
After collect_results returns, check whether ALL results are unprocessed/tombstone. If so, the action's status should be set to "skipped" (or a new "guard_skipped" status), not "completed". This would make the tally reflect reality:
10:05:54 | Completed in 23.42s | 5 OK | 0 PARTIAL | 2 SKIP | 0 ERROR
Alternatively, the PARTIAL tally bucket could be used for actions where some (but not all) records were guard-skipped.
Related
- Issue CLI shows misleading 'batch job(s) submitted' for non-batch failures #81 — CLI catch-all "batch job(s) submitted" message
- Issue InitialStrategy silently marks action completed when all records fail #82 — InitialStrategy missing failure check
- PR fix: dependency-skipped actions show SKIP in tally, level lines reflect failures #80 — fixed tally counting for dependency-skipped actions (this is the per-record guard equivalent)