Repository navigation
docs(email): give the 120 s undo window in the npm docs - #6879
Conversation
The npm SPEC and SKILL docs said archive/quarantine can be undone for 30 s; the agent defaults to 120 s and GAIA_EMAIL_UNDO_WINDOW_SECONDS changes it. Also mark the email eval workflow as disabled in EVALUATION.md and stop calling a higher MINOR backward-compatible. Refs amd#4429
|
Verdict: Approve with suggestions The email agent's npm docs now say the right thing: archive and quarantine can be undone for 120 seconds by default, and the window can be changed with an environment variable. They no longer call the nightly email eval live, and they stop promising that every minor API version is backward-compatible. I checked each new claim against the code and they all hold. I found no other doc still saying 30 seconds. One small fix is worth making: the new version-check note sends npm readers to "CONTRACT.md", but that file isn't in the npm package, so they have nothing to open. Linking it on GitHub fixes that. Real-world evidenceN/A: this PR changes only docs and code comments. The verdict rests on reading the changes against the code. 🔍 Technical detailsChecked against the code
Issues 🟢 The CONTRACT.md pointer can't be followed from the npm package ( 🟢 The new prose in Strengths
|
Address review: CONTRACT.md isn't shipped in the npm package, so link it on GitHub instead of naming it. Refs amd#4429
|
Both suggestions are applied:
|
…tract (amd#6910) ## Summary `openapi.email.json` listed only 200 and 422 for the three `/query` routes, although they also return 400, 404, 409, 500 and 502. This PR declares those statuses on the route decorators, regenerates `openapi.email.json` and `specification.html`, and adds a test that fails if a `/query` route raises a status the spec doesn't list. ## Why `openapi.email.json` is the contract the npm client and generated clients are built from. A client generated from it had no typed path for a stale `needs_input` answer (409), a busy session (409), or an agent that failed to start (502), even though `npm/SPEC.md` already documents them in prose. This is the last item of amd#4429; the docs part landed in amd#6879. ## Linked issue Closes amd#4429 ## Changes - `query_routes.py`: `POST /v1/email/query` declares 400, 409, 500 and 502 next to its SSE 200; `/query/{run_id}/cancel` declares 404; `/query/{run_id}/respond` declares 404 and 409. Each description says when that status is returned. No handler logic changed. - `openapi.email.json`: regenerated with `python -m gaia_agent_email.export_openapi`. - `spec_html.py` / `specification.html`: the `/query` block is hand-written and listed no errors, so it gets one paragraph naming them (cancel and respond already did); regenerated with `python -m gaia_agent_email.spec_html`. - `tests/test_rest_contract.py`: `test_query_routes_document_every_status_they_raise` reads every `HTTPException(status_code=...)` in each `/query` handler from the source and asserts the spec lists it, so a new status added without a `responses` entry fails CI. - `CHANGELOG.md`: an Unreleased "Fixed" entry. - No `SCHEMA_VERSION` bump: no request or response shape changed and no operation was added. I followed amd#3002, which also only added to what the OpenAPI document declares and did not bump. Happy to bump to 2.16 if you'd rather treat this as a contract change. ## Test plan - [x] `python -m gaia_agent_email.export_openapi --check` and `python -m gaia_agent_email.spec_html --check` both report up to date after regenerating (the OpenAPI check failed before). - [x] `pytest hub/agents/email/python/tests tests/test_email_openapi_conformance.py`: 2378 passed, 3 skipped (Python 3.12, `.[dev,api,publish]` + the email package, as in `test_email_agent_unit.yml`). - [x] Removed the 409 from `/respond`'s responses on purpose: the new test failed with `POST /v1/email/query/{run_id}/respond raises ['409'] undocumented`, then passed again once restored. - [x] `python util/lint.py --all`: everything passes except two Pylint E1120 errors in `src/gaia/utils/awake_clock.py:47` and `src/gaia/utils/terminal.py:109`, files this PR doesn't touch. ## Evidence - [ ] **Agent exposed in the Agent UI**: N/A, no UI change. - [ ] **MCP tools / servers**: N/A, no MCP change. - [ ] **CLI**: N/A, no CLI change. - [x] **HTTP API / REST**: real requests through the routers the sidecar mounts (`export_openapi.build_app()` in a `TestClient`), next to what the regenerated spec now lists: ``` $ POST /v1/email/query/{run_id}/cancel -> 404 {'detail': "No in-flight run for run_id '0f5caf10-…'."} openapi.email.json lists: ['200', '404', '422'] $ POST /v1/email/query/{run_id}/respond -> 404 {'detail': "No in-flight run for run_id '0f5caf10-…'. It has already finished or been cancelled, so there is nothing to answer."} openapi.email.json lists: ['200', '404', '409', '422'] $ POST /v1/email/query (provider: "openai") -> 400 {'detail': "provider 'openai' is not supported: the email agent runs local inference only. Omit 'provider' or set it to 'lemonade'."} openapi.email.json lists: ['200', '400', '409', '422', '500', '502'] ``` Before this PR, all three listed only `['200', '422']`. ## 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)).
Summary
The email agent's npm docs said an archive or quarantine can be undone for 30 s; the agent keeps the window open for 120 s by default (
GAIA_EMAIL_UNDO_WINDOW_SECONDSchanges it). This PR fixes that and two smaller places where the npm docs contradict the code.Why
Integrators size UI timers and retry logic from
SPEC.mdandSKILL.md. With the docs saying 30 s, they hide the undo button 90 s early, and the docs never mention that the window can be changed. The EVALUATION.md line made the email eval look like it still runs nightly, so readers would treatSCORECARD.mdas continuously refreshed, and thecheckVersioncomment promised that a higher MINOR is always backward-compatible, which CONTRACT.md says is not true (2.3 was breaking).Linked issue
Refs #4429
This covers the undo window and the first two "smaller contradictions". The third one (adding the 400/404/409/500/502
responsesto the/queryroute decorators and regeneratingopenapi.email.json+specification.html) touches Python and generated files, so it can go in a separate PR; I'm happy to take it next.Changes
npm/SPEC.md,npm/SKILL.md: the undo window is "120 s by default,GAIA_EMAIL_UNDO_WINDOW_SECONDSto change" instead of 30 s.npm/src/client.ts: the same fix in the header comment forunarchive/unquarantine(comment only).npm/EVALUATION.md:test_email_agent_eval.ymlis described as disabled pending feat(email,skills): absorb inbox triage into the flagship agent so the email agent can be decommissioned #3329 instead of "nightly, report-mode".npm/src/lifecycle.ts(comment only) andnpm/SPEC.md:checkVersionaccepts a higher MINOR, but a MINOR bump can be breaking; both now point to CONTRACT.md's version history.npm/CHANGELOG.md: one Unreleased entry for the undo-window correction.npm/CHANGELOG.md, and thepython/CHANGELOG.mdline that records the raise to 120 s (fix(email-agent): bulk-archive undo window (30s) is too short for chat-mediated undo #2447).Test plan
grep -rn "30s\|30 s" hub/agents/email/npm --include=*.md --include=*.ts --exclude-dir=node_modulesonly finds the unrelated 30 s client timeout (lifecycle.ts:668) and two historical CHANGELOG entries.hub/agents/email/python/gaia_agent_email/config.py:75(_DEFAULT_UNDO_WINDOW_SECONDS = 120) and.github/workflows/test_email_agent_eval.yml(schedule removed at :88,if: falseat :243).cd hub/agents/email/npm && npm ci && npm run build && npm teston Node 22: build clean, 132 passed / 6 skipped (the.tschanges are comments only).python util/lint.py --allpasses.Evidence
N/A for every surface: this PR changes only Markdown docs and two TypeScript comments, so no Agent UI, MCP, CLI or HTTP API behaviour changes.
Checklist
Closes #N/Fixes #N/Refs #N).python util/lint.py --all,pytest tests/unit/).