mail_read reads up to 20 ids in one call with a shared max_chars budget #133
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #106 (item 6, batch read). Split from #109 at triage 2026-11-02, so that #109 stays under the dispatch file limit.
Agent Brief
Category: enhancement
Summary: mail_read takes up to 20 ids in one call, with one shared
max_charsbudgetCurrent behavior:
mail_readtakes one id per call. A client that reads ten messages makes ten calls.Desired behavior:
mail_readtakesmessage_ids(1 to 20 ids) in place of a single id.max_charsbudget is split evenly across the ids. A share that a message does not spend flows to the later messages.not_founderror.Key interfaces:
mail_readsignature and docstring.mail_read.Acceptance criteria:
max_chars=3000returns the three bodies under one footer.not_founderror.make checkpasses.Out of scope:
Blocked by
mail_readsignature and header)Filed under: operator word "all" sha256:5ef5ef0364b6
⏸ SVD architect gate: dev/mail-mind-mcp#133 mail-read-reads-up-to-20-ids-in-one-call-with-a-shared-max-c
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
substrate· dispatch efforthighRun:
20261102T122604Z-9be8cb90Held because: CLEAN but 3 open risk(s) (1 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
Change: In src/mail_mind_mcp/server.py, move lines 582-615 of mail_read, unchanged, into _read_text(message_id, row, max_chars, max_addresses) -> (text, truncated). Change the parameter to message_ids: Annotated[list[str], Field(min_length=1, max_length=MAX_READ_IDS=20)], shaped like mail_flag (server.py:1116-1121). Dedupe in request order with dict.fromkeys, as _refs does (server.py:1019-1028). Look up each id once; a malformed id raises invalid_argument for the whole call. If no id is found, raise the existing BladeError(CODE_NOT_FOUND, "message not found in the mirror"). With one unique id, return _read_text unchanged, so the output is byte-identical. With several, the k-th of m found messages gets share = (max_chars - used) // (m - k), so unspent characters flow forward. Each block is preceded by '=== message k of m ==='. The footer is 'full=N truncated=N not_found=ids|-', key=value like mail_thread (server.py:527). Change panel.html:144 to message_ids: [id] and update README.md:51. Update every caller of the old message_id form in 8 test files (CONV-23). Add tests/test_batch_read.py on the test_copies mirror fixtures. Add a single-id pin test next to test_mail_status_default_output_is_pinned (tests/test_server.py:83-108), proved on the pristine base first.
Files:
src/mail_mind_mcp/server.py·src/mail_mind_mcp/panel.html·README.md·tests/test_batch_read.py·tests/test_server.py·tests/test_compact_rows.py·tests/test_attachments.py·tests/test_utc_dates.py·tests/test_attachment_signals.py·tests/test_ids.py·tests/test_evidence.py·tests/test_panel.py·tests/integration/test_greenmail.pyDecision: accept the 3 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mail-read-reads-up-to-20-ids-in-one-call-with-a-shared-max-c.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mail-read-reads-up-to-20-ids-in-one-call-with-a-shared-max-c.mdspec-verify-dispatch Half B for dev/mail-mind-mcp#133 mail-read-reads-up-to-20-ids-in-one-call-with-a-shared-max-c completed integration verify.
5af2ef1eb45af2ef1: no remote CI exists (absent). Local: full unit run 895 passed 8 skipped; focused 264 passed. One PR-metadata blocker: the body does not name the message_id to message_ids rename.message_idofmail_readbecomesmessage_ids(1 to 20 ids), so clients with a cached schema must re-list tools.message_idofmail_readbecomesmessage_ids(1 to 20 ids), so clients with a cached schema must re-list tools.; no denial signature; evidence: Spec Agent Adjustments: "The PR body names the rename in one sentence." PR #146 body mentions no rename of message_id to message_ids.Co-Authored-By: gpt-6.1-sol— repo convention is one Co-Authored-By line; not verified against policy.5af2ef1and the repo has no .woodpecker CI (CI files are added by the architect); no tracking pointer exists. — reported as absent, not blocking (gh#633)message_idofmail_readbecomesmessage_ids(1 to 20 ids), so clients with a cached schema must re-list tools.; edit the PR title or body by hand, then re-run integrate or run the own-execution gate.spec-verify-dispatch Half B for dev/mail-mind-mcp#133 mail-read-reads-up-to-20-ids-in-one-call-with-a-shared-max-c completed integration verify.
5af2ef1eb45af2ef1: no remote checks exist. Local unit run: 895 passed, 8 skipped, 18 deselected. ruff and mypy --strict are clean.find . -mindepth 2 -name .gitto print nothing before commit. It printed nothing here outside .venv.5af2ef1. The repo has no .woodpecker CI; the architect adds CI files. — reported as absent, not blocking (gh#633)codex-svd ship --run-id 20261102T124455Z-332bda05 --confirm-merge)