Skip to content

Treat empty-string Triage questionnaire as absent and show a ready-for-agent example in thirdshift-triage #2052

Closed

Description

@JacobStephens2

This was generated by AI during triage.

From the 2026-11-11 fleet retrospective across 140 Triage runs: 4 out of 4 questionnaire validation failures in production (tourbot#2141, tourbot#2142, orchestration#905, orchestration#908) failed with ready-for-agent recommendation must not include a questionnaire because Claude emitted "questionnaire": "" (an empty string) while following the single JSON example in skills/thirdshift-triage/SKILL.md (which shows "state": "needs-info" with a "questionnaire" field).

Agent Brief

Category: enhancement
Summary: Normalize empty or whitespace-only "questionnaire" strings to None in parse_recommendation and include a non-needs-info (ready-for-agent / ready-for-human) JSON example without questionnaire in skills/thirdshift-triage/SKILL.md, so Triage sessions do not burn an extra correction turn (#2019) over "questionnaire": "".

Current behavior:

  1. RawRecommendation.questionnaire deserializes "questionnaire": "" as Some(""), and parse_recommendation rejects any non-needs-info state where questionnaire is Some(_), even when the string is empty or whitespace-only. With A Triage run discards its whole analysis over a questionnaire or field-shape mismatch #2019, that triggers an extra full Harness correction turn solely to delete "questionnaire": "".
  2. skills/thirdshift-triage/SKILL.md shows only one JSON fence example ("state": "needs-info", which includes "questionnaire"), encouraging models that treat examples as fixed schemas to emit "questionnaire": "" on ready-for-agent and ready-for-human recommendations.

Desired behavior:

  1. During recommendation parsing (parse_recommendation), treat an empty or whitespace-only questionnaire string ("" / " ") the same as an omitted or null questionnaire (None) before state-specific validation:
    • For ready-for-agent, ready-for-human, and wontfix, "questionnaire": "" (or whitespace-only) succeeds cleanly as None without needing a correction turn, while a non-empty "questionnaire" on those states continues to be rejected as invalid.
    • For needs-info, "questionnaire": "" (or whitespace-only) continues to be rejected because needs-info requires non-empty questions.
  2. skills/thirdshift-triage/SKILL.md includes a concise second JSON example (or clear side-by-side illustration) for ready-for-agent / ready-for-human omitting questionnaire, reinforcing that questionnaire is present only when "state" is "needs-info".
  3. Regenerate site/prompts/index.html (UPDATE_PROMPTS=1 cargo test prompts_page) so the embedded thirdshift-triage skill on the prompts page stays in sync.

Key interfaces:

  • parse_recommendation / RawRecommendation in the triage module.
  • skills/thirdshift-triage/SKILL.md JSON output specification and prompts_page verification.

Acceptance criteria:

  • parse_recommendation accepts "state": "ready-for-agent" (and "ready-for-human" / "wontfix") with "questionnaire": "" or "questionnaire": " " without error or correction turn.
  • parse_recommendation still rejects non-empty "questionnaire" on ready-for-agent / ready-for-human / wontfix, and still rejects empty/whitespace "questionnaire" on needs-info.
  • skills/thirdshift-triage/SKILL.md shows ready-for-agent (or non-needs-info) JSON without questionnaire, and cargo test prompts_page passes.

Out of scope:

Activity

  1. added
    enhancement
    on Nov 11, 2026
  2. added
    ready-for-agent
    on Nov 11, 2026
  3. added
    in-progress
    and removed
    ready-for-agent
    on Nov 12, 2026
  4. removed
    in-progress
    on Nov 12, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions