Skip to content

fix(ui): refuse email HTTP turns with memory disabled - #5756

Merged
kovtcharov-amd merged 3 commits into
amd:mainfrom
jipeng6036-del:fix/refuse-email-turns-with-memory-disabled
Oct 27, 2026
Merged

kovtcharov-amd merged 3 commits into
amd:mainfrom
jipeng6036-del:fix/refuse-email-turns-with-memory-disabled

Conversation

@jipeng6036-del

Copy link
Copy Markdown
Contributor

Summary

Email turns sent through the chat HTTP API now refuse private and memory-off modes explicitly, rather than forwarding a request the email sidecar cannot honor. Ordinary memory-on turns keep working.

Why

The email profile declares no memory capability, but the dispatcher skipped the capability check for that profile. A private/off turn could therefore reach email without any memory flag. This implements the issue's requested interim refusal; it does not implement the full email memory contract.

Linked issue

Refs #5482

Changes

  • Apply the existing memory-capability gate to every relay profile and explain the email limitation.
  • Cover private/off refusal and ordinary-on behavior across old/current/future API versions; document the HTTP behavior.

Test plan

  • New email regression cases: 6 fail/3 pass on the exact baseline →9 pass with the fix; related relay/profile/proxy/daemon suites: 267 pass.
  • python -m pytest tests/unit/ -n4 --dist=worksteal --timeout=180: 27,517 pass,478 conditional skips,3 xfail,41 subtests; zero failures/errors in the full final log and JUnit.
  • python util/lint.py --all: all17 blocking checks pass; the configured MyPy advisory remains. Module-skip guard and capability-matrix check pass.
  • Frontend npm ci && npm run build, wheel/sdist build, twine check, and both frontend/wheel dist checks pass. All29 built web assets and changed runtime modules match the final wheel.
  • Actual CLI/HTTP/daemon/proxy path on baseline, candidate, and the final wheel installed into a fresh target/HOME: ordinary-on produces one init/query; private/off each produce zero init/query, one failed completion and a persisted error.

Exact commits, environment versions, commands, complete logs, same-condition environment controls and artifact hashes. Earlier full runs exposed HOME/tempguard and generated node_modules/package-scan interference; both reproduce on the exact baseline. After correcting only the environment, the entire unchanged suite above passes. Public full-log copies redact credential-shaped authentication-test parameter IDs; results are intact.

The scarce-hardware eval categories to watch on the next RC are memory, gaia_memory, gaia_email, per CLAUDE.md's RC policy. No local model/judge was invoked. Hosted PR CI and human maintainer review remain pending.

Evidence

  • Agent UI: real browser before→after and reload of persisted HTTP-created history, below. The current email composer is deliberately read-only; these are not composer-send screenshots.
  • MCP: N/A; no MCP surface changes.
  • CLI: actual gaia chat --ui ... launch, server output and daemon handshake are in the evidence. Terminal email interaction is outside this patch.
  • HTTP: real session creation, settings, chat POST/SSE and persisted-message GET; baseline receipts and final-wheel receipts.

Before: a private HTTP turn reaches email with no memory field.

Baseline private HTTP turn in persisted history

After: the turn fails clearly before email init/query; reload retains the error.

Candidate private HTTP refusal in persisted history

The external email executable and Lemonade metadata endpoints are local receipt-only fixtures; the production CLI/routes/database/SSE/daemon/proxy run unmodified. No mailbox, real mail, credentials, model inference or paid service was used. Handle acquisition can still start the sidecar before refusal. Runtime boundary and reproducible commands.

Checklist

  • Linked the issue and explained the user impact.
  • Ran lint and the complete core suite locally.
  • Included actual runtime/browser evidence and the fixture boundaries.
  • Updated the memory guide for the changed HTTP behavior.

@github-actions github-actions Bot added documentation Documentation changes tests Test changes labels Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

Before this change, a private chat or a chat with memory off could be handed to the email agent, which never got the setting and went on saving memories. Now the chat refuses those turns before anything reaches the email agent, and tells the user to switch to the GAIA agent. Normal chats with memory on work as before. This is the interim fix #5482 asks for. The full fix is still open: the email agent has to accept and honor the memory setting itself.

Nothing blocks the merge. Two small follow-ups:

  • A field description still says this message only appears when the agent is out of date, which is no longer true.
  • A future agent profile that leaves this message empty would fail with a blank error. One test could prevent that.

Expect one visible change: anyone who has memory turned off in Settings can no longer use the email agent in chat at all until the full fix lands. That is what the issue asked for, and the memory guide now documents it.

Real-world evidence

N/A here: this run produced no evidence bundle, so the verdict rests on the code review plus the author's own evidence. The PR description embeds before/after Agent UI screenshots of a private HTTP turn. It also links HTTP receipts for both the baseline and the final wheel, which show zero init/query calls for private and memory-off turns and one for a normal memory-on turn. I relay these as the author's claims; I didn't re-run them.

🔍 Technical details

Issues found

🟢 Field doc is stale now that the gate applies to every profile (src/gaia/ui/email_sidecar/profiles.py:162-164). The message also shows when min_memory_api_version is None, which means the agent never takes memory.

    #: Shown instead of running a private or memory-off turn when the installed
    #: agent can't take ``memory`` — it is below :attr:`min_memory_api_version`,
    #: or that floor is ``None`` — so it would save to memory.
    memory_upgrade_message: str = ""

🟢 Blank error if a future profile has no memory floor and no message (src/gaia/ui/_chat_helpers.py:2296-2308). Removing the is not None guard means every profile now takes the refusal path, and memory_upgrade_message defaults to "". A parametrized test over _PROFILES would lock this in: every profile where min_memory_api_version is None must have a non-empty memory_upgrade_message.

Notes (no action needed)

  • I checked both callers: the chat path passes _memory_mode(session, db), and the scheduled-prompt relay always targets the flagship, which has a floor. Neither one changes behavior for the flagship.
  • Eval impact: no prompt or tool surface changed. The author lists memory, gaia_memory and gaia_email to watch on the next RC, which is a reasonable list.

Strengths

  • The fix reuses the existing capability gate and doesn't add an email-specific branch, so a future profile without a memory contract fails loudly by default.
  • The tests assert that neither init nor /query runs on refusal, across old, current and future contract versions, so they prove nothing reached the agent rather than just checking for the error event.
  • The memory-on test pins memory is None, so the email agent's strict extra="forbid" model can't receive an unexpected field.

A profile with no memory contract now always takes the refusal path, so an
empty memory_upgrade_message would show users a blank error. Assert every
such profile has one, and correct the field doc to say the message also
covers agents that never take memory.
@kovtcharov-amd kovtcharov-amd mentioned this pull request Oct 26, 2026
5 of 9 tasks
grtninja pushed a commit to grtninja/gaia that referenced this pull request Oct 26, 2026
## Why this matters

v0.25.2 is a bug-fix release on top of v0.25.1: setup and install no
longer stop at the first failed step, shell and file access handle
Windows paths and text encodings, the Agent UI and desktop app stop
showing misleading states, and document search, email and skills each
lose a handful of rough edges. 55 commits since v0.25.1; notes are in
`docs/releases/v0.25.2.mdx` and credit 15 outside contributors.

## Test plan

- [x] `python util/validate_release_notes.py docs/releases/v0.25.2.mdx
--tag v0.25.2` passes
- [x] `mintlify validate` (from `docs/`) passes
- [x] `python util/check_doc_links.py --internal-only`, `python
util/check_doc_versions.py` and `node
installer/version/bump-ui-version.mjs --check` pass
- [x] `python util/check_component_core_api.py --release-version 0.25.2`
passes
- [x] `pytest tests/unit/test_docs_json_release.py
tests/unit/test_check_component_core_api.py
tests/unit/test_release_tag.py
tests/unit/test_hub_core_version_gate.py`: 156 passed
- [ ] CI green on the merge commit
- [ ] `release_train_dryrun.yml` passes on that commit before the RC tag

## Evals to re-run on the RC tag

LLM-affecting PRs merged without per-PR evals; run these on
`v0.25.2-rc1`:

- `gaia_shell` and shell/safety (amd#5794, amd#5751, amd#5768)
- `gaia_honesty` (amd#5753)
- `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5422, amd#5755)
- `rag_retrieval` and `rag_quality` (amd#5742, amd#5754, amd#5761, amd#5817, amd#5812)
- email scenarios (amd#5767, amd#5811)
- `tool_selection` and `error_recovery` (amd#5732)
- Claude provider thinking replay (amd#5072)
- memory categories (amd#5818 merged; amd#5756 has not)

## Release checklist

- [ ] Freeze main, wait for green CI on the exact commit, pass
`release_train_dryrun.yml`, then push `v0.25.2-rc1`
- [ ] Extend the changelog if main gains commits before the tag
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Thanks @jipeng6036-del. You found that the capability check skipped the email profile entirely, so a private or memory-off chat reached the email agent with no memory setting, and the fix reuses the existing gate instead of adding an email special case. Both of the review bot's findings are fixed in the current diff. I merged current main in, and the PR is ready from our side.

🔍 Technical details
  • Stale field doc on memory_upgrade_message: fixed. It now covers a floor of None.
  • Blank error for a future profile with no floor and no message: pinned by test_every_profile_without_a_memory_floor_explains_the_refusal.
  • Both callers checked. The chat path passes _memory_mode(session, db). The scheduled relay always targets the flagship, which has a floor, so the flagship's behaviour doesn't change.
  • Possible follow-up, not blocking: for a profile with no floor, the refusal could be decided before acquire_handle, so a refused turn never starts the email sidecar.
  • Refs #5482 is right: the full fix, memory on the email /query contract, is still open.
  • tests/unit/test_sidecar_relay_fidelity.py: 64 passed. black/isort/flake8 clean.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 27, 2026
Merged via the queue into amd:main with commit 19283cb Oct 27, 2026
32 checks passed
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Merged — thanks @jipeng6036-del. A chat with memory off can no longer quietly send an email turn that ignores that setting; it now stops with a message saying what to do. The full fix (the email agent honouring the memory setting) is still tracked in #5482.

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

Labels

documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants