Skip to content

Security review: a misplaced field in the private report fails as 'omitted a valid final line' (agy) #2298

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: A Security review whose private report is malformed fails as "session failed, ended early or omitted a valid final line". The real cause is hidden. agy regularly writes the report with severity and fix_size one level too high.

Current behavior:

fareloch #129 (thirdshift 0.37.0, stephens.page, Security review on agy · gemini-4-hydrogen-xhigh) failed twice on 2026-11-19, at 02:49 and 03:40 EST, with:

Security review incomplete: session failed, ended early or omitted a valid final line; see Session trace

The session didn't fail. agy's final message ended with a valid line:

Security review: {"unaddressed_count":0,"findings":[],"pre_existing_count":4}

and its private report (security-reviews/129-…/pre-existing.json) held exactly 4 findings. Each of them had this shape:

{fingerprint, title, description, severity, fix_size, proof_of_concept: {test, command, head_exit_code, merge_base_exit_code, notes}}

OldFinding and ProofOfConcept in src/security/review.rs are deny_unknown_fields, and they expect severity and fix_size inside proof_of_concept. Deserialising fails, and Outcome::of maps that error, which is neither Incomplete, SafeguardRefusal nor SessionFailure, to the generic message. The Command log never shows the parse error.

The same message has come up repeatedly since agy took over Security reviews on 2026-11-15, and a plain retry sometimes passed. That fits a schema slip agy makes only some of the time.

Desired behavior:

  1. Name the real cause. A report that fails to parse or validate ends with a specific reason, for example "Security review's private report is invalid: unknown field severity at finding 1", carried into the outcome and the Command log. The generic message stays only for a genuinely missing final line or a failed session.
  2. Make the shape hard to get wrong. The prompt that asks for the report shows a complete example object with severity and fix_size inside proof_of_concept, so the nesting is unambiguous. If the Day shift prefers, the parser could instead accept these two fields at the finding's top level when they are absent from proof_of_concept, still rejecting conflicts and unknown fields. Pick one approach and keep the schema in one place.

Key interfaces:

  • OldFinding, ProofOfConcept, OldFinding::reproduction and Outcome::of in src/security/review.rs.
  • The Security review prompt text in src/prompt.rs that describes the private report and the final line.

Acceptance criteria:

  • A report whose findings carry severity/fix_size at the top level produces an outcome naming the report and the offending field, not the generic message. If the lenient option is chosen instead, it is accepted and recorded correctly.
  • A missing or invalid final line still produces today's messages.
  • The Security review prompt shows the full report shape with severity and fix_size placed as the parser expects. If prompts are regenerated, UPDATE_PROMPTS=1 cargo test prompts_page is re-run.
  • Unit tests cover both shapes.

Out of scope:

  • agy's 503 "No capacity" and quota errors, which are transient and routed.

Activity

  1. added
    bug
    ready-for-agent
    in-progress
    and removed
    ready-for-agent
    on Nov 19, 2026
  2. removed
    in-progress
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions