Conversation
… pipeline.run default email.get had no way to pass fetchAllBodyValues: true (RFC 8621), so bodyValues always came back empty even when requested in --properties. Added --fetch-all-body-values flag that maps to the JMAP parameter. Added email.read convenience command that returns subject, from, to, and plain text body in a single flattened call — the most common "read an email" use case no longer requires pipeline.run with raw JMAP. Fixed pipeline.run crashing with "ValueError: Unknown json style: None" when --json is omitted. Every other command set a default; this one didn't. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fd08c287a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| except Exception as exc: | ||
| err = {"type": "runtimeError", "message": str(exc), "details": {}} | ||
| return 6, envelope(False, "email.read", vars(args), meta_block(args.host, "unknown", []), error=err) |
There was a problem hiding this comment.
Preserve specific error codes in email.read
email.read only catches Exception and always returns runtimeError/exit code 6, so authentication failures, JMAP method errors, and HTTP status errors are no longer distinguishable for this command. That diverges from the CLI’s documented per-error exit-code behavior used by the other handlers and can break scripts that branch on those codes (for example, retrying HTTP failures but not auth failures).
Useful? React with 👍 / 👎.
Address Codex review: email.read now matches the error handling pattern used by all other handlers (ValueError→2, ClientError→5, HTTPError→3/4, Exception→6) instead of catching bare Exception for everything. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
email.get --fetch-all-body-values: Exposes JMAP'sfetchAllBodyValues: true(RFC 8621) as a CLI flag. Without this,bodyValuesalways returned{}even when included in--properties, making it impossible to read email bodies throughemail.get.email.read --id <id>: New convenience command that returns subject, from, to, and plain text body in a single flattened response. UsesfetchAllBodyValuesinternally and extracts text viatextBody[].partId→bodyValueslookup.pipeline.rundefault--json: Added missingset_defaults(json="compact")— every other command had this, butpipeline.runcrashed withValueError: Unknown json style: Nonewhen--jsonwas omitted.Test plan
All three fixes were verified against the live Fastmail API:
email.get --ids '["..."]' --properties '["subject","textBody","bodyValues"]' --fetch-all-body-values—bodyValuesnow populated with text/plain and text/html content (previously{})email.read --id <id> --json pretty— returns flattened{id, subject, from, to, body}with extracted plain textpipeline.run --input '{"calls":[["Email/query",{"limit":1},"q1"]]}'(no--json) — outputs compact JSON, no crashhelplistsemail.readwith correct summarydescribe email.getshows newfetch_all_body_valuesflagdescribe email.readshowsidoptionEmailGet.to_dict()serializesfetch_all_body_values=Trueas"fetchAllBodyValues": truematching RFC 8621 wire formatfetch_all_body_values=None(default when flag omitted) omits the key entirely from the request — no behavior change for existing usage🤖 Generated with Claude Code