Skip to content

Actions with all records guard-skipped show OK in tally instead of SKIP #93

@Muizzkolapo

Description

@Muizzkolapo

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 by executor._handle_action_skip() → returns status="skipped" → counted in tally as SKIP
  • Per-record guard skip: each record evaluates the guard individually → GuardStatus.SKIPPEDProcessingResult.unprocessed() with tombstone data → collect_results extends output with tombstones → save_main_output writes tombstones (non-empty output) → action returns status="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_resolution

draft_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_unprocessed

Suggested 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions