Skip to content

fix(email): scoped 'anything suspicious?' query no longer dumps the full triage report - #2910

Merged
itomek merged 11 commits into
mainfrom
tmi/issue-2900-scoped-answer
Aug 12, 2026
Merged

itomek merged 11 commits into
mainfrom
tmi/issue-2900-scoped-answer

Conversation

@itomek

@itomek itomek commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2900

Why this matters

Asking the email agent a narrow question — "is there anything suspicious in my
inbox?" — returned the right finding buried inside four unrelated triage sections
(waiting on your reply, needs a response, meetings to decide, needs a manual look)
nobody asked about. The issue's own theory was that the agent "runs its default
full-triage flow regardless of the question," implying a missing router — but there is
no router in this codebase. The real cause is a deterministic rewrite that renders the
full triage card whenever pre_scan_inbox was called this turn, by design, to stop the
model hand-summarizing (and corrupting) a list a tool already computed correctly.

The fix adds a new, narrow tool — check_suspicious_mail — so a scoped question reaches
a scoped tool instead of the general one, the same pattern already used for
get_briefing/extract_action_items/list_tasks. A general "triage my inbox" ask is
completely unaffected.

Evidence

what result
Scoping (AC#1) — live mailbox, 5 unrehearsed phrasings, fresh session each, NPU/FLM profile 4 / 5 chose the scoped tool; 0 / 5 also chose pre_scan_inbox
General triage unaffected (AC#2) — live control, "triage my inbox" PASS — full four-bucket card, pre_scan_inbox only
Detection unchanged (AC#3) — same-ctx main control, 249-msg corpus zero delta on all 3 metrics, 0 differing per-message decisions across 307
Hermetic harness, same phrasings NPU 4/5 · E4B 5/5 (matches live exactly)

Full measurements are in the comments. The 5th phrasing ("should I be worried about any
of these emails?") called no tool and asked for clarification — "these emails" has no
referent in a fresh session.

⚠️ An earlier comment on this PR reported "0 / 5 live" and concluded the fix does not
work. That result was withdrawn
— it was scored from a trace that could not tell the
two tools apart, so a perfect run would also have scored 0/5. The tool now logs itself,
the instrument was proven before any tally was produced, and the corrected number is the
4/5 above. The detection-accuracy row was a different measurement and was never affected.

Two gaps stated rather than papered over:

  • Live E4B (non-NPU default) could not be measured — a live session cannot be pinned
    to a non-default model at all (POST /v1/email/agent/session has no model_id).
    Tracked as fix(email): a live agent session cannot be pinned to a non-default model, so per-profile behaviour is unmeasurable #2918. The harness covers E4B at 5/5, and on NPU the harness matched live
    exactly, so it is corroborating rather than certifying.
  • The scoped answer is grounded but has no card. The flagged rows are now rewritten
    from tool data (a contradicting "nothing flagged" opener can no longer sit above a
    phishing list), but check_suspicious_mail is not in _RENDER_TOOL_TO_LANG
    (src/gaia/ui/sse_handler.py:504), so no typed card draws for it. Accepted for this PR;
    the grounding pass is what carries the correctness guarantee.

What changed

  • check_suspicious_mail: read-only, reports phishing/spam-flagged mail only, precomputed
    and counted by the same shared classifier every triage tool already uses — detection
    itself is unchanged.
  • The phishing/spam flag, previously only readable inside a prose why string, is now a
    real field: PreScanItem.is_phishing/is_spam,
    EmailPreScanResult.suspicious/suspicious_total (schema 2.13, Python and npm
    client together). Captured before the existing 5-item actionable cap, so a flagged
    message ranked past that cap is never silently dropped from the count.
  • One general sentence added to the system prompt ("prefer the narrower tool built for
    that class over pre_scan_inbox for a scoped question") — no phrasing enumerated, no
    keyword list, no regex over the user's question. The deterministic rewrite mechanism
    itself is untouched.
Design note — why this satisfies #2762

Governing authority: #2762 (Email Agent Validation Index) — every fact in an answer must
arrive precomputed from a tool, and no prompt/code may special-case a specific phrasing.
The straightforward-looking fix (make the rewrite conditional on parsing the question) was
rejected precisely because it reopens that hallucination class. This PR instead makes the
tool choice the scoping mechanism — the model decides what matters (which tool), the
tool still supplies every fact.

The both-tools-called case is pinned as a test and was measured live at K = 0 / 5. Its
only #2762-compliant lever, had it been non-zero, is sharpening check_suspicious_mail's
own docstring — never a phrase-matcher.

Tool-surface tension, acknowledged. #2835 (cut the model-facing tool surface 65→49) and
#2836 (dynamic ToolLoader) are open and pulling toward fewer tools, while this adds a 66th.
They aren't in conflict: those target prompt-load-bearing redundancy; a scoped tool that
removes an entire class of otherwise-unfixable answer contamination is exactly what
per-turn selection is designed to keep cheap.

Test plan

  • hub/agents/email/python/tests/ — 1903/1903 passing, including 28 new tests in
    test_suspicious_mail_2900.py (pre-cap capture, cross-mailbox merge, the registered
    tool, rewrite_triage_answer never firing on a check_suspicious_mail-only turn, the
    AC2 full-triage regression, the double-tool-call residual, contract additivity, the
    long-lived-session backend refresh, system-prompt wording)
  • Repo-root python -m pytest tests/unit/ and python util/lint.py --all
  • Live 5-phrasing tool-trace sweep + AC#2 control on a Ryzen AI APU/NPU Linux box
  • Detection-accuracy control against main in the same environment
  • Regenerated CAPABILITY_MATRIX.md, openapi.email.json, specification.html,
    CONTRACT.md, and the npm client/SPEC/CHANGELOG — all drift guards pass
Red CI checks — all three traced to infrastructure, none to this change
check cause
Unit Tests (py3.11) test_lemonade_release_assets — its network guard handles "no network" but not "network present, remote hiccuped"; this run got RemoteDisconnected from GitHub. Filed as #2927
Verify external URLs intermittent false positive; red on main too. Filed as #2925
build-apps (windows-latest, jira) unrelated app build; this PR touches no app frontend
Email Triage Eval (pending) runner-side embedder load failure, third occurrence today across three unrelated PRs. Filed as #2920 — the integrity gate correctly refuses a verdict over missing data, so it scores nothing about this change

A narrow "is there anything suspicious in my inbox?" question was getting
the full four-bucket triage report instead of a focused answer. There is no
router in this codebase to fix -- rewrite_triage_answer (answer_grounding.py)
deliberately renders pre_scan_inbox's full card whenever that tool ran this
turn, to stop the model hand-summarizing (and corrupting) a list a tool
already computed correctly.

Adds a new read-only tool, check_suspicious_mail, that surfaces only
phishing/spam-flagged messages -- the same pattern already used by
get_briefing/extract_action_items/list_tasks: a scoped question reaches a
scoped tool, so there is nothing unrelated to leak. rewrite_triage_answer
itself is untouched; it keys on the literal tool name "pre_scan_inbox",
which this new tool never triggers.

The phishing/spam flag, previously readable only inside a prose "why"
string, is threaded structurally: PreScanItem gains is_phishing/is_spam,
and EmailPreScanResult gains suspicious/suspicious_total (schema 2.13),
captured before actionable's own 5-item cap so a flagged message ranked
past that cap is never silently dropped from the count.

Closes #2900
@github-actions github-actions Bot added documentation Documentation changes agent::email Email agent changes labels Aug 12, 2026
@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Live phrasing sweep — 🔴 the scoped tool was never chosen (NPU profile)

Ran the five recorded phrasings against a live mailbox on this branch (4be3a116), each on a fresh session (a first pass showed memory bleed between phrasings and was discarded and redone).

N (check_suspicious_mail alone) = 0 of 5. K (pre_scan_inbox called) = 4 of 5.

The fifth — "should I be worried about any of these emails?" — called no tool at all and asked for clarification, which is reasonable: "these emails" has no referent in an isolated session.

The scoped tool was not selected once, including for the most direct phrasing. As specified when this sweep was commissioned, K > 0 is a real AC#1 finding and is reported as such rather than smoothed.

✅ AC#2 holds. The control — "triage my inbox" on a fresh session — correctly rendered the full four-bucket card. No regression to the general triage path.

One nuance that cuts both ways: none of the four pre_scan_inbox turns actually rendered the visible four-bucket card (the model wrote short prose instead), so the user-visible symptom in #2900 did not reproduce here. But the underlying wrong-tool selection did, every time — and it carries a real cost, a 20–60s full scan where a light scoped one would do.

🔍 Scope — this is an NPU-profile measurement, not the default
  • Model: gemma4-it-e2b-FLM (NPU profile), zero drift within any capture. Gemma-4-E4B-it-GGUF was explicitly pinned and confirmed resident first, but the first real query evicted it — gaia_agent_email/model_select.py auto-selects the FLM model whenever an NPU is present and that model is downloaded.
  • This matters more here than for the sibling PRs. This design routes scoping through the model's tool choice, so the result is model-specific by construction. E2B is the smaller model and the harder case; a matching measurement on the E4B default is being taken separately and will be posted here.
  • Do not read K = 4/5 as a verdict on the default profile until that second measurement lands. Do read it as a real result for NPU-profile users, who are a shipping configuration.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Correction to the scope note above — this is a default, not a caveat

My previous comment said not to read K = 4/5 as a verdict on the default profile until an E4B measurement lands. That understates it, and I'd rather correct it than let a reviewer under-weight the result.

gaia_agent_email/model_select.py (resolve_default_email_model, #1439) deliberately auto-selects gemma4-it-e2b-FLM whenever the Lemonade server reports an available AMD NPU and that model is servable there. Only otherwise does it fall back to DEFAULT_MODEL_NAME (Gemma-4-E4B-it-GGUF).

So there are two shipping defaults for this agent, not one default plus an edge case:

Hardware Model the email agent actually uses
NPU present, FLM model downloaded gemma4-it-e2b-FLM ← what this sweep measured
Everything else Gemma-4-E4B-it-GGUF

The sweep measured the NPU path, which is the intended, documented configuration on NPU hardware — the hardware this agent explicitly targets. N = 0/5 is therefore a real product result for those users, not an artefact of testing on the wrong model.

The pending E4B measurement covers the other default (GPU/CPU boxes). It can show the design working there; it cannot retire this result.

That has a consequence for how the fix should be judged: a design that routes scoping through the model's tool choice has to work on the smaller model too, or it doesn't work for NPU users. If E4B comes back clean, the compliant lever remains sharpening check_suspicious_mail's own docstring — tool-side, and still no phrasing special-cased — not accepting the NPU path as collateral.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Detection-accuracy gate — PASSED, but not cleanly

tests/integration/test_email_agent_triage.py::test_triage_meets_baseline_minus_tolerance against this branch (4be3a116), hermetic (249-message corpus in a FakeGmailBackend, no live mailbox), on Gemma-4-E4B-it-GGUF:

Triage accuracy (heuristic + LLM follow-up, Gemma-4-E4B-it-GGUF):
  category: 237/307 = 0.7720 (baseline 0.7960, floor 0.7460)
  spam:     276/307 = 0.8990
  phishing: 211/307 = 0.6873
PASSED
1 passed in 3003.59s (0:50:03)

AC#3 ("no regression in detection accuracy") is not yet settled by this, and the number shouldn't be read as a clean green:

  • Category accuracy is 0.024 below the recorded baseline (0.7720 vs 0.7960). It passes only because the 0.05 tolerance absorbs it.
  • The comparison isn't apples-to-apples. This ran at ctx 65536 (inherited from the server); the baseline was recorded at ctx 16384. The test never pins the context window — filed as fix(eval): the triage accuracy gate never pins ctx, so it silently compares across context windows #2915.
  • The denominator moved too. This run scored 307 messages; the baseline file records scored: 299. A baseline-relative gate whose corpus size has drifted is a second, independent way the comparison degrades. Flagged as unverified rather than root-caused here.

So three separate explanations for the 0.024 gap are live — this change, the ctx difference, or corpus/run variance — and the committed baseline cannot distinguish them.

Resolution in progress: the identical gate is running against origin/main (611b1928) in the same environment, same ctx, same resident model. AC#3 will be judged on this branch vs that control — differing only by the PR — with the committed baseline kept for context but treated as non-comparable. Results posted here when it completes.

Spam accuracy (0.8990) is the sub-metric most directly exposed to this change, since it threads is_phishing/is_spam structurally for the first time. The test surfaces accuracy only — it does not compute precision/recall/F1, though the baseline file carries those fields.

@itomek itomek self-assigned this Aug 12, 2026
…ly gets picked

The live phrasing sweep on PR #2910 (issue #2900) found check_suspicious_mail
was never selected -- 4 of 5 unrehearsed phrasings, including the most direct
one ("is there anything suspicious in my inbox?"), still called pre_scan_inbox
on the NPU shipping default (gemma4-it-e2b-FLM). AC#1 failed even though the
tool existed.

Two tool-side levers, no query matching (#2762 stays satisfied):

- pre_scan_inbox's trigger clause in _SYSTEM_PROMPT dropped the catch-all
  "what's in my inbox" phrasing, which was broad enough to swallow any inbox
  question including scoped ones, and the "prefer the narrower tool" guidance
  became an imperative MUST instead of a soft preference.
- check_suspicious_mail's own docstring now names the kinds of questions it
  answers ("anything ... looks suspicious", "anything to worry about") the
  same way check_followups already does, instead of only describing itself
  in abstract routing terms.

Added tests/integration/test_check_suspicious_mail_tool_selection_2900.py to
re-run the live sweep's exact 5 phrasings against a hermetic FakeGmailBackend
and gate on the tool actually selected (from the conversation trace, not the
rendered answer) -- this reproduces the live sweep's N/K tally as a
committed, re-runnable check instead of a one-off PR comment.
@github-actions github-actions Bot added the tests Test changes label Aug 12, 2026
@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

main control run — AC#3 settled, and the baseline gap explained

Ran the identical accuracy gate against origin/main (611b1928) in the same environment, same ctx, same resident model, serially after the PR run.

category spam phishing
committed baseline (ctx 16384, scored: 299) 0.7960 — —
main control (ctx 65536, 307 scored) 237/307 = 0.7720 0.8990 0.6873
this PR 4be3a116 (ctx 65536, 307 scored) 237/307 = 0.7720 0.8990 0.6873

Identical on every metric — and the per-message decisions are identical too. Extracting all 307 triage_decision lines from both runs and diffing them gives 0 differing lines. Not one message classified differently.

✅ AC#3 — "no regression in detection accuracy" — is satisfied, and more strongly than a threshold comparison would show: the delta is exactly zero, not merely within tolerance.

✅ The 0.024 shortfall against the committed baseline is not this PR. main shows the same 0.7720. So the gap comes from the comparison itself — the ctx mismatch (#2915) and/or the corpus drift (307 scored here vs scored: 299 in the baseline file) — which is independent confirmation of what #2915 describes.

🔍 Honest limit — what this evidence does not establish

The identical result was structurally likely rather than hard-won, and it would be overclaiming to present it otherwise. This gate drives triage_inbox_impl directly against a FakeGmailBackend; it never routes through the agent's tool selection, which is the only behaviour this PR changes. A zero delta is close to what the diff predicts.

What it does meaningfully prove is that the contract change is inert where it should be: threading is_phishing/is_spam structurally through PreScanItem/EmailPreScanResult and bumping to schema 2.13 perturbed neither classification nor serialisation. That was not guaranteed — a contract change is exactly the kind of thing that can silently shift a downstream field.

The evidence that actually decides this PR is the tool-selection measurement (does a scoped question reach check_suspicious_mail), which is running separately on NPU hardware. A clean accuracy gate does not substitute for it.

Both runs: Gemma-4-E4B-it-GGUF, hermetic, ~50 and ~54 minutes respectively, each in its own worktree with its own venv (verified gaia_agent_email resolving inside the correct checkout before either run — a shared venv resolves to the main checkout and would have silently tested the wrong tree).

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

NPU-hardware measurement — 🔴 the fix does not work where it has to

Measured on a Ryzen AI APU/NPU Linux box against b45f3712, with gemma4-it-e2b-FLM confirmed resident before and after every capture, fresh sidecar and fresh session per phrasing.

check_suspicious_mail selected
Hermetic harness (FakeGmailBackend, 249-msg fixture) 4 of 5 ✅
Live TUI, real mailbox 0 of 5 🔴

The live result exactly reproduces the pre-fix failure shape. 4 of 5 phrasings called pre_scan_inbox and never had the narrow tool in the trace at all; the 5th ("should I be worried about any of these emails?") called no tool and asked for clarification — expected, since "these emails" has no referent in a fresh session. Not even the most direct phrasing — "is there anything suspicious in my inbox?" — selected it.

So the wording change that moved the harness from 0/5 to 4/5 produced zero measurable improvement on the real mailbox through the real TUI.

✅ AC#2 still holds — the control ("triage my inbox") reaches pre_scan_inbox and renders the full needs-you list. No regression to general triage.

🔍 What was ruled out, and one trap worth knowing about

Not a wiring gap. check_suspicious_mail is registered and referenced in the system prompt on this exact build (agent.py:257,352, read_tools.py:3144), and the harness proves it is reachable when the model picks it. The live model simply routes around it on the real corpus.

⚠️ Paraphrase text is not tool evidence. One phrasing's rendered answer read "Here's your suspicious mail check" while its tool trace shows pre_scan_inbox and no narrow tool at all. Anyone reading transcripts rather than traces would have scored that a pass. This is exactly why the measurement was specified as a tool-call trace rather than an answer inspection.

The harness/live divergence is itself a finding. A hermetic harness on the fixture corpus gave a false positive here — 4/5 against 0/5 on the same commit and the same model family. Any future tool-selection claim in this package needs live confirmation; the harness is useful for iteration speed but cannot certify the behaviour.

Why this hardware is the bar, not a corner case: model_select.py's resolve_default_email_model (#1439) deliberately selects gemma4-it-e2b-FLM whenever an NPU is present and the model is servable. That is the shipping default on NPU hardware — the hardware this agent targets.

Evidence on-box under ~/gaia-evidence-2900-npu/: SUMMARY.txt, phase1_harness_full.log, and per-phrasing sidecar + screen captures for all five plus the control.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

E4B profile + what the two profiles mean together

Gemma-4-E4B-it-GGUF (the non-NPU shipping default), same harness, b45f3712:

N = 5/5. K = 0/5. Every phrasing selected check_suspicious_mail alone:

phrasing tools called
"is there anything suspicious in my inbox?" check_suspicious_mail
"anything sketchy come through today?" check_suspicious_mail
"did I get any phishing attempts?" check_suspicious_mail
"should I be worried about any of these emails?" check_suspicious_mail
"flag anything that looks off." check_suspicious_mail

AC#2 control: "triage my inbox" → pre_scan_inbox. General path unaffected.

⚠️ But read this before treating 5/5 as a pass

measurement result
E4B harness 5/5 ✅
NPU harness 4/5 ✅
NPU live TUI, real mailbox 0/5 🔴

The harness gave a demonstrated false positive. On NPU, the same commit and the same model scored 4/5 in the harness and 0/5 live. So the E4B 5/5 is not evidence the fix works on E4B in production — it is evidence it works in the harness, which we now know does not predict live behaviour for this measurement.

There is currently no trustworthy evidence that this fix works anywhere live. The single live data point is 0/5.

Why the harness misses it

The harness constructs an agent in-process against a FakeGmailBackend and a 249-message fixture. The TUI drives a daemon sidecar with a different lifecycle, against a real mailbox. That is the same in-process-vs-sidecar gap that has repeatedly let email-agent fixes pass every test and do nothing on the surface users drive.

The harness is still worth having — it captures tool-call traces rather than paraphrase text, which is the right instrument, and it iterates in minutes rather than an hour. But it needs to drive the sidecar rather than construct an agent directly before any tool-selection claim can rest on it.

Second-order behaviour change worth recording

Phrasing 4 ("should I be worried about any of these emails?") previously called no tool and asked for clarification — reasonable, as "these emails" has no referent in a fresh session. Post-fix on E4B it goes straight to check_suspicious_mail. That is a change in behaviour beyond scoping, not simply "the same clarification, now scoped", and should be judged deliberately rather than counted as a win.

@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

This adds a narrow check_suspicious_mail tool so "anything suspicious in my inbox?" gets just the phishing/spam-flagged mail instead of the whole four-section triage card, and promotes the phishing/spam flags from prose into real contract fields (schema 2.13). The design is careful — the flagged subset is captured before the actionable cap, so a flagged message ranked past it is still counted — and the test coverage is unusually thorough, including a pinned test for the known both-tools-called residual.

Two things need to happen before merge:

  • The schema bump will fail CI. Two committed tests still assert the contract version is the old 2.12; bumping to 2.13 without updating them turns the suite red. Fix is mechanical.
  • This changes how the model picks tools, and nothing here shows it works. The system prompt and tool descriptions were rewritten to steer the model to the narrow tool, and the PR's own new test file records that before the fix the model picked the wrong tool on all five test phrasings. The repo requires an agent eval run against the committed baseline for prompt and tool-description changes, plus the re-run phrasing numbers. If those are already in the PR description, point at them — I reviewed from the diff only (the gh CLI was unavailable in this run).

Worth resolving in the same pass, not blocking on their own: the flagged list now reaches the user as free-form model prose (the full triage card is rewritten from tool data precisely because the model corrupted hand-summarized lists; this new path deliberately opts out of that and has no card renderer), the tool never tells the model to state scan coverage so "nothing flagged this scan" after looking at 50 of 812 messages reads as an all-clear, and the published TypeScript client is left describing the old contract.

Real-world evidence

The automated evidence stage failed before producing anything (evidence-bundle.md says the harness errored on auth/install/rate-limit), so no surface was exercised in this run — the verdict above rests entirely on static review. That matters more than usual here: the user-visible behaviour this PR changes is which tool the model chooses, which unit tests cannot gate. The new hermetic integration test (test_check_suspicious_mail_tool_selection_2900.py) is the right harness for it, but it skips without Lemonade and nothing in this run shows its result.

🔍 Technical details

Issues

🔴 Two committed tests pin the old schema version — CI will fail

SCHEMA_VERSION moves to "2.13" (contract.py:273), but both of these still assert "2.12" and import the real module (pytest.importorskip("gaia_agent_email"), so they run wherever the hub package is installed):

  • tests/unit/agents/email/test_attention_contract.py:53
  • tests/unit/agents/email/test_contract_schema.py:374

The hub package's own copies were updated; these core-repo ones were missed.

        assert SCHEMA_VERSION == "2.13"

(for test_attention_contract.py:53 — apply the same at test_contract_schema.py:374, and extend that test's docstring version history with the 2.13 entry, matching how every prior bump documented itself there.)

🟡 LLM-affecting change with no eval or post-fix sweep in evidence

agent.py rewrites the PRE-SCAN BEHAVIOR block and adds a new tool docstring — both on CLAUDE.md's "requires gaia eval agent before merge" list (system prompt, tool docstrings, the tool schema sent to Lemonade). The prompt now asserts a narrower tool "MUST be used instead" of pre_scan_inbox; the regression risk is the mirror case — general asks getting diverted. test_general_triage_control_unaffected covers exactly one control phrasing, live-only.

Needed: a gaia eval agent run compared against the matching committed baseline, and the re-measured 5-phrasing sweep on gemma4-it-e2b-FLM (the test file documents the pre-fix result as N=0/5, K=4/5).

🟡 The new tool's output is neither grounded nor rendered

rewrite_triage_answer exists because the model corrupted hand-summarized lists in five consecutive live runs, and it keys on the literal name pre_scan_inbox — so check_suspicious_mail gets no grounding pass (deliberate, read_tools.py:3189). It is also absent from _RENDER_TOOL_TO_LANG (src/gaia/ui/sse_handler.py:503), so no card draws either. Net: the phishing list — the highest-stakes list this agent produces — reaches the user purely as model prose, defended only by docstring instructions ("list EVERY entry individually").

The symmetric fix is a scoped renderer or a narrow rewrite for kind: "email_suspicious_scan" that emits just the flagged rows from tool data. If the risk is being accepted for now, say so explicitly in the CHANGELOG entry.

🟡 No coverage-honesty instruction on the new tool

check_suspicious_mail returns scanned and total_inbox but its docstring never tells the model to state them, while pre_scan_inbox's docstring carries an explicit "ALWAYS mention scan coverage in your framing sentence when scanned is less than total_inbox" (read_tools.py:3093). The zero-case guidance covers the wording but not the numbers, so "nothing flagged this scan" after scanning 50 of 812 messages reads as a whole-inbox all-clear — the exact failure #2584/#2638 added those fields to prevent. Add the same ALWAYS-mention sentence to this docstring.

🟡 npm client left describing schema 2.12

hub/agents/email/npm/src/types.ts:59 still pins SCHEMA_VERSION = "2.12" and its EmailPreScanResult has neither suspicious nor suspicious_total; SPEC.md:5,823 and the npm CHANGELOG.md likewise still describe 2.12 as current. Not a runtime break (the client accepts a higher MINOR), but a TS consumer can't read the new fields, and every prior additive bump (2.11 #2743, 2.12 #2829) updated all three in the same PR.

Nits

🟢 Empty rationale wipes the "flagged as phishing" label (read_tools.py:2132) — the conditional binds as (label + " — " + why) if why else "", so a flagged message with no rationale gets why == "". Pre-existing, but this PR rebinds those exact lines and now surfaces the row to the user as the answer. The unit fixture always sets a rationale, so nothing catches it.

                flagged_item = {
                    **base,
                    "why": (
                        "flagged as phishing"
                        if r.get("is_phishing")
                        else "flagged as spam"
                    )
                    + (f" — {why}" if why else ""),
                }

🟢 Read-tool list in the guide is now incomplete (docs/guides/email.mdx:298) — the "Action surface → Read" list ends at check_followups; add check_suspicious_mail alongside it.

🟢 The tool-selection gate is very weak (tests/integration/test_check_suspicious_mail_tool_selection_2900.py:1744) — never_narrow < 5 passes when 1 of 5 phrasings works. The docstring justifies not requiring 5/5, but a floor (e.g. ≥3/5) would still catch a partial regression that this assertion sleeps through.

Strengths

  • The pre-cap capture is the right call and is tested for exactly the trap it avoids — test_flagged_message_past_the_actionable_cap_is_still_counted even asserts the fixture really exercises the cap, so the test can't silently stop proving its claim.
  • test_both_tools_called_prescan_still_wins_documented_residual_risk pins known-imperfect behaviour instead of asserting it away, and says why fixing it would violate Email Agent Validation Index — four sense-making jobs, tested by intent not by phrasing #2762.
  • Contract-surface sync is otherwise complete and consistent: CONTRACT.md version history, openapi, specification.html, capability matrix, tools_count in both gaia-agent.yaml and build_registration(), and every envelope-shape test that enumerates prescan keys.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks — this is a strong review, and the grounding finding is one I missed when the design was approved.

On "nothing here shows it works": correct, and the measurements are now summarised at the top of the PR description. Short version — detection accuracy is unchanged (zero delta against a same-ctx main control, and 0 differing per-message decisions across all 307), but the behavioural goal is not demonstrated: on the NPU profile the scoped tool was selected 0 of 5 times live, exactly reproducing the pre-fix shape. A live E4B sweep is the deciding measurement and is running. The NPU profile has been descoped by the maintainer; if the behaviour can't be closed here it moves to #2918.

One thing your review couldn't see that matters for anyone reading the harness result: the hermetic harness disagrees with live on the same commit and the same model — 4/5 versus 0/5. You correctly identified that harness as the right instrument for a tool-choice change; it turns out it can't certify one, because it builds an agent in-process while the TUI drives a daemon sidecar. That gap is recorded in #2918.

On the ungrounded, unrendered output — this is the most valuable point here and it is being fixed. rewrite_triage_answer exists because the model corrupted hand-summarized lists in five consecutive live runs; keying it on pre_scan_inbox means the new tool opts out of exactly that protection, and the absence from _RENDER_TOOL_TO_LANG means no card draws either. So the highest-stakes list this agent produces reaches the user as free-form prose defended only by a docstring. That satisfies #2762's "never special-case a phrasing" rule while breaking its "every fact arrives precomputed from the tool" rule on the new path — a contradiction that shouldn't ship.

On scan-coverage disclosure: you and CI found the same thing independently — test_pre_scan_coverage_disclosure is currently failing on this branch. Your framing is the useful one: "nothing flagged this scan" after looking at 50 of 812 messages reads as an all-clear. Being handled as a real behaviour question, not a stale assertion to update.

On the schema pins: already in flight, along with a lint failure on the new harness file and a tool-allowlist guard in a third location — all consequences of verifying inside hub/agents/email/python/ only, while this PR also touches tests/unit/ and tests/integration/.

Also taking: the published TypeScript client still describing the old contract.

Not taking here: the sidecar's lock-vs-sentinel ordering you flagged on the sibling PR is filed as #2919, and the input-blocking window as #2917.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

⚠️ Retraction: the "0/5 live" result is invalid — the instrument could not see the distinction

I posted a live NPU result of check_suspicious_mail selected 0/5 and concluded the fix does not work. That conclusion is not supported, and I'm withdrawing it.

The live sweep scored tool selection from the sidecar's tool_call name=… log lines. Those lines cannot distinguish the two tools:

  • check_suspicious_mail (read_tools.py) does not wrap itself in log_tool_call. It calls agent._pre_scan_all_backends(...) → pre_scan_inbox_impl.
  • pre_scan_inbox_impl wraps its body in log_tool_call("pre_scan_inbox", …) — a literal name.

So a successful check_suspicious_mail invocation emits tool_call name=pre_scan_inbox, identical to a genuine pre_scan_inbox call. A run where the model correctly chose the scoped tool every time would score 0/5 on that instrument. The measurement could not have produced any other answer.

What this changes

claim status
"NPU live: scoped tool selected 0/5" ❌ withdrawn — instrument blind to the distinction
"The harness gives false positives" ❌ backwards — see below
"Detection accuracy unchanged (zero delta, 0 differing decisions across 307)" ✅ stands — different measurement, unaffected

I had concluded the hermetic harness was unreliable because it disagreed with the live run. That reasoning inverted: the harness scores from process_query's conversation trace, which records the tool the agent actually chose, and is the more reliable instrument of the two. The harness results — NPU 4/5, E4B 5/5 — are currently the best evidence available, and they suggest the fix works.

They are still not a live measurement, so this is not a claim that it works. It is a return to "not yet measured live", which is where this stood before the invalid result.

Making it measurable

The cheapest fix is to give check_suspicious_mail its own log_tool_call("check_suspicious_mail", …) wrapper. That makes the tool observable in the sidecar log — which it should arguably be regardless, since a tool that is invisible in its own trace is hard to debug for reasons well beyond this measurement. With that in place the live sweep becomes valid and can simply be re-run.

Also blocked, separately

The live E4B sweep could not run at all. POST /v1/email/agent/session has no model_id field, EmailAgentConfig.model_id therefore stays None, and resolve_default_email_model() probes only for an NPU and the FLM model's presence — it never consults gaia config set default_model. So no live TUI session on an NPU-equipped box can currently be pinned to a different model, and my earlier suggestion that the config was the lever was wrong. Verified empirically: config set, fresh session, model_loaded: gemma4-it-e2b-FLM.

The test box's default_model was set during that attempt and has been restored and verified back to gemma4-it-e2b-FLM.

PR #2910 (issue #2900) added check_suspicious_mail and bumped the email
contract schema to 2.13, but tests/unit/agents/email/ and
tests/unit/agents/test_email_agent.py are a second, separate test
location that duplicates parts of hub/agents/email/python/tests/ and
was never run against this change:

- Two schema-version pins (test_attention_contract.py,
  test_contract_schema.py) still asserted "2.12". The 2.13 bump is
  intentional and already consistent across contract.py, CONTRACT.md,
  and CHANGELOG.md -- updated both pins to 2.13, following each file's
  own established convention of documenting every additive bump inline.
- test_no_unexpected_tool_set's tool allowlist didn't include the new
  check_suspicious_mail tool -- added it.
- test_pre_scan_coverage_disclosure asserted on a fixed 1500-character
  window after the "PRE-SCAN BEHAVIOR:" header. #2900 added ~500 chars
  of narrower-tool routing guidance ahead of the existing coverage-
  disclosure paragraph in that same section, pushing the disclosure
  text just past the window -- the instruction itself was never
  dropped or weakened. Replaced the fixed window with a bound on the
  next ALL-CAPS section header, so the test tracks the actual section
  instead of a byte count that silently truncates as the prompt grows.

Also reformats the new live-sweep harness
(tests/integration/test_check_suspicious_mail_tool_selection_2900.py)
with black -- unrelated to the above, just unformatted in the original
commit.
@itomek

itomek commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

Note on the eval check. rag_quality + context_retention + tool_selection vs Gemma baselines fails for a runner-side reason, not this change — tracked as #2920, now its third occurrence today across three unrelated PRs. The RAG embedder fails to load, the chain never starts, and the integrity gate correctly refuses to emit a verdict — so no scenario is scored and the failure says nothing about this PR. Not re-run here: it already failed twice on a sibling PR with an identical signature.

The three test failures this PR actually caused are fixed and passing on the re-run (Email Agent Unit Tests py3.10 + py3.12, Test Email Agent), and Run Code Quality Checks is green.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 The contract version moved to 2.13 on the Python side, but the published npm client was left at 2.12 — so the two halves of this agent now disagree about what the contract is.

Practically: an app integrating via @amd-gaia/agent-email gets no typed access to the new suspicious-mail fields the sidecar now returns, and the npm technical reference still tells readers its pinned version "match[es] the sidecar's current contract", which stops being true the moment this merges. Every earlier additive bump in this same unreleased train (2.11, 2.12) updated both sides together; nothing in CI catches the split.

Worth bumping the client and its docs in this PR, or saying explicitly in the description that npm follows separately.

🔍 Technical details

contract.py now pins SCHEMA_VERSION = "2.13", but:

Precedent for same-PR parity: types.ts:51 carries the "Schema 2.12 (additive over 2.11, #2829)" note alongside the Python-side #2829 entry that is still in this package's Unreleased block.

Why CI is silent: npm/test/browser-entry.test.ts:61 asserts "2.12" against the unchanged npm constant, and there is no cross-language parity check anywhere in the repo — so the split passes green. This is the bundled-doc contradiction CLAUDE.md's doc-sync rule calls out (#1841): README / SPEC / SKILL / CHANGELOG for a hub agent package must move with the behavior they describe.

check_suspicious_mail (#2900) had three gaps the review on #2910 caught:

- Its flagged phishing/spam list reached the user as free-form model prose,
  with no grounding pass and no render card — the highest-stakes list this
  agent produces was the one left unprotected. Adds
  rewrite_suspicious_mail_answer, the narrow-tool counterpart to
  rewrite_triage_answer, so the list is always rendered from the tool's own
  data. Deliberately a no-op when pre_scan_inbox also ran the same turn,
  matching that function's existing precedence.
- The tool delegates to pre_scan_inbox_impl's shared scan, which logs its
  own call as literal "pre_scan_inbox" — so a successful
  check_suspicious_mail call was indistinguishable from pre_scan_inbox in
  the tool trace. This already caused a false "0/5" tool-selection score
  that was later retracted. check_suspicious_mail now wraps its own
  log_tool_call under its real name.
- The published TypeScript client still pinned SCHEMA_VERSION 2.12 and was
  missing PreScanItem.is_phishing/is_spam and
  EmailPreScanResult.suspicious/suspicious_total (schema 2.13). Brings
  types.ts and its docs in line with the Python contract.

Also widens the AC#2 tool-selection control from one general phrasing to
four, since the prompt's routing sentence was strengthened to an
imperative in the same PR.

get_briefing's cold path shares the same log_tool_call blind spot
(_pre_scan_all_backends without its own wrapper) — flagged for a follow-up,
not fixed here. Confirmed there is no CI check comparing the Python
contract's SCHEMA_VERSION against the npm client's constant.
@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Skill audit

Skill Verdict Claimed tier Cleared tiers Findings Rules
hub/agents/email/npm ✅ ALLOW experimental experimental, community 2 medium, 1 info code.suppression, supply.undeclared_dependency

✅ All audited skills cleared the tier they claim.

Per-finding detail is withheld here on purpose. Read it in the Security > Code scanning tab, or download the skill-audit-reports artifact from this run. Offending source text is withheld from CI everywhere — reproduce it locally with gaia skill audit <dir> --show-snippets.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 check_suspicious_mail can wrongly claim "no mailbox connected" in a long-lived session. It decides that up front from the mailbox list the agent resolved when it was constructed, and never re-resolves. Every other pre-scan tool re-resolves on each call — that's what lets an Agent UI session pick up a mailbox you connect mid-conversation, or recover from a connector hiccup at startup, without a restart. So a user who connects Gmail and then asks "anything suspicious?" gets a hard error, while "what's in my inbox?" works fine on the same turn.

Fix is to re-resolve before the check, not to drop the check. The new tests can't catch this — their agent stand-in replaces the scan path entirely, so the refresh step never exists in them.

🔍 Technical details

hub/agents/email/python/gaia_agent_email/tools/read_tools.py:3193 guards on agent._backends, which is only populated in EmailTriageAgent.__init__ (agent.py:788, and set to {} on any ConfigurationError/ConnectorsError there). The refresh happens inside _pre_scan_all_backends → _refresh_mail_backends() (agent.py:1663), which this guard short-circuits before ever reaching.

_refresh_mail_backends assigns self._backends before self._gmail = next(iter(backends.values())), so letting its empty-mailbox StopIteration fall through still leaves _backends correct for the guard below:

                try:
                    # Re-resolve first: _backends is stale on a cached agent
                    # whose mailbox was connected after construction.
                    agent._refresh_mail_backends()
                except (ConnectorsError, ConfigurationError, StopIteration):
                    pass  # no mailbox resolved — reported loudly by the guard below
                    if not agent._backends:

(Sketch, not a drop-in — the indentation needs fixing against the surrounding with log_tool_call(...) block, and ConfigurationError needs importing if it isn't already in this module.)

Test gap: _Host._pre_scan_all_backends in tests/test_suspicious_mail_2900.py:364 overrides the real method, so no test exercises a refresh; test_no_mailbox_connected_returns_actionable_error passes either way.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Live re-measurement with a working instrument — the fix works: 4/5

Re-measured on 67ee95d9, live Outlook mailbox, five fresh sessions, on a Ryzen AI APU/NPU Linux box.

Instrument proven before any tally was produced (the step whose absence caused the earlier retraction): check_suspicious_mail's own tool_call line now appears — and appears first — only when the model selects it, while the general-triage control shows pre_scan_inbox/triage_inbox with no such line at all. The mechanism was read from source rather than inferred: the tool wraps its own body, then delegates internally to pre_scan_inbox_impl, which carries its own separate wrapper.

result
N — selected check_suspicious_mail 4 of 5
Called no tool 1 of 5 — P4 "should I be worried about any of these emails?" asked for clarification
K — genuine second top-level pre_scan_inbox selection 0 of 5
AC#2 control — "triage my inbox" PASSED, full four-bucket report, pre_scan_inbox only

On K, stated carefully because it is exactly where this feature was misread before: 4/5 turns do show a pre_scan_inbox line — but nested, as implementation delegation, not as a second model choice. Reporting that as K = 4 without the distinction would recreate the confusion this measurement exists to resolve.

The earlier 0/5 was the instrument, not the model

This result matches the hermetic harness's NPU prediction — 4/5 — exactly. The harness was reliable all along; the retracted live measurement was scored from a trace in which a correct selection was indistinguishable from a wrong one. Both halves of that retraction are now confirmed by measurement rather than by argument.

The answers were also correct, not just the tool choice

Cross-checked against the sidecar's own /v1/email/prescan endpoint directly, bypassing the LLM: the live mailbox genuinely has suspicious_total = 0 right now. So the four "nothing suspicious" answers were accurate, not hallucinated silence — a distinction worth making explicitly, since an empty answer is exactly what a broken scan would also produce.

🔍 Model identity, and what could not be observed live

The box had a co-tenant's Qwen3.5-35B-A3B-GGUF resident at start; it was evicted automatically by the first live query, and every capture from P1 onward measured gemma4-it-e2b-FLM before and after, stable across all five phrasings and the control. Zero captures voided, no mid-capture flips. This is an NPU/FLM measurement and is comparable to the NPU harness bucket, not to E4B.

The grounding rewrite could not be exercised live — with suspicious_total = 0, the non-empty render path never fires. Verified instead through its 7 unit tests, including one that feeds deliberately wrong model prose ("Nothing flagged this scan") and confirms rewrite_suspicious_mail_answer replaces it with the tool's own row. Stated as a gap rather than implied: the guard is proven by test, not by live observation.

Lease released, box confirmed FREE, all started processes torn down.

check_suspicious_mail decided "no mailbox connected" from _backends as it
stood at agent construction, so a mailbox connected mid-session (or a
startup that recovered from a ConfigurationError) still hit a hard error
even though pre_scan_inbox worked fine on the same turn. Every other
pre-scan-derived tool re-resolves per call via _refresh_mail_backends();
this guard short-circuited before that ever ran.

Fix re-resolves first and keeps the guard, so a genuine no-mailbox state
still reports the same clear message.

The existing _Host test stand-in overrides _pre_scan_all_backends and
never touches _refresh_mail_backends, so it couldn't have caught this.
Added a no-op _refresh_mail_backends to the stand-in (for the tests that
aren't about refresh behavior) and a new test against a real
EmailTriageAgent constructed via the #2418 zero-connector path, where a
mailbox becomes resolvable after __init__ -- this reproduces the bug
against pre-fix code and passes only with the fix.
@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed — check_suspicious_mail now re-resolves mailboxes before its guard, same as every other pre-scan tool.

🔍 Technical details

read_tools.py:3193 now calls agent._refresh_mail_backends() first (swallowing ConfigurationError/ConnectorsError so a genuine no-mailbox state still falls through to the same NO_MAILBOX_CONNECTED_MESSAGE), then checks agent._backends.

On the test gap: the _Host stand-in in test_suspicious_mail_2900.py overrides _pre_scan_all_backends directly and never touches _refresh_mail_backends, so no existing test could have caught this. Added TestCheckSuspiciousMailLongLivedSession, which constructs a real EmailTriageAgent via the #2418 zero-connector path (nothing connected at __init__, agent._backends == {}), then makes a mailbox resolvable afterward and calls the real registered tool. It fails against pre-fix code and passes with the fix. Gave _Host a no-op _refresh_mail_backends so its other tests (which aren't about refresh behavior) keep passing.

Checked the rest of this PR's new tests for the same stand-in pattern: test_check_suspicious_mail_tool_selection_2900.py (tests/integration/) constructs a real EmailTriageAgent per phrasing, not a stand-in, so it's clean. The other modified files in this PR are schema-version-pin / set-membership updates, not new stand-ins.

Commit: 9fdd1c57. Full email-agent suite: 1903 passed (was 1902 baseline + 1 new test).

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Evidence attribution note. The live tool-selection measurement above (4/5) was captured on 67ee95d9; the branch head is now 9fdd1c57 (the stale-backends guard fix).

That measurement still applies. The delta between those commits touches only check_suspicious_mail's internal backend-refresh guard — an added import and a try/except agent._refresh_mail_backends() block — with no change to the tool's docstring or its registration, which are what drive the model's selection. Verified by reading the diff rather than assuming it.

Stated explicitly because this PR has already had one measurement invalidated by an unexamined assumption, and "the evidence was taken on an older commit" is a reasonable thing for a reviewer to want ruled out.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Note on the Verify external URLs failure — not this PR. Tracked as #2925.

It reports docs/plans/email-triage-agent.mdx:2327 → https://github.com/amd/gaia/issues/702 as broken. That issue is open and valid, this PR does not touch that file, and the same check fails on main itself — the three most recent main runs are failure / success / failure on unchanged input. Most likely github.com rate-limiting the checker and a throttled response being scored as broken rather than unverifiable.

Not re-run: it is non-deterministic against an unchanged tree, so a green retry would prove nothing.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 The new grounded phishing summary can tell the user a number it then doesn't show.

The flagged-mail list is capped at 10 rows, but the sentence written above it uses the true pre-cap count. With 14 flagged messages the reply reads "14 flagged messages this scan" followed by 10 entries, with nothing saying four were left out — the same silent-truncation the rest of this PR is careful to avoid, on the one list where a missed entry matters most. Worth adding a "showing the first N" clause (or raising the cap) before merge.

🔍 Technical details

_honest_suspicious_summary (hub/agents/email/python/gaia_agent_email/answer_grounding.py:545) reads suspicious_total, while render_suspicious_list renders the already-capped suspicious list — capped at PRE_SCAN_SUSPICIOUS_CAP = 10 in read_tools.py:1595 and again post-merge at read_tools.py:2551. check_suspicious_mail forwards both verbatim and carries no truncation marker, so nothing downstream can reconcile them.

It also contradicts the tool's own docstring, which tells the model suspicious_total "is the exact count — state it verbatim and list EVERY entry individually; never summarize, merge, or drop entries."

    total = envelope.get("suspicious_total")
    shown = len(envelope.get("suspicious") or [])
    if not isinstance(total, int):
        total = shown
    noun = "message" if total == 1 else "messages"
    coverage = f"{envelope.get('scanned', 0)} messages scanned"
    if total > shown:
        return f"{total} flagged {noun} this scan — showing the first {shown}. {coverage}."
    return f"{total} flagged {noun} this scan. {coverage}."

The existing out.startswith("1 flagged") assertion in test_suspicious_mail_2900.py still holds; a case with suspicious_total > PRE_SCAN_SUSPICIOUS_CAP would be worth pinning too.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Note on behavior-e2e — unrelated to this PR.

test_builder_creates_agent_file failed with verdict counts {true_success: 4, false_success: 0, honest_failure: 1}.

Two reasons it isn't this change:

  • This PR touches zero BuilderAgent or behaviour-harness files (git diff --name-only origin/main..HEAD → no matches for builder/behavior).
  • false_success: 0 — the regression class the test exists to catch (per its own message: "claimed success with no side-effect — this is the Agent Builder silently fails to create agents (~40% of runs), sometimes reports a false success #1428 class of regression") did not occur. The single non-success was an honest_failure: the agent failed and reported it, which is the safe failure mode.

So a five-run LLM-driven scenario returned 4 clean successes and 1 honest failure, and the aggregate bar rejected it. Flagging rather than re-running, since I can't tell from here whether the pass criterion is intentionally 5/5 — if it is, that's worth knowing given the run is stochastic by construction.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Unit Tests (py3.11) — also not this PR. Tracked as the issue just filed above.

tests/integration/test_lemonade_release_assets.py::test_every_supported_target_resolves produced http.client.RemoteDisconnected: Remote end closed connection without response — an ERROR, not a failure, meaning it came from the require_github_network fixture rather than the test body. The guard handles no network but lets a transport-level error from a reachable-but-flaky remote escape as an error instead of a skip.

All four red checks on this PR are now traced to infrastructure, none to the change:

check cause
Unit Tests (py3.11) transient RemoteDisconnected in a network-guarded test
Verify external URLs #2925 — reports a valid open issue URL as broken, red on main too
behavior-e2e stochastic 5-run LLM scenario; false_success: 0, so the guarded regression did not occur; 0 BuilderAgent files touched
build-apps external 503 during Electron native-dependency download; 0 files touched in those app dirs

…'t have

check_suspicious_mail's rows never land on the positional triage card, so
numbering them let a later "archive 1" resolve against a stale, unrelated
pre_scan_inbox card instead of this list — acting on the wrong message.
Rows now render as bullets, matching the sender/subject-no-number
convention used everywhere else a row has no card ref.

Also fixes the lead sentence quoting the true flagged-message count while
the list underneath is capped at 10: it now discloses the cap ("N flagged
— showing 10") instead of silently disagreeing with what's rendered, and
the tool's own docstring no longer promises to list every entry when the
payload can carry at most 10.
@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed both in 6638d3b: flagged-mail rows now render as bullets (no number the card doesn't carry), and the lead sentence discloses the cap instead of quoting a count the list below never shows.

🔍 Technical details
  • render_suspicious_list (answer_grounding.py) no longer numbers rows — - {who} — {what} instead of {i}. {who} — {what}, matching the existing no-ref convention (render_needs_you_list prints row.get('ref'), which these rows never carry).
  • _honest_suspicious_summary now says "N flagged messages this scan — showing M." when suspicious_total (pre-cap) exceeds the rendered suspicious list (capped at PRE_SCAN_SUSPICIOUS_CAP), so the two numbers never silently disagree. Kept the existing cap rather than raising it — EmailPreScanResult.suspicious_total's own field docs already describe suspicious as a "possibly capped" list this total reconciles against, matching the "N of M" pattern already used for needs_you_total.
  • check_suspicious_mail's tool docstring no longer tells the model to "list EVERY entry ... never drop entries" unconditionally — it now instructs disclosing the gap when suspicious_total exceeds what's returned, so the docstring stops promising something the capped payload can't deliver.
  • Added a malformed-suspicious_total guard: falls back to the shown count (the only honest number available) but logs a warning instead of failing silently.
  • Checked for the same numbering bug elsewhere in the rewrite path — render_needs_you_list is the only other renderer and it's unaffected (its rows do carry a real ref).
  • Regression tests added in test_suspicious_mail_2900.py: rendered rows must not start with a positional number (fails against the pre-fix enumerate rendering), the cap-disclosure summary (unit + end-to-end), and the docstring no longer over-promising.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Evidence attribution — the 4/5 live measurement still applies at 6638d3bf.

The measurement was captured on 67ee95d9. Since then the branch gained the stale-backends guard, the contradicting-lead fix, and now the numbering/cap fixes. Because this design routes scoping through the model's choice of tool, and that choice is driven by check_suspicious_mail's docstring, a docstring edit is exactly the kind of change that could invalidate it — so it was checked rather than assumed.

Verified against the diff: 26 docstring lines changed since the measurement, and zero of them touch the trigger clause (Use this — NOT pre_scan_inbox — when the user asks if anything looks suspicious…). Every change is to the output-formatting instruction — how to report suspicious_total and its capped list. Registration is unchanged.

So selection behaviour is unaffected and the 4/5 stands. Flagging the reasoning because "it's only a docstring" is not a safe assumption in this particular design — the docstring is the mechanism.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

build-apps (windows/jira) — external, second occurrence, not re-running again.

Two failures now on this PR at the same step, with different transport errors:

attempt error
earlier run Response code 503 (Service Unavailable)
current run RequestError: socket hang up

Both fail in Electron Forge's native-dependency download (Copying files / Preparing native dependencies / Packaging application), and this PR touches zero files under src/gaia/apps/jira/ or src/gaia/apps/example/. Two distinct transport errors at the same step points to sustained upstream unavailability rather than a one-off blip, so a third re-run isn't warranted — it would just be retrying into an outage.

Unlike the other red checks here, this one is genuinely external rather than a repo-side handling defect, so it isn't filed as an issue. If it persists beyond today, the repo-side angle worth considering is that the packaging step has no retry around a known-flaky external download.

Status of all red checks on this PR — none are the change:

check cause
build-apps external CDN: 503, then socket hang up
Verify external URLs #2925 — reports a valid open issue URL as broken; red on main too
behavior-e2e stochastic LLM scenario; false_success: 0, 0 BuilderAgent files touched
Unit Tests (py3.11) #2927 — network guard errors instead of skipping on a flaky remote

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Brought current with main (f5d95b8e) — the only delta is the TUI cancel/SSE work from #2912, zero change to any email-agent or sse_handler file, so the live 4/5 tool-selection measurement still applies unchanged. Verified with a diff rather than assumed.

The PR description has also been corrected: it was still leading with the withdrawn "0 / 5 live" result as its headline evidence status.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 A failed mailbox now disappears from the "anything suspicious?" answer.

The new flagged-mail rewrite throws away everything the model wrote and replaces it with a summary built only from the flagged count and the scanned count. The scan result does carry a "one of your mailboxes couldn't be read" signal — the tool deliberately passes it through — but the replacement summary ignores it, so if Outlook's grant is revoked while Gmail scans fine, the user reads "2 flagged messages this scan. 25 messages scanned." and reasonably concludes both mailboxes were checked. On a phishing question that's the same false-all-clear this PR just fixed, one layer up.

Worth folding the partial-coverage notice into that summary line before merge.

🔍 Technical details

gaia_agent_email/answer_grounding.py:544 — rewrite_suspicious_mail_answer sets lead = _honest_suspicious_summary(scan) unconditionally, discarding the model's prose entirely. Note this differs from rewrite_triage_answer:467, which keeps _lead_paragraph(final_answer) and so can carry a coverage caveat through.

_honest_suspicious_summary (:548-582) reads only suspicious, suspicious_total, and scanned. check_suspicious_mail (tools/read_tools.py:3230-3232) puts degraded / mailbox_errors into the same envelope, so the data is right there:

    noun = "message" if total == 1 else "messages"
    coverage = f"{envelope.get('scanned', 0)} messages scanned"
    if envelope.get("degraded"):
        failed = ", ".join(
            str(e.get("mailbox")) for e in envelope.get("mailbox_errors") or []
        )
        coverage += f" · could NOT scan {failed or 'one connected mailbox'}"
    if shown < total:
        return f"{total} flagged {noun} this scan — showing {shown}. {coverage}."
    return f"{total} flagged {noun} this scan. {coverage}."

The zero-flagged + degraded case escapes even that, since rewrite_suspicious_mail_answer returns early on an empty render — there the model's own prose stands, which is at least free to mention the failure.

… lead

rewrite_suspicious_mail_answer's grounded lead sentence replaced the
model's own framing unconditionally, which was the right call for
false all-clears but also dropped two coverage caveats the model's
sentence could have carried: a mailbox that failed this scan, and a
partial inbox scan. Both are the same false-all-clear class this
rewrite exists to prevent, one layer up — a user reading "2 flagged
messages this scan. 25 messages scanned." has no way to know Outlook
was never reached, or that only 50 of 812 inbox messages were looked
at.

_honest_suspicious_summary now names the failed mailbox (via the
existing google/microsoft -> Gmail/Outlook mapping in mailbox_state.py)
when the envelope is degraded, and states "X of Y in the inbox
scanned" instead of a bare count when the scan is partial.
@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Good catch, and it was worse than the one instance — the same sentence was also dropping the partial-inbox caveat. Fixed both in 7db091fa.

The grounded lead now carries the coverage the model's replaced sentence could have: a failed mailbox is named ("Outlook couldn't be scanned (token expired); results below are from the rest of your mailboxes only."), and a partial scan states its denominator ("50 of 812 in the inbox scanned") instead of a bare count. Neither fabricates anything when the envelope doesn't carry it.

🔍 Technical details

answer_grounding.py — _honest_suspicious_summary now reads degraded/mailbox_errors (which check_suspicious_mail already passes through, read_tools.py:3230) and total_inbox, and a new _mailbox_failure_caveat renders the failed-mailbox clause. Reuses the existing provider_label() / PROVIDER_LABELS map in mailbox_state.py:46 rather than adding a second mapping; confirmed against resolve_mail_backends() (config.py:605) that the keys really are google/microsoft.

No fabrication paths: total_inbox of None, or scanned >= total_inbox, keeps the bare-count phrasing; a malformed mailbox_errors entry logs a warning rather than being silently dropped; degraded with no usable entries still emits a caveat sentence.

Mutation-proven. 8 new tests in TestSuspiciousSummaryCoverageCaveats; with the fix reverted, the 5 that assert the new behaviour fail, and the 3 that pin "no spurious caveat" correctly pass either way (they guard against over-firing, not under-firing). Full email-agent suite: 1926 passed, 4 skipped.

Stated because this PR has already had one measurement invalidated by an instrument that could not distinguish the outcomes — a test that passes with and without the fix is not evidence, so each new one was checked individually.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 The new degraded/partial-scan caveat never reaches the answer that most needs it — the all-clear.

The suspicious-mail rewrite only replaces the lead when the scan actually flagged something. So when one mailbox fails to scan (expired Outlook token, revoked grant) and the mailboxes that did scan flag nothing, the user asking "anything suspicious?" gets the model's unqualified "Nothing flagged this scan" — with no mention that half their account wasn't looked at. That's the false all-clear this rewrite exists to prevent, and it's worse than the wordy-lead case the push just fixed.

Worth extending the same lead to the zero-findings path whenever the envelope is degraded or the scan was partial.

🔍 Technical details

answer_grounding.py — rewrite_suspicious_mail_answer bails at:

rendered = render_suspicious_list(scan)
if not rendered:
    return final_answer

render_suspicious_list returns "" for an empty suspicious, so _honest_suspicious_summary (and with it _mailbox_failure_caveat + the scanned-of-total_inbox clause added in this push) is skipped entirely.

Nothing downstream covers it either: find_unqualified_negative_claim — the existing all-clear guard — starts with last_tool_payload(conversation, "pre_scan_inbox") and returns None when only check_suspicious_mail ran. A check_suspicious_mail-only turn therefore has no coverage guard at all.

Sketch:

    rendered = render_suspicious_list(scan)
    if not rendered:
        if scan.get("degraded") or _scan_was_partial(scan):
            return _honest_suspicious_summary(scan)
        return final_answer

test_zero_findings_is_a_noop_model_prose_stands and test_check_suspicious_mail_alone_zero_findings_stays_a_clean_negative both pin the current no-op, but neither exercises a degraded envelope — the case that matters here.

…ncomplete

A zero-finding scan skipped the grounded lead entirely, so a revoked Outlook
grant plus a clean Gmail returned the model's bare "Nothing flagged this scan"
with no sign that part of the account was never read. That is the false
all-clear this rewrite exists to prevent, in the one shape where the user has
no list to notice is missing.

Nothing downstream covered it: find_unqualified_negative_claim keys on a
pre_scan_inbox payload a scoped turn never produces, and has no notion of
degraded at all.

Zero findings stays a no-op on a clean, complete scan — the caveat is only
owed when degraded is set or scanned is under total_inbox. Replacement is
unconditional in that case, for the same reason as the flagged-rows branch:
deciding whether the model's own prose already disclosed the gap means
pattern-matching every phrasing of a false all-clear, which this module
already rejected once.
@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Right, and this was the more dangerous half — fixed in fd8c0f5e.

A zero-finding scan skipped the grounded lead entirely, so a revoked Outlook grant plus a clean Gmail returned a bare "Nothing flagged this scan" with no sign that part of the account was never read. A clean, complete scan still passes through untouched; the caveat is only owed when a mailbox failed or the inbox pass was partial.

🔍 Technical details

answer_grounding.py — rewrite_suspicious_mail_answer's if not rendered: return final_answer now first consults a new _suspicious_scan_has_coverage_gap(scan) (degraded, or scanned < total_inbox with both ints) and falls through to _honest_suspicious_summary when the scan owes a caveat.

Confirmed your point that nothing downstream covers it: find_unqualified_negative_claim (:165) opens with last_tool_payload(conversation, "pre_scan_inbox") and returns None when absent — a check_suspicious_mail-only turn never produces that payload — and it keys its coverage check on total_unread, with no notion of degraded at all.

On unconditional replacement rather than "only when the answer lacks a qualifier": the narrower option was considered and rejected. With no list to protect, detecting whether the model's own prose already disclosed the gap means pattern-matching every phrasing of a false all-clear — the exact fragility this module rejected for the flagged-rows branch — and the cost of replacing an already-honest one-sentence answer is close to nil.

Mutation-proven. 4 new tests in TestRewriteSuspiciousMailAnswerZeroFindingsCoverageGap; with the fix reverted, the 2 asserting the new behaviour fail and the 2 pinning the no-op paths (clean complete scan, pre_scan_inbox also ran) correctly pass either way — they guard against over-firing, so passing both ways is the right result for them, not evidence.

Email-agent suite 1930 passed / 4 skipped; util/lint.py --all exit 0.

@itomek

itomek commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Note on Unit Tests (py3.10): it failed on the Run Lemonade release-asset resolution test step — the same check that failed on py3.11 earlier in this PR, and the defect tracked as #2927 (its network guard handles "no network" but not "network present, remote hiccuped", so an upstream blip reddens unrelated PRs). Second occurrence here with the same signature, so it is not being re-run; it carries no information about this change.

@itomek
itomek disabled auto-merge August 12, 2026 19:19
@itomek
itomek added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 88ecc18 Aug 12, 2026
43 of 45 checks passed
@itomek
itomek deleted the tmi/issue-2900-scoped-answer branch August 12, 2026 19:26
@itomek itomek mentioned this pull request Aug 12, 2026
7 of 8 tasks
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Aug 13, 2026
# GAIA v0.23.0 Release Notes

GAIA v0.23.0 makes the agents easier to get, safer to run, and easier to
extend. You can now browse, install, and run agents straight from the
terminal with `gaia hub`, and add new capabilities to an agent as
signed, auditable skills. Under the surface it's a security release: the
local API and MCP bridge no longer expose themselves to the network by
default, the confirmation prompt that pauses an agent before it sends
mail, writes a file, or runs a command now works from the terminal and
over the local API and MCP — not just inside the graphical app — and an
agent can no longer quietly reach into your `~/.gaia` config or slip
crafted SQL into the database agent. Connecting a Microsoft account is
now an explicit Personal-or-Work/School choice with a zero-setup
sign-in.

**Why upgrade:**
- **Get agents from the terminal** — `gaia hub` browses, installs
(behind a trust prompt for unverified agents), runs, and removes agents
without leaving the shell.
- **Every agent asks before it acts** — the confirmation gate for
sending mail, writing files, and running commands now works in the
terminal, over the local API, and across MCP tools, not only in the
Agent UI.
- **Safer by default** — the MCP bridge binds to localhost, the local
API refuses credentialed cross-origin requests from arbitrary sites, MCP
servers launch without a shell, and an agent can't write into `~/.gaia`
or reach the database with crafted SQL.
- **Build and share skills safely** — `gaia skill` makes skills
first-class: create, import, sign with trust tiers, and audit them
before sharing. They're opt-in — you add the ones you want.
- **Connect a Microsoft account without a secret** — Personal and
Work/School are now separate connectors with device-code sign-in and no
client secret required.

<Note>
**The email agent is beta and CLI-first this release.** It runs locally
and never sends,
forwards, or deletes without your confirmation — that safety gate is
verified. This cycle
was mostly robustness and correctness: sturdier Outlook and calendar
handling, honest
reporting when a scan is truncated, and a long list of fixes (see Bug
Fixes). It's still
early — a full inbox triage can currently time out on larger mailboxes,
and autonomy is
experimental and not yet wired up in the packaged sidecar. Treat its
output as a draft to
review, and please report what you run into.
</Note>


## Breaking Changes

### `GAIA_MICROSOFT_TENANT` is gone

The Microsoft connector was split into two explicit connectors —
Personal and Work/School — each with its own hard-coded tenant, so the
`GAIA_MICROSOFT_TENANT` environment variable no longer does anything and
has been removed (PR [amd#2729](amd#2729)). If
you set it to work around the old single-connector tenant guessing, drop
it and pick the connector that matches your account instead (see
*Microsoft accounts* below).


## What's New

### Install and run agents from the terminal — `gaia hub`

Getting an agent used to mean the graphical app or a manual pip install.
Now the hub is in your shell: `gaia hub list` shows the catalog, `gaia
hub install <agent> --trust` installs one (the `--trust` is required for
an unverified agent — it will not install silently), and `gaia hub
uninstall <agent>` removes it. The install → run → uninstall round-trip
works end to end against the live catalog, with the trust prompt
actually enforced (PRs [amd#2484](amd#2484),
[amd#2530](amd#2530),
[amd#2708](amd#2708)). Try it: `gaia hub
list`.


### Every agent asks before it acts — beyond the Agent UI

The confirmation prompt that pauses an agent before a consequential
action — sending or deleting mail, writing a file, running a shell
command — used to work only inside the Agent UI; from a terminal, the
local API, or an MCP tool call those actions could run unprompted. This
release closes those paths: the gate now fires from a plain terminal,
through the `gaia api` server, and across MCP tool calls, classifying a
tool as read-only or mutating and failing closed when unsure. The agent
stops and asks before the action, declining leaves nothing changed, and
setting `GAIA_AUTO_APPROVE_TOOLS=1` in your environment is the explicit
way to opt out (PRs [amd#2475](amd#2475),
[amd#2544](amd#2544),
[amd#2846](amd#2846),
[amd#2854](amd#2854)).


### Safer by default — a security-focused release

Several local exposures are closed this release. The MCP bridge binds to
`127.0.0.1` by default instead of every interface, so it isn't reachable
from other machines on your network unless you pass a bind-all host, and
it can now require an `--auth-token` that is actually enforced rather
than ignored. The local API server no longer echoes an arbitrary origin
back with credentials allowed — a cross-origin request from a site that
isn't allow-listed is refused. MCP servers are launched without going
through a shell, so a server name can't smuggle shell metacharacters; an
agent can no longer write into your `~/.gaia` configuration; and SQL
supplied by the model is blocked from reaching the database agent's
statements rather than being executed (PRs
[amd#2246](amd#2246),
[amd#2238](amd#2238),
[amd#2344](amd#2344),
[amd#2844](amd#2844),
[amd#2847](amd#2847),
[amd#2860](amd#2860)).


### Build and share skills — `gaia skill`

A skill gives an agent a new capability from a folder with a manifest —
no new Python, no forking the agent. `gaia skill create <name>`
scaffolds one, `gaia skill import` adds a skill so an agent can discover
it, and `gaia skill list` / `info` show what's installed and the
permissions each one declares. Sharing is guarded: skills carry
signatures with trust tiers — an unsigned or untrusted skill is capped
at the lowest tier, and tampering is caught by checksum — a pre-publish
audit rejects a skill that attempts prompt injection or
`shell=True`/`eval`, and `gaia skill migrate` converts skills authored
in other formats. Skills are opt-in: no agent loads them automatically
yet, so you add the ones you want (PRs
[amd#2669](amd#2669),
[amd#2692](amd#2692),
[amd#2702](amd#2702),
[amd#2693](amd#2693)). Try it: `gaia skill
list`.


### Microsoft accounts: Personal and Work/School, no secret required

Connecting a Microsoft account is now two clear choices instead of one
connector guessing your tenant. `gaia connectors list` shows Microsoft
as two distinct connectors — Personal and Work/School — each with a
zero-setup device-code sign-in (a code and a URL to visit) and no client
secret required for a public app registration (PRs
[amd#2718](amd#2718),
[amd#2364](amd#2364)).


### Lemonade Server 11.5.0

This release runs against Lemonade Server 11.5.0 — the version installed
by `gaia init` and pinned across CI and the installer.


## Bug Fixes

A selection of the user-visible fixes this release — the full list is in
the changelog below.

- **Triage now paginates large inboxes and reports truncation honestly**
(PR [amd#2646](amd#2646)) — no more silently
dropping mail past a hidden limit.
- **Thread messages come back sorted and numbered** (PR
[amd#2570](amd#2570)) — "reply to 3" hits the
message shown at position 3, not raw backend order.
- **The inbox pre-scan stops reporting a guess as a verdict** (PR
[amd#2587](amd#2587)) — an uncertain
classification is surfaced as uncertain.
- **An email conversation survives its turns** (PR
[amd#2837](amd#2837)) — a follow-up question
keeps the session context instead of starting over.
- **A bare reconnect no longer guts a mailbox** (PR
[amd#2733](amd#2733)) — reconnecting an
account keeps its existing grants instead of wiping them.
- **Restore from Trash anytime** (PR
[amd#2542](amd#2542)) — undo an archive/trash
without a narrow time window; the dead permanent-delete path was
removed.
- **A low-priority sender no longer forces a promotional label** (PR
[amd#2774](amd#2774)) — sender priority stops
overriding the actual content classification.
- **The agent survives an OpenMP double-init** (PR
[amd#2508](amd#2508)) — a mid-conversation
native-library clash no longer kills the run.
- **Large tool results are truncated to valid JSON** (PR
[amd#2645](amd#2645)) — an oversized result no
longer produces unparseable output.
- **A missing model surfaces as a real 404** (PR
[amd#2245](amd#2245)) — the builder names the
missing model instead of a generic placeholder.
- **GPU is detected on all platforms and default_device is honoured**
(PR [amd#2244](amd#2244)).
- **A sidecar that is alive but has stopped serving is now detected**
(PR [amd#2707](amd#2707)) — a wedged agent
process is caught instead of hanging.
- **The model-slot lease is held across inference, not just the load**
(PR [amd#2394](amd#2394)) — a second agent
can't evict the model mid-generation.
- **A browser that never launched is surfaced** (PR
[amd#2507](amd#2507)) — a failed OAuth browser
open reports an actionable error instead of hanging.
- **Stop actually aborts in-flight streaming** (PR
[amd#2166](amd#2166)) — the Agent UI Stop
button ends generation immediately.


## Full Changelog

**331 commits** since v0.22.0:

<details>
<summary>Expand full changelog (331 commits)</summary>

- `96ce0d1e` — feat(email): recognize the third mailbox connector —
Gmail, Outlook personal, Microsoft work (amd#2896)
- `88ecc18e` — fix(email): scoped 'anything suspicious?' query no longer
dumps the full triage report (amd#2910)
- `1c75ccee` — fix(skills): reject version pins GAIA cannot read instead
of matching them (amd#2928)
- `29a5c364` — docs(plans): assess readiness for the generic gaia-agent
(amd#2926)
- `e3b28653` — fix(tui): stop cancel-then-resend from racing the
daemon's session lock (amd#2912)
- `b38f5e60` — fix(tui): anchor TTFT on first inference token, use real
token counts (amd#2911)
- `779d7b00` — fix(email): reply/draft/send actions no longer report
failure after they already succeeded (amd#2908)
- `f8d4610c` — ci(eval): queue eval runs instead of cancelling the
pending one (amd#2921)
- `611b1928` — feat(hub,skills): pre-publish security audit gate for
marketplace skills (amd#2702)
- `c83047b9` — feat(skills): gaia skill migrate — OpenClaw/Hermes skills
to GAIA format (amd#2693)
- `ca17067a` — test(skills,hub): cover the signing and lane checks
amd#2668/amd#2692 shipped untested (amd#2907)
- `a951567a` — fix(eval): drop the judge temperature pin the model now
rejects (amd#2905)
- `236f8a58` — feat(skills): gaia skill publish/install with
signature-backed security tiers (amd#2692)
- `d26b15da` — ci(eval): trigger the Gemma eval on the PR diff, not the
push (amd#2897)
- `be15258a` — fix(cpp): normalize CRLF so Windows-authored skills parse
identically (amd#2906)
- `84415b06` — feat(cpp): text extraction and chunking (amd#2822)
- `6352f264` — fix(database): make the SQL read-only authorizer disarm
on Python 3.10 (amd#2904)
- `4709a728` — feat(hub,skills): publish and serve skills as a
first-class hub catalog lane (amd#2668)
- `245cb72e` — fix(api): refuse approval-gated tools instead of
auto-approving them (amd#2854)
- `e803103a` — fix(mcp): enforce --auth-token on the MCP bridge instead
of ignoring it (amd#2844)
- `a6dc1fa3` — fix(ci): run the Gemma-4-E4B agent eval in PowerShell on
its Windows pool (amd#2773)
- `75b61f4f` — feat(cpp): SKILL.md format parser and validation (amd#2824)
- `b89c6414` — feat(cpp): gaia::HttpClient — a general HTTP client
abstraction (amd#2809)
- `5e6b1d43` — fix(security): launch MCP servers without a shell,
protect ~/.gaia from agent writes (amd#2847)
- `768be2e2` — feat(skills): ship a ten-skill starter pack with a guide
and honesty guards (amd#2697)
- `340bf2c2` — feat(cpp): interactive TUI — event loop, streaming
render, modals (amd#2825)
- `acaad161` — feat(cpp): native OpenAI tool calling and conversational
response mode (amd#2821)
- `23ae5d63` — feat(cpp): SQLite integration and gaia::Database (amd#2816)
- `4f2a6686` — feat(cpp): gaia::VectorIndex — flat vector index with
persistence (amd#2807)
- `b1a7e8df` — fix(email): ship with Agent Skills off until the eval
gate covers them (amd#2848)
- `34c26577` — ci(webui): run the Agent UI Vitest job on Node 22 so the
suite executes (amd#2898)
- `20036474` — docs: escape MDX-breaking literals so Mintlify validation
passes (amd#2903)
- `07b0858e` — ci(tui): run on stacked PRs, add -race, lint, and a
per-OS test matrix (amd#2696)
- `e19d46be` — feat(cpp): harden the coding toolbelt — stale-write
rejection, ignore-aware search, persistent shell (amd#2823)
- `7621b223` — ci(claude): move every Claude workflow to Opus 5 and run
the audits nightly (amd#2859)
- `d086faa4` — fix(claude): correct the agent/skill prompts and make
plain language the default (amd#2862)
- `990d19ff` — fix(cpp): gate MCP tools behind user confirmation in the
C++ SDK (amd#2851)
- `878d473f` — fix(mcp): gate MCP write tools behind the user
confirmation prompt (amd#2846)
- `c2c68064` — fix(security): stop LLM-supplied SQL reaching
DatabaseAgent statements (CWE-89) (amd#2860)
- `e936d3d9` — docs(release): rebuild v0.23.0 notes to hardware-verified
features only
- `be03c7c8` — fix(init): stop reporting success gaia init did not
deliver (amd#2889)
- `75804a15` — docs(dev): require --extra-index-url for every uv pip
install on Linux (amd#2878)
- `4a24d663` — ci(email): run the triage eval on PRs that touch the
email agent (amd#2849)
- `c3d9ec11` — fix(code): route orchestrated tool calls through the
confirmation gate (amd#2853)
- `c59e5d8a` — fix(hub): stop the terminal hub publishing against a core
that cannot serve it (amd#2712)
- `04f18294` — chore(deps-dev): bump the agent-ui-dependencies group in
/src/gaia/apps/webui with 6 updates (amd#2750)
- `ce4fcbf3` — fix(web): bracket pinned IPv6 addresses in URLs (amd#2739)
- `e7e93287` — fix(installer): install the terminal hub on macOS and
Windows (amd#2708)
- `3cda9f77` — feat(cpp): MCP server registry — resolve server ids from
mcp.json (amd#2820)
- `c09764da` — fix(ci): validate the STX CMake cache instead of trusting
bin/cmake.exe (amd#2818)
- `616014d7` — docs(plans): scope C++ framework parity for
domain-specific agents (amd#2806)
- `f6433039` — ci(security): audit allowlist soundness + add PSIRT/CVSS
triage skill (amd#2752)
- `5c9f2b60` — chore(deps): bump the github-actions group with 2 updates
(amd#2751)
- `c103f6cd` — feat(discovery): real macOS and Linux branches for
day-zero scanners (amd#1956) (amd#2747)
- `e7e362e1` — chore(deps-dev): update mcp requirement from
\<2.0,>=1.1.0 to >=1.1.0,\<3.0 in the python-dependencies group (amd#2749)
- `ca9e5461` — chore(deps): bump the root-npm-dependencies group with 2
updates (amd#2748)
- `f62ca240` — fix(website): unbreak the Railway deploy, red since July
31 (amd#2855)
- `88d130ec` — feat(email): render the triage list from the scan, not
from the model (amd#2858)
- `bf9eb183` — ci(windows): pin ffmpeg version to drop the gyan.dev
dependency (amd#2852)
- `c531ca69` — fix(email): a conversation now survives its turns —
session_id on /query (amd#2837)
- `bcde95ee` — fix(email-agent): stop meeting/invite answers from
inventing what tools never said (amd#2833)
- `162274a5` — fix(tui): 'triage my inbox' draws its card under the
question again (amd#2845)
- `bbf69fd6` — feat(email,skills): bundled skills + account-keyed
skill-set selection (amd#2695)
- `abed9f1c` — fix(security): close find -exec / write side-doors in
shell command whitelist (CWE-184) (amd#2740)
- `0d1258a1` — fix(email-agent): get_thread renders a table card instead
of relying on model prose (amd#2788)
- `300163dd` — fix(email-agent): search_messages defaults to
metadata-only, fixing context overflow on counting questions (amd#2782)
- `cc331b78` — fix(email): low-priority-sender match no longer forces
PROMOTIONAL (amd#2774)
- `68736511` — fix(email): meeting proposal in a confidently-classified
message no longer vanishes from needs_you (amd#2779)
- `e135b8ef` — fix(ci): post PR reviews from the workflow instead of
hoping the model does (amd#2719)
- `efd3812b` — feat(email/tui): resolve "reply to 1" to the message the
card actually shows (amd#2761)
- `ed70db73` — fix(email-agent): search_messages states an exact, stable
message count (amd#2760)
- `42fdfdcd` — fix(email/tui): one triage card that tells you what to
do, not what was classified (amd#2757)
- `3803aa06` — fix(email): stop leaking classifier internals into triage
card rationale (amd#2754)
- `2c11ac0b` — fix(tui): sanitize agent error text (amd#2753)
- `9bf0042a` — docs(tui): rewrite the terminal hub README for newcomers
(amd#2717)
- `1cdd9746` — docs(skills): implementation spec for Agent Skills v2
adaptive skills (amd#2685)
- `50a5b862` — fix(website): pin the deploy toolchain so CI and
production build alike (amd#2691)
- `500cdac6` — fix(mcp): cap the mcp dependency below 2.0 (amd#2694)
- `3686e069` — docs(guides): document the terminal hub, and how to
actually get it (amd#2698)
- `99508ec5` — docs(plans): preserve the TUI packaging design and
binary-distribution plan (amd#2699)
- `21c02f69` — fix(hub): mark the email agent verified so first install
is not refused (amd#2703)
- `8d07ee3d` — docs(website): correct every deployment instruction in
the README (amd#2689)
- `dff8f1b2` — refactor(memory): rename synthesis Skill dataclass to
DistilledProcedure (amd#2684)
- `d2832fd5` — # feat(email): opt-in on-device SLM classifiers for
phishing and triage category (amd#2568)
- `a02f2f0c` — fix(connectors,email): a bare reconnect no longer guts a
mailbox (amd#2733)
- `bc0d4632` — fix(website): reach the hero terminal, marquee, and code
blocks by keyboard (amd#2706)
- `82635362` — fix(website-router): track apex Worker, fail loudly on
origin errors (amd#2688)
- `5d269094` — feat(skills): SKILL.md loader, validator, discovery +
gaia skill CLI core (amd#2669)
- `0ae019c8` — fix(daemon): detect a sidecar that is alive but has
stopped serving (amd#2707)
- `4551ec5b` — fix(website): stop offering Intel Macs a DMG they cannot
run (amd#2701)
- `bc8a7e29` — docs(spec): Gatekeeper blocks the browser download, not
curl | sh (amd#2732)
- `0d170869` — fix(website): make the hub agent rows readable in both
themes (amd#2711)
- `d5ae430d` — fix(tui): a consequential readiness check now holds the
screen (amd#2731)
- `d6bd047f` — fix(email): stop Gmail 429-ing every scan — chunk at 25
and retry the rate limit (amd#2727)
- `93216bc0` — chore(connectors): remove GAIA_MICROSOFT_TENANT — dead
since the connector split (amd#2729)
- `e3a6958a` — fix(tui): show a failed tool's own error instead of an
"Invalid card" box (amd#2726)
- `6efc520b` — fix(email-agent): surface connector errors from autonomy
runs instead of a bare HTTP 500 (amd#2640)
- `f0543406` — feat(connectors): split Microsoft into Personal +
Work/School connectors (amd#2718)
- `b8a97cbb` — fix(connectors): stop requiring a client secret from
secretless public PKCE clients (amd#2630)
- `70e4eb12` — fix(website): stop a published agent rendering twice on
the hub page (amd#2690)
- `282e30e0` — fix(tui): name the binary the user actually invoked, and
fix the setup hint (amd#2700)
- `d95866ff` — fix(installer): repair the Lemonade download URLs and add
macOS support (amd#2704)
- `3bc0b612` — fix(hub): stop components publishing against a core that
cannot serve them (amd#2705)
- `c068166d` — Email Triage draft/proposal SDK (amd#2551)
- `cb90bab3` — fix(email): priority senders never force urgent;
informational tail auditable (amd#2658)
- `ab41b115` — fix(email): stop the assistant from narrating what the
turn's tools don't support (amd#2659)
- `7a93bfbe` — fix(email-agent): propagate the autonomy kill switch to
the scheduler (amd#2657)
- `4de65cff` — fix(email-agent): require the conflict tool for conflict
verdicts (amd#2656)
- `84404a6e` — perf(email): metadata-first scan + read-mail pre-scan
coverage (amd#2661)
- `733822e2` — fix(tui): restore the attention card on direct chat
--agent launches (amd#2655)
- `d4d5a7cc` — fix(mcp): cap the mcp dependency below 2.0
- `1d867eed` — fix(email): strip infrastructure banners from bodies
before the prompt (amd#2650)
- `22d8b2d4` — fix(email-agent): kill a running autonomy cycle and keep
partial reports (amd#2652)
- `a4f4b39b` — fix(email): paginate the triage scan and report
truncation honestly (amd#2646)
- `7adc4882` — fix(tui): dedup attention rows and stop the card
interrupting turns (amd#2648)
- `24e8d5ab` — fix(email): thread summaries keep the newest message's
open asks (amd#2644)
- `c3ef3796` — fix(agents): truncate large tool results to valid JSON
(amd#2645)
- `d633b387` — docs(connectors): document which Google scopes to declare
in the Console (amd#2612)
- `4ad367a9` — fix(connectors): derive --grant-agent scopes from the
agent's own declaration (amd#2610)
- `f7d5d7d9` — chore(deps): bump the root-npm-dependencies group across
1 directory with 3 updates (amd#2503)
- `c84d9a79` — fix(tui): make the terminal hub readable on a light
terminal background (amd#2611)
- `bcffbc8d` — feat(email): recover the attention view and
waiting-on-you detector onto main (amd#2604)
- `b63a9f0d` — feat(email): guided Outlook mailbox setup — walk, verify,
and answer questions in chat (amd#2598)
- `e0d5014c` — fix(daemon): dev-mode start-agent refuses a checkout
mismatch instead of silently serving a stale build (amd#2592)
- `29dc0f9f` — feat(email): find meeting proposals during the inbox scan
(amd#2589)
- `22b0fa04` — fix(email): pre-scan stops reporting a guess as a verdict
(amd#2587)
- `c211e870` — fix(daemon): start the daemon clock so scheduled work can
fire (amd#2586)
- `358fd6e1` — fix(email-agent): add preference removal tools and a
truthful read-back (amd#2520) (amd#2541)
- `d01b9d43` — fix(email): don't cancel a retrying agent for a
recoverable tool error (amd#2572)
- `7fdcd6b2` — fix(email): surface degraded memory state and diagnose
the real cause (amd#2577)
- `1c42d842` — fix(email): autonomy /run refuses while off; add gaia
email autonomy CLI (amd#2578)
- `25b6cacd` — fix(email): draft_reply/draft_forward compose the body,
don't ask for it (amd#2576)
- `a050c64d` — fix(email): briefing carries a structured breakdown, not
one sentence (amd#2575)
- `8da002f0` — fix(email): resolve relative snooze/schedule times
agent-side (amd#2574)
- `ee4af04b` — fix(email): get_thread returns messages sorted and
numbered, not raw backend order (amd#2570)
- `9269a306` — fix(email): give list_inbox/search_messages a combined
envelope budget (amd#2546)
- `c4495a0f` — fix(agents): dispatch Python-call-style embedded tool
syntax (amd#2573)
- `f6103a03` — feat(email-agent): broaden autonomy candidates, add undo
surface and per-message decisions (amd#2545)
- `d975853c` — fix(email): normalize calendar time bounds to RFC 3339
before Google (amd#2579)
- `fdf665f0` — feat(website): redesign landing, Agent Hub, and agent
detail pages (amd#2566)
- `000ab88e` — fix(ui): reject null bytes in upload-path; unrot 8 stale
UI/journey tests (amd#2565)
- `0d6ca966` — feat(tui): tool-confirmation modal for
destructive/external actions (amd#2544)
- `4131420a` — fix(agent): recover from context overflow on
NPU/FastFlowLM (amd#2543)
- `35062526` — fix(email): restore from Trash anytime, drop dead
permanent_delete (amd#2542)
- `2a1767e0` — chore(release): bump the hub component manifests to
0.23.0
- `b5d5bf54` — feat(hub): publish the terminal hub and Agent UI as R2
hub packages (amd#2530)
- `014cbcbc` — fix(email): catch the contract guards up to schema 2.6,
and de-race the heartbeat test (amd#2549)
- `9f70be13` — fix(ui): serve the Lemonade start hint instead of
hardcoding a dead command (amd#2510)
- `26127e80` — feat(release): publish the terminal hub binary and
install it (amd#2522)
- `59374508` — fix(tui): unbreak build_tui on main — allowlist the
bare-host remedy (amd#2548)
- `1b189215` — fix(daemon): unbreak Unit Tests on main — remedy
docstring names an unparseable command (amd#2534)
- `9bdd7eb3` — docs(release): name the Lemonade version v0.23.0 actually
ships (amd#2509)
- `21d40c33` — fix(llm): detect Lemonade on macOS; stop printing
commands that don't work (amd#2497)
- `e272fbae` — fix(tui): keep a valid hub selection when switching tabs
(amd#2482)
- `1d0454b6` — fix(tui): prove the mailbox is usable before the gate
clears a launch (amd#2494)
- `ee54b779` — feat(email): agent-led mailbox onboarding — the agent
sets up its own access (amd#2496)
- `cc73e244` — fix(tui): stop the hub offering agents it cannot run or
launch (amd#2492)
- `5b378ebe` — fix(tests): make unit suite hermetic by blocking real
network connections (amd#2500)
- `238fe9ac` — feat(tui): install, run and uninstall agents from the TUI
(amd#2484)
- `ce730876` — feat(tui): draw tool_result render cards, starting with
the inbox pre-scan (amd#2485)
- `7fdd43ea` — chore(deps-dev): bump electron from 43.1.1 to 43.2.0 in
/src/gaia/apps/jira/webui in the jira-app-dependencies group (amd#2501)
- `c940fd0a` — chore(deps-dev): bump electron from 43.1.1 to 43.2.0 in
/src/gaia/apps/example/webui in the example-app-dependencies group
(amd#2502)
- `7f569605` — feat(daemon): install, uninstall and catalog hub agents
from the daemon (amd#2477)
- `61ac101c` — docs(plans): design the TUI user journey around the email
agent (amd#2480)
- `fd66ba95` — fix(email): fail loudly on a dead worker and reconcile
the package docs (amd#2479)
- `1340b3b7` — fix(agents): actually ask before running
confirmation-gated tools (amd#2475)
- `5f283e10` — feat(tui): control API + MCP server for driving the live
TUI (amd#2478)
- `12016d5d` — feat(tui): stream agents over the daemon HTTP/SSE relay
(amd#2476)
- `554ef27c` — chore(deps): bump electron from 43.1.1 to 43.2.0 in
/hub/agents/emr/python/gaia_agent_emr/dashboard/electron in the
emr-dashboard-dependencies group (amd#2504)
- `4822e2ed` — chore(deps-dev): bump the agent-ui-dependencies group in
/src/gaia/apps/webui with 6 updates (amd#2505)
- `3fc0d2e1` — chore(deps): bump the github-actions group with 4 updates
(amd#2506)
- `47c2d1b2` — fix(connectors): surface a browser that never launched
(amd#2507)
- `1763606f` — fix(agents): stop the OpenMP double-init from killing the
agent mid-conversation (amd#2508)
- `56215070` — fix(hub): carry requirements.min_lemonade_version through
the manifest parser (amd#2493)
- `02cf9984` — fix(mcp): keep console logs off stdout in stdio
transports (amd#2473)
- `d6c02c2f` — chore(deps): bump Lemonade Server to v11.5.0 (amd#2424)
- `2898f1b5` — fix(agents): don't dedup errored mutation retries (amd#2464
batch dead-end) (amd#2465)
- `867bc677` — fix(email): recall last archive batch so undo reaches
across turns (amd#2458)
- `9073ec20` — fix(email): strip LLM quoting from ARCHIVE_MESSAGE_BATCH
ids (amd#2457)
- `529d11b1` — ci(review): allow fork-PR checkout under
pull_request_target (checkout@v7) (amd#2461)
- `524d3282` — fix(email-agent): make undo window configurable for
chat-speed bulk ops (amd#2449)
- `61dc3a1f` — fix(email-agent): surface actionable Lemonade-down copy
in gaia email -q (amd#2453)
- `d78115a9` — fix(memory): guard against self-supersede hiding recalled
preferences (amd#2452)
- `6bf96e56` — fix(email-agent): isolate per-provider failures in read
fan-out (amd#2451)
- `acd20400` — fix(agents): reject unexpected tool kwargs with a
structured error (amd#2450)
- `f99ccaea` — fix(daemon): drop --reload from dev-mode email sidecar
spawn (macOS) (amd#2442)
- `c2337178` — fix(email-agent): verify archive left inbox + fix
same-day search miss (amd#2438)
- `3f6af0ff` — fix(email): don't misclassify timeouts as Lemonade-down
(amd#2139 follow-up) (amd#2454)
- `9386e1b1` — fix(email-agent): resolve draft/reply target from sender
or topic (amd#2403) (amd#2437)
- `229e61da` — fix(email-agent): never auto-archive IMPORTANT /
security-sender mail (amd#2426) (amd#2435)
- `e6ac57f9` — fix(email-agent): persist preferences to state.db so they
survive without the embedder (amd#2427) (amd#2434)
- `4301c897` — fix(agent-email): actionable copy for Lemonade-down
/query errors (amd#2432)
- `1bb2cccd` — fix(daemon/email-agent): dev-mode sidecar 'Empty module
name' on macOS (bad PYTHON_KEYRING_BACKEND) (amd#2443)
- `7a44bfd5` — fix(email): bulk-archive undo survives the whole run via
a per-turn batch handle (amd#2439)
- `5101b853` — fix(daemon): re-forward OAuth tokens on expiry so
sidecars self-recover (amd#2436)
- `55010368` — fix(email-agent): applying an existing label fails with
'Invalid label' (T14) (amd#2433)
- `ce83feb9` — fix(email-agent/ui): de-jargon the send confirmation
surface (amd#2407)
- `4bb196fb` — fix(connectors): name consumers-tenant migration on
personal-account app rejection (amd#2391)
- `6b29a4d6` — fix(email-agent): construct with zero connectors instead
of 502 (amd#2423)
- `f3af7bff` — fix(agent-ui): treat ctx_size=0 as unknown, not a
too-small window (amd#2402)
- `f22b0f4a` — fix(ci): run evidence stage via direct claude CLI, not
the GitHub-coupled action (amd#2430)
- `60334202` — fix(email-agent): add live mailbox connection-status tool
(amd#2405)
- `4c370b23` — fix(ui): surface actionable sidecar HTTP errors instead
of generic crash card (amd#2422)
- `7fc559af` — test(ci): evidence lane exercises UI-backed routes +
spot-regresses adjacent ops (amd#2421)
- `9be31036` — security(ci): harden the evidence stage against env dumps
/ credential flows (amd#2417)
- `0f709733` — fix(daemon): validate custody rag/query 'k' to a bounded
positive int (amd#2390)
- `ca50bf8a` — ci(review): broaden evidence gate + require a
verdict-linked evidence section (amd#2415)
- `59c736df` — ci(review): fold gaia-testing evidence into the PR review
comment (Phase 1: CLI/API/MCP) (amd#2414)
- `1a233d94` — test(connectors): fix main red — amd#2408 install test vs
amd#2410 trust gate (amd#2412)
- `78de5bfd` — fix(electron): resume periodic update checks after a
no-feed start (amd#2389)
- `a20c04b4` — fix(agent-ui): left-align installed-agent hub cards on
home screen (amd#2398)
- `236ba233` — fix(connectors): register hub-installed sidecar agents so
email grant works on fresh install (amd#2411)
- `b343f396` — fix(security): harden install trust gate and
analyze_data_file sandbox (amd#2410)
- `765cb544` — fix(daemon): hold the model-slot lease across inference,
not just the load (amd#2394)
- `27be002e` — fix(onboarding): neutral NPU wording in first-run
Hardware check (amd#2399)
- `c86a46e5` — docs(release): note email is Linux + API/CLI only this
release (Windows amd#1648)
- `e658cb15` — docs(testing): bind real-world evidence contract to the
changed surface (amd#2376)
- `feb00155` — docs(email): correct earn-trust claim — positive-outcome
accrual not yet wired (amd#2392)
- `7aee219a` — fix(email): commit autonomy dedup INSERT so it survives
headless teardown (amd#2393)
- `6b6a8dab` — fix(daemon): map NotGrantedError to 403 in forward_all
route (amd#2395)
- `5b2e6be8` — docs(release): keep only verified user-facing features in
What's New
- `e11740e7` — docs(release): fix Agent UI heading — drop 'update'
(auto-update was trimmed)
- `a011e33d` — docs(release): trim v0.23.0 notes to features verified
working
- `ce5ddd84` — docs(release): correct v0.23.0 notes to match verified
behavior
- `c62a3e27` — Release v0.23.0
- `5f624706` — fix(hub): importable CLI wheel agents + chat distribution
via gaia init (amd#2373)
- `3ad39e60` — fix(sidecar): actionable user-mode binary error (amd#2347)
(amd#2357)
- `bfc0f5b8` — fix(lemonade): recognize grouped amd_gpu/nvidia_gpu
device keys in validation (amd#2368)
- `0553c8b0` — feat(email): full autonomy — earn-trust engine, learning
loop, scheduled driver (amd#2363)
- `0284300b` — feat(connectors): support work/school Outlook +
zero-setup device-code sign-in (amd#2364)
- `1aaba5cc` — feat(lint): require security suppressions to be reviewed
in an allowlist (amd#2343)
- `19b1a4c5` — test(daemon): de-flake sidecar stop test on the
pid-liveness check (amd#2349)
- `174e9d0c` — refactor(chat): extract ProfileSpec, honest manifest,
lazy RAG — one class → separable profiles (amd#2323) (amd#2362)
- `57f970b0` — chore(audit): drop the security dimension from the weekly
audit (amd#2348)
- `23181040` — feat(security): proactive Claude security-audit workflow
+ CVSS/SARIF tooling (amd#2346)
- `d605caec` — fix(security): enforce --allowed-paths sandbox on file
read tools (amd#2344)
- `1c8a91c9` — fix(security): remove pre-existing bandit HIGH findings
and enable the HIGH gate (amd#2350)
- `4b5c16b7` — ci(labeler): add tui/daemon/sidecar auto-label rules
(amd#2356)
- `a905b057` — chore(deps): bump the github-actions group with 2 updates
(amd#2341)
- `b3f793af` — fix(routing): default unknown language to TypeScript, not
a process kill (amd#2337)
- `48286dbd` — fix(init): stop Rich eating bracketed tokens in gaia init
output (amd#2340)
- `638a7643` — docs(skills): add porting-agent-to-hub — the legacy-agent
port flow (amd#2338)
- `d2c00b55` — fix(hub): harden agent-archive extraction against path
traversal (amd#2342)
- `a4417656` — fix(ci): repair the startup-failing GAIA CLI aggregate
workflow (amd#2307)
- `0835a250` — fix(ci): make the weekly eval and runner heartbeat
monitor actually run (amd#2306)
- `977c158f` — fix(cli): add --layout hub to gaia agent init for the
agent-first hub tree (amd#2295)
- `558a73e6` — chore(deps): bump the github-actions group with 3 updates
(amd#2294)
- `f8bff000` — chore(deps-dev): bump electron from 43.1.0 to 43.1.1 in
the root-npm-dependencies group (amd#2292)
- `fb179e32` — ci(eval): gate the Gemma-4-E4B consolidation on agent
evals (amd#2283)
- `6b2aa2db` — chore(deps-dev): bump electron from 43.1.0 to 43.1.1 in
/src/gaia/apps/jira/webui in the jira-app-dependencies group (amd#2291)
- `5837bdac` — chore(deps-dev): bump electron from 43.1.0 to 43.1.1 in
/src/gaia/apps/example/webui in the example-app-dependencies group
(amd#2290)
- `3ce4f790` — test(agents): stub live Lemonade probe in
context-overflow tests (amd#2288)
- `1886a92f` — chore(deps): bump electron from 43.1.0 to 43.1.1 in
/hub/agents/emr/python/gaia_agent_emr/dashboard/electron in the
emr-dashboard-dependencies group (amd#2289)
- `0a308449` — feat(agents): consolidate every agent onto Gemma-4-E4B at
one context size (amd#2284)
- `4392e06a` — chore(deps-dev): bump the agent-ui-dependencies group in
/src/gaia/apps/webui with 3 updates (amd#2293)
- `d9b11ec7` — refactor(hub): agent-first layout —
hub/agents/\<id>/\<lang> (amd#2060)
- `5f15b333` — feat(daemon): broker-wire the remaining direct model-load
surfaces (amd#2286)
- `3affe149` — fix(ui): detect GPU from real Lemonade payload shapes
(amd#2285)
- `4f888b78` — fix(hub): report file-based custom agents' real health,
not always 'error' (amd#2277)
- `36c29873` — fix(cli): detect GPU on all platforms and honour
default_device (amd#2244)
- `6c6f8a34` — test(audit): coverage for schedule CLI, perf-vis, VLM
extraction, PDF gen/export; fix silent table-row loss (amd#2259)
- `2425afe8` — fix(builder): surface model-not-found (404) instead of a
generic placeholder (amd#2245)
- `3a0eebe7` — ci(hub): wire nine hub package test suites into CI; fix
.cjs docs-link guard gap (amd#2258)
- `3e82ca61` — docs(connectors): correct the client_id_hash claim in the
OAuth runbook (amd#2264)
- `9f7dca84` — fix(ci): fix Lemonade startup and bash-on-PATH in the doc
walkthrough (amd#2281)
- `53f4b529` — fix(daemon): owner-only DACL for the Windows launch
secret (amd#2250) (amd#2282)
- `ee8825fa` — fix(security): require allowed_dir in compute_file_hash
(amd#2280)
- `46fb7687` — spec(factory): define the dogfooding loop — Claudia as
live validation runtime (amd#2234)
- `1a679f02` — feat(ui): always-available OAuth client field in Settings
(amd#2104 interim) (amd#2265)
- `45c796b1` — test(jira): unit tests for JiraAgent HTTP boundary and
config discovery (amd#1991) (amd#2263)
- `bed702eb` — feat(ci): execution-based weekly doc walkthrough (amd#2278)
- `f8f309e6` — fix(ui): stop silently accepting unimplemented agent_mode
'autonomous' (amd#2257)
- `3b0938ed` — fix(ci): weekly audit cross-links the prior parent
instead of auto-closing it (amd#2254)
- `78306480` — test(audit): risk-bearing coverage — jira, trust-gate,
flag-precedence, amd#1655 boundaries (amd#2253)
- `1aa39ca2` — fix(observability): real system-metrics polling + real
rollbackAction (amd#2251)
- `384b3ca8` — fix(security): bind MCP bridge to loopback, not all
interfaces (amd#2246)
- `037f4370` — fix(cli): implement/gate stubbed api-status, eval flags,
schedule --skill (amd#2247)
- `2b6ed53e` — fix(security): rate-limit exposed routes, harden JS
ReDoS/XSS/cleartext-logging (amd#2237)
- `6c6b3baf` — fix(packaging): stop the amd-gaia[agents] extra from
downgrading the core wheel (amd#2262)
- `8744a51a` — fix(security): validate user-influenced file paths
(py/path-injection) (amd#2252)
- `c921fa7b` — feat(email): quality + robustness batch
(amd#2110/amd#2113/amd#2114/amd#2115/amd#2116) (amd#2192)
- `b9391ec2` — fix(security): parameterize SQL, redact sensitive logs,
harden ReDoS regexes (amd#2239)
- `09e0bac4` — fix(security): stop leaking stack traces at API
boundaries + least-privilege workflow permissions (amd#2236)
- `3df5a3db` — fix(security): tighten API CORS — no wildcard origin with
credentials (amd#2238)
- `a3db04ef` — feat(connectors): OAuth forward-out to sidecars (V2-14)
(amd#2203)
- `e0886cbf` — refactor(daemon): reconcile the clocks into one
daemon-owned scheduler (V2-15) (amd#2199)
- `15459153` — feat(daemon): /host/v1 custody API v1 with per-agent
scoping (V2-12) (amd#2197)
- `e226d584` — feat(webui): group session sidebar by agent +
session-state polish (amd#2193)
- `6e48cb22` — feat(daemon): host-owned model-slot broker serializes
loads (V2-11) (amd#2194)
- `c42bb354` — fix(website): correct hub install command and clarify
agent availability (amd#2207)
- `2f18de85` — fix(tests): align email CLI dispatch test with amd#2191
thin-client contract (amd#2209)
- `a2ad4eff` — fix(tests): repair stale gaia.ui.email_sidecar.manager
import after amd#2144 (amd#2208)
- `2b89643c` — fix(webui): repair broken main — AgentHubView imported
deleted AgentHubGrid (amd#2206)
- `68773d46` — test(eval): sidecar eval harness + distributed-seams
suite (V2-19) (amd#2202)
- `d7cffc72` — feat(agent-ui): first-run onboarding wizard — hardware
pre-flight, in-app model download, connect-on-install (amd#2204)
- `5bc7d325` — feat(electron): in-app install, R2 auto-update feed,
gaia:// deep links (amd#2196)
- `eb6b34bf` — feat(daemon): one-time versioned migration of ~/.gaia
state (V2-13) (amd#2200)
- `73b8f98c` — refactor(api): remove the last in-process email mount;
relay via daemon (amd#2176) (amd#2205)
- `e4ea0e33` — feat(connectors): grant the mailbox to the email agent in
the same connect flow (amd#2195)
- `2bf405db` — feat(webui): in-app Hub page with catalog lanes + install
trust gate (amd#2201)
- `459efba9` — feat(api): relay /v1/\<agent>/query through the daemon
(V2-17) (amd#2198)
- `ada5b95a` — feat(cli): gaia email attaches to the daemon — thin
client (V2-8) (amd#2191)
- `a49d257d` — fix(webui): reachable Agent Hub + installed-agent
discovery and per-session picker (amd#2190)
- `7c98b51a` — docs(connectors): rewrite the Google client-ID
walkthrough for the current console (amd#2189)
- `a94a8126` — feat(daemon): deliver sidecar launch secret via 0600
file, not bare env (amd#2149) (amd#2186)
- `5601e2a5` — feat(daemon): streaming SSE reverse-proxy for agent
routes (amd#2150) (amd#2188)
- `1465bc73` — feat(agents): proactive lifecycle hooks with
approval-gated proposals (amd#1484) (amd#2187)
- `2c4ff395` — test(chat): mirror the amd-gaia floor guard from amd#2169;
harden version parsing (amd#2184)
- `2271278c` — fix(llm): make swallowed model-load failures loud in
_ensure_model_loaded (amd#2185)
- `2e0294f9` — feat(hub): add multi-component type discriminator to the
manifest (amd#1716) (amd#2183)
- `b78b71d1` — test(chat): guard the amd-gaia dependency floor against
amd#2112 regression (amd#2174)
- `33caec54` — refactor(ui): extract _best_effort_cancel helper for the
relay cancel paths (amd#2173)
- `ba58e31a` — feat(email): fast dev-iteration loop for the email agent
SDK (amd#2083)
- `f79c4177` — fix(webui): pin explicitly-set session titles — stop
auto-retitle churn (amd#2165) (amd#2171)
- `ae741690` — fix(email): error on an explicitly-targeted unconnected
mailbox instead of substituting (amd#2164) (amd#2172)
- `4dafa091` — fix(email): normalize date operators in search_messages
(amd#2161) (amd#2170)
- `dd2fa328` — fix(email): raise amd-gaia floor to match
get_embedding_model_for_device (amd#2112) (amd#2169)
- `011b6e3c` — fix(email): default calendar list to a forward window
when range args are absent (amd#2162) (amd#2168)
- `ed7d2969` — fix(ui): propagate cancel to the email sidecar on relay
timeout/crash (amd#2158) (amd#2167)
- `d8daf66d` — fix(agent): abort in-flight streaming generation on
Agent-UI Stop (amd#2166)
- `c907f6c4` — feat(memory): adaptive, review-gated onboarding
conversation (amd#1955) (amd#2143)
- `def5e979` — fix(ui): stop blaming Lemonade for cancelled/empty chat
turns (amd#2141)
- `553cb541` — fix(email): consolidate Agent UI pre-scan across every
connected mailbox (amd#2129)
- `5446af2c` — fix(agent-email): drop $orderby from Outlook get_thread
to avoid Graph InefficientFilter (amd#2140)
- `8ba66f4d` — fix(email): REST triage honors the LLM's is_spam verdict
(amd#2125)
- `aa44c2c8` — refactor(daemon): daemon-supervised agent sidecars (V2-6)
(amd#2144)
- `ac3cc4cd` — fix(eval): fail the briefing eval loudly on a
zero-case/zero-judged run (amd#2123)
- `c9566b19` — chore(deps): bump Lemonade Server to v11.0.0 (amd#2130)
- `47c1142a` — feat(ui): route email chat through the sidecar
/v1/email/query loop (V2-10) (amd#2136)
- `b340427d` — docs(skill): correct the release skill against what
v0.22.0 actually did (amd#2133)
- `9f1ece0f` — feat(webui): render→component map + generic render
primitives (V2-9) (amd#2131)
</details>

Full Changelog:
[v0.22.0...v0.23.0](amd/gaia@v0.22.0...v0.23.0)

---

## How these notes were verified

Every **What's New** entry was exercised on real hardware, not inferred
from green CI. Re-verified end to end after merging current `main` (334
commits since v0.22.0), because the delta touched the MCP bridge, hub,
skills, and connectors — the exact surfaces the notes assert.

<details>
<summary>Verification results, what broadened, and what was
excluded</summary>

**Re-verified against the current pin and kept:** `gaia hub`
install/run/uninstall (trust gate enforced); the confirmation gate now
covering terminal + `gaia api` + MCP tool calls (fail-closed classifier
proven model-free — amd#2846/amd#2854); localhost binding + stricter CORS +
enforced MCP `--auth-token` + shell-less MCP launch + `~/.gaia` write
guard + CWE-89 SQL block (amd#2844/amd#2847/amd#2860, live probes); `gaia skill`
create/import/list/info plus signed-tier + pre-publish-audit + migrate
(amd#2692/amd#2702/amd#2693); the Microsoft connector split (two connectors,
secretless PKCE — amd#2896's third connector is Gmail, so the wording is
not stale).

**Broadened this cycle:** the confirmation-gate claim (blocking gap
amd#2846 merged) and the security section (four verified hardening items).
The skills section is stated **opt-in** (amd#2848: no shipped agent loads
skills by default).

**Removed:** the onboarding / day-zero discovery headline — the scanner
works on macOS, but the first-run onboarding flow it feeds is not ready
to ship, so it is not claimed (the underlying commit amd#2747 remains in
the changelog).

**Excluded (not claimable):** a skills-by-default claim (false — amd#2848);
the C++ SDK (real and CI-green but ships no user-facing artifact and
predates this release); the prebuilt terminal-hub binary ("not yet
distributed"). Claims that failed live verification remain filed as open
bugs, not shipped: amd#2883, amd#2884, amd#2885, amd#2893, amd#2894. Email ships as a
beta note whose only asserted behavior — never sending or deleting
without confirmation — is verified.

</details>

## Release checklist
- [x] `util/validate_release_notes.py` passes
- [x] `docs && npx mintlify validate` passes
- [x] `src/gaia/version.py` → `0.23.0`; `LEMONADE_VERSION` → `11.5.0`
- [x] webui `package.json` / `package-lock.json` → `0.23.0`
- [x] Navbar label → `v0.23.0 · Lemonade 11.5.0`
- [x] All 334 commits in range represented in the changelog
- [x] Branch merged current with `main`; `setup.py` keeps `mcp<2.0`
- [ ] Review from @kovtcharov-amd addressed

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Co-authored-by: k <k@e>
kovtcharov-amd pushed a commit to huong8373tt-beep/gaia that referenced this pull request Nov 7, 2026
…ntract.py (amd#6913)

## Summary

Adds two checks to
`hub/agents/email/python/tests/test_doc_consistency.py` that fail when
the npm client's contract version drifts from `contract.py`'s
`SCHEMA_VERSION`: one for the `SCHEMA_VERSION` constant in
`npm/src/types.ts`, and one for the version the intro of `npm/SPEC.md`
says the client pins. Both name the two versions in the failure message.

## Why

amd#2910 bumped the Python contract to 2.13 and left the npm client on 2.12
with CI green. Since this issue was filed, amd#3787 (for amd#2746) added a
TypeScript parity test in `npm/test/query-integration.test.ts`, which
covers the constant when it runs. Two gaps remain:

- That test is `describe.skipIf(!python)`: when Node can't resolve a
Python with `gaia_agent_email` installed (and always on Windows), it
skips silently, which is the failure mode amd#2746 was about. The new check
reads `types.ts` from the Python lane, so there is no interpreter lookup
to skip on.
- Nothing checked the prose claim at the top of `npm/SPEC.md` ("This
client pins `SCHEMA_VERSION` **2.15**, matching the sidecar's current
contract"), which the issue lists as a second place the version can rot.

Both checks run in `test_email_agent_unit.yml`, which already runs
`hub/agents/email/python/tests/` and triggers on changes to
`hub/agents/email/python/**` and `hub/agents/email/npm/**`, so a PR
touching either side runs them.

## Linked issue

Closes amd#2922

## Changes

- `test_npm_client_pins_the_contract_version`: reads `export const
SCHEMA_VERSION = "…"` from `npm/src/types.ts` and compares it with
`contract.SCHEMA_VERSION`.
- `test_npm_spec_states_the_contract_version`: reads the version from
the `npm/SPEC.md` intro sentence and compares it the same way.
- Each fails with an explicit message if its pattern stops matching, so
rewording the source can't turn the check into a silent pass.
- Failure messages follow the shape in the issue: `schema version split:
contract.py = 2.16, npm/src/types.ts = 2.15. Bump both in the same
change.`
- No version is synced automatically, per the issue's constraints. The
checks only report.

## Test plan

- [x] Both files at 2.15 (current `main`): `pytest
hub/agents/email/python/tests/test_doc_consistency.py` → 8 passed, 1
skipped. The skip is the existing `email-integration.mdx` case,
unrelated.
- [x] The amd#2910 case, bumping only `contract.py` to 2.16: both new tests
fail, naming both versions (output under Evidence). Restoring 2.15 makes
them pass again.
- [x] `python util/lint.py --all`: Black, isort, Flake8 and Test Lane
Coverage pass. The only failure is two existing Pylint E1120 errors in
`src/gaia/utils/awake_clock.py:47` and `src/gaia/utils/terminal.py:109`,
which this PR doesn't touch.

## Evidence

- [ ] **Agent exposed in the Agent UI**: N/A, test-only change.
- [ ] **MCP tools / servers**: N/A, test-only change.
- [x] **CLI**: the check run passing on a matched pair, then failing
after bumping only the Python constant:

```
$ pytest hub/agents/email/python/tests/test_doc_consistency.py -k npm
2 passed, 7 deselected

# contract.py: SCHEMA_VERSION = "2.16"  (types.ts and SPEC.md left at 2.15)
$ pytest hub/agents/email/python/tests/test_doc_consistency.py -k npm
E   AssertionError: schema version split: contract.py = 2.16, npm/src/types.ts = 2.15. Bump both in the same change.
E   AssertionError: schema version split: contract.py = 2.16, npm/SPEC.md says 2.15. Update the SPEC.md intro too.
2 failed, 7 deselected
```

- [ ] **HTTP API / REST**: N/A, test-only change.

## Checklist

- [x] I have linked a GitHub issue above (`Closes #N` / `Fixes #N` /
`Refs #N`).
- [x] I have described **why** this change is being made, not just what
changed.
- [ ] I have run linting and tests locally (`python util/lint.py --all`,
`pytest tests/unit/`).
- [x] I have attached **real-world evidence matched to the surface I
changed** (see Evidence above), or marked each surface N/A.
- [x] I have updated documentation if user-visible behavior changed (see
[CONTRIBUTING.md](../CONTRIBUTING.md)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent::email Email agent changes documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(email): scoped 'anything suspicious?' query dumps the full triage report

2 participants