Skip to content

test(email-eval): add a hung-thread follow-up scenario to gaia_email - #8089

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
hussain-alsaibai:feat/2040-hung-thread-scenario
Nov 21, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
hussain-alsaibai:feat/2040-hung-thread-scenario

Conversation

@hussain-alsaibai

Copy link
Copy Markdown
Contributor

Fixes #2040 (re-targeted per @kovtcharov-amd's review on #6589).

Why this replaces #6589

#6589 wired the standalone email agent's follow-up eval into CI. @kovtcharov-amd pointed out that the email agent is being removed in #7108, along with email_scorecard_refresh.yml and the email eval modules — so that PR's target no longer exists.

Verified, not assumed: #7108 deletes every file #6589 touches.

#6589 touches #7108
.github/workflows/email_scorecard_refresh.yml removed
hub/agents/email/python/packaging/eval_followup_report.py removed
hub/agents/email/python/tests/test_eval_followup_report.py removed
tests/fixtures/email/followups_ground_truth.json removed
tests/fixtures/email/followups_gate_thresholds.json removed
src/gaia/eval/followup_quality.py removed

Rebasing #6589 would produce a PR against deleted files, so this moves the coverage instead.

What this does

Adds one gaia_email scenario, eval/scenarios/gaia_email/email_t3_hung_thread_followups.yaml, pinning the same awaits_reply behaviour — but end to end against the surviving corpus and the live agent, rather than offline against the deleted detector.

Among the 42 inbox messages, exactly one thread has a person blocked on the user's reply: Alex, "Re: Project status - blocked on review". The scenario requires the agent to:

  1. Find that thread, and say he is blocked with a customer deadline.
  2. Not count other deadline-bearing mail as awaiting a reply — the hard negatives are exactly the ones the old detector scored as false positives: the Boss Q4 budget request (a deliverable the user owes, not a thread needing a reply), Sam's "design review moved" FYI, the HR enrollment reminder (the action is enrolling, not replying), and Priya's already-settled on-call swap.
  3. Not mistake the Tue Sep 29 calendar invite for an answer to Alex — the meeting being scheduled is not the review being done. The old offline detector could not see this confusion at all.
  4. Write a reply that commits to reviewing today and asks what specifically is blocking him — an acknowledgment with no question is a FAIL, since the point is to un-hang the thread.

Validation

  • gaia.eval.runner.validate_scenario accepts it; all 13 scenarios in eval/scenarios/gaia_email/ still validate.
  • The validator was confirmed to reject malformed input (empty turns, a turn with neither ground_truth nor success_criteria), so the pass is not vacuous.
  • Every factual claim in the scenario header was checked against tests/fixtures/gaia/email/eval_inbox.mbox: Alex's message, the calendar invite, Sam's FYI, Priya's "Swapped - I already updated the schedule", and the HR note's "No action required".

Branched from amd/gaia@75ef063df. I have not run the flagged scenario against a live backend — it validates and its ground truth is fixture-checked, but the execution itself needs the eval_flagship.yml runner.

#6589 can be closed.

amd#2040's follow-up coverage lived in the standalone email agent's offline
detector eval: a hand-labelled corpus scored precision/recall for the
awaits_reply flag. amd#7108 removes that agent and its whole eval tree, so the
coverage has to move rather than be rebased.

This pins the same behaviour against the surviving gaia_email corpus, end to
end instead of offline: among the 42 inbox messages, exactly one thread has a
person blocked waiting on the user (Alex, "Re: Project status - blocked on
review"), and the agent has to find it, refuse to count deadline mail as
awaiting a reply, not mistake the Tue Sep 29 calendar invite for an answer to
Alex, and then write a reply that asks what specifically is blocking him.

The hard negatives are the ones the old detector scored as false positives:
a request for a deliverable the user owes (Boss Q4 budget), a pure FYI (Sam's
design review moved), a deadline where the action is not replying (HR
enrollment), and a thread that has already been settled (Priya's on-call
swap).

Validated with gaia.eval.runner.validate_scenario; all 13 scenarios in the
directory still validate.
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

Moving the follow-up coverage into a live gaia_email scenario is the right call now that the standalone email agent is going away. The scenario's answer key is the problem. It says Alex is the only person waiting on a reply, but the same inbox has other mail that plainly asks for one. And it fails the agent for naming the Boss email, whose subject line says "response needed today". A correct agent will be marked down, and the result will depend on how the judge reads the edge cases.

  • Fix the premise in turn 1. The sibling triage scenario counts nine items that need the user against this same mailbox. Several of them ask for a reply: the forwarded customer escalation ("We need to respond by EOD"), Marcus's "Lunch Thursday?" and the Boss's "response needed today". Either narrow the question to someone blocked on a promise you made, which only fits Alex, or accept the other reply-owed threads and keep the critical fail for the clear FYIs only (Sam Patel, HR, Priya's on-call swap).
  • The purpose-built tool will say nobody is waiting. The flagship has a list_waiting_on_you tool. It flags a thread only when the user has already written in it, and the fixture holds no message from the user. An agent that picks the right tool gets an empty list and is then failed for trusting it. Say how the scenario expects that tool to be handled, or add the user's earlier message to Alex's thread so the signal this PR claims to pin actually fires.

Real-world evidence

N/A: this PR adds one eval scenario file (test-only), and no evidence bundle was produced. The author says the scenario passes schema validation but hasn't been run against a live backend. My verdict rests on a static review of the scenario against the fixture mailbox and the email tools.

🔍 Technical details

Issues

🟡 The "exactly one thread" ground truth contradicts the fixture and the sibling scenario (eval/scenarios/gaia_email/email_t3_hung_thread_followups.yaml:6, :13-17, :54-66)

  • email_t3_triage_action_items.yaml:2-12 lists nine items needing the user on the same eval_inbox.mbox. Several are explicit reply requests:
    • stub-009 Fwd customer escalation: "We need to respond by EOD"
    • gaia-email-lunch Marcus "Lunch Thursday?": a direct question, marked read, never answered
    • stub-001 Boss, subject "URGENT: Q4 budget review - response needed today"
  • Turn 1's success criteria make naming the Boss email a CRITICAL FAIL. Its own header reasoning ("send projections" is outbound work, not a reply) is a judgment call, and the subject line contradicts it. Expect judge variance and false FAILs.
  • Lunch and the escalation aren't listed as negatives, but the ground truth still calls Alex "the ONLY message", which leaves the judge two conflicting signals.
  • Suggested reframe for turn 1:
    user_message: "Is anyone stuck waiting on something I promised them? I don't want to leave someone hanging."

Then restrict the CRITICAL FAIL to the pure FYIs (Sam Patel, HR, Priya on-call), and make naming Boss, the escalation or lunch neutral rather than failing.

🟡 The scenario conflicts with list_waiting_on_you (src/gaia/agents/tools/email_tools.py:1130-1140, _email/waiting.py:687)

  • The tool qualifies a thread only when "the user already wrote in that thread", and its docstring says "an empty list is a real answer".
  • The fixture has no From: [email protected] message, and Alex's References: <stub-003-thread@…> points at a message that doesn't exist. The tool will return count: 0.
  • Turn 1 requires search_email or list_inbox and is silent on this tool. So the scenario tests free-form model judgment over a listing, not the awaits-reply signal from feat(eval): detection-quality eval for email follow-up tracking #1950 that the PR says it replaces.
  • Options:
    • add the user's earlier "I'll do the architecture review" message to the thread in build_mailbox.py, so the tool fires on Alex, after checking the other gaia_email scenarios that count inbox messages ("42");
    • or state in success_criteria that an empty list_waiting_on_you must be cross-checked against the inbox and is not a reason to answer "no one".

🟢 Turn 3 doesn't say whether a real draft is expected (:80-89)

  • The fixture backend supports drafts (_email/fixture.py:307, send-email skill). As written, a reply typed into chat passes, and so does a real draft.
  • If the goal is to close the loop end to end, name the expected tool path (a draft created, not sent). Otherwise say that chat text is enough.

Strengths

  • The header's FIXTURE-SYNC block is accurate: every quoted message, date and address matches eval_inbox.mbox, and the 42-message count holds (43 including the Spam entry).
  • Turn 2, a calendar invite is not a reply, is a good discriminating check that the old offline detector couldn't express.
  • Turn 3's "acknowledgment with no question is a FAIL" makes the success bar specific.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Thanks for moving this coverage over instead of rebasing onto deleted files, @hussain-alsaibai. The calendar-invite turn is a really good check. Before it can merge, the answer key needs two changes. As written, a correct agent can still be marked as failing:

  1. Turn 1 says Alex is the only person waiting, but the inbox has other reply requests. Three other emails ask for a reply: the Boss email's subject says "response needed today", the forwarded escalation says "We need to respond by EOD", and Marcus asks "Lunch Thursday?". Naming the Boss email is currently a critical fail. Either narrow the question to someone blocked on a promise the user made (only Alex fits that), or let the agent mention those three without failing it and keep the critical fail for the pure FYIs: Sam, HR, and Priya's on-call swap.
  2. The flagship's list_waiting_on_you tool will return an empty list. It only flags threads the user has already written in, and the fixture mailbox has no message from the user. An agent that picks that tool gets "nobody" and then fails. You can fix this either way: add the user's earlier "I'll do the architecture review" message to Alex's thread in build_mailbox.py (then update the "42 messages" count in the other gaia_email scenarios), or say in turn 1's criteria that an empty result has to be cross-checked against the inbox.

Optional: say whether turn 3 expects a real draft or whether a reply written in chat is enough.

The schema checks out. All 13 gaia_email scenarios validate and the scenario lint tests pass, so these are the only changes needed.

@kovtcharov-amd kovtcharov-amd added the bug Something isn't working label Nov 13, 2026
@kovtcharov-amd kovtcharov-amd added eval Evaluation framework changes p2 low priority labels Nov 13, 2026
@kovtcharov-amd kovtcharov-amd added the tests Test changes label Nov 15, 2026
@kovtcharov-amd kovtcharov-amd added tech debt p3 and removed bug Something isn't working p2 low priority labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

This push only merged main. The scenario file hasn't changed, so both answer-key problems from the last review are still open, and a correct agent can still be scored as failing.

  • 🟡 Turn 1 still calls Alex the only person waiting for a reply. It also still critical-fails an agent that names the Boss email, whose subject says "response needed today". Either narrow the question to someone blocked on a promise the user made, or let the agent mention the reply-owed threads (Boss, the forwarded escalation, Marcus's lunch) and keep the critical fail for the pure FYIs.
  • 🟡 The flagship's "who's waiting on you" tool will still find nobody. The fixture mailbox has no message from the user, so an agent that picks the right tool gets an empty list and fails. Either add the user's earlier message to Alex's thread, or say in the criteria that an empty result has to be checked against the inbox.
🔍 Technical details
  • eval/scenarios/gaia_email/email_t3_hung_thread_followups.yaml is byte-identical to the commit reviewed at 0b93c9af. The new head 61adb31b is a merge from origin/main and doesn't touch the scenario.
  • Turn 1 success_criteria still lists the Boss Q4 budget email as a CRITICAL FAIL. eval_inbox.mbox:4 has Subject: URGENT: Q4 budget review - response needed today.
  • list_waiting_on_you (src/gaia/agents/tools/email_tools.py:1137) only flags threads the user has written in. eval_inbox.mbox has 0 From: …[email protected] messages, so the tool returns count: 0.

@kovtcharov-amd
kovtcharov-amd merged commit 47fa25d into amd:main Nov 21, 2026
17 of 18 checks passed
kovtcharov-amd added a commit that referenced this pull request Nov 21, 2026
…rs (#8717)

Follow-up to #8089.

The new hung-thread email scenario could mark a correct agent as
failing: it treated Alex as the only person waiting on a reply even
though three other emails ask for one, and it gave no rule for the
waiting-on-you tool, which returns nothing on this mailbox. Turn 1 now
asks who is blocked on something the user promised (only Alex), mail
that just wants a reply is neutral, the critical fail covers only the
pure FYIs, an empty waiting list must be cross-checked, and turn 3
accepts a chat reply or a draft but never a send.

## Test plan
- [ ] `python -m pytest tests/unit/eval/test_hung_thread_scenario.py`
passes (5 of its tests fail against the old answer key)
- [ ] `python -m pytest tests/unit/eval/test_ci_lanes.py
tests/unit/eval/test_eval_lane_matrix.py tests/test_eval.py -k scenario`
passes
- [ ] The next RC's flagship eval runs the `gaia_email` lane with this
scenario
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Turning this into a live scenario that even catches 'a meeting isn't a reply' is the kind of test we love. Thanks @hussain-alsaibai!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eval Evaluation framework changes p3 tech debt tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire the followups email eval into CI (report script + workflow step)

2 participants