fix(packs): accept both message_id and id in gmail message-targeting normalizers#47
Merged
Merged
Conversation
…normalizers Commit 753f283 hard-pinned `from: "message_id"` to match the canonical `permit0-gmail` MCP wrapper, but Google's official Gmail MCP, community wrappers, and the conditional aliases that rewrite `label_message`/ `label_thread` to `gmail_delete` all carry the message id under `id`. Those calls 500'd with "missing required field 'message_id' in tool call 'gmail_delete'" because the normalizer only checked one path. Adds a `from_any: Vec<String>` fallback list to `EntityDef`. The extractor tries `from` first, then each entry in `from_any` in order, treating null as absent so a fallback can fill in. Updates the seven gmail message-id normalizers (read, delete, archive, flag, mark_read, mark_spam, move) to declare `from_any: ["id"]`. Regenerates the email pack lockfile and adds two regression tests for the canonical and Google-style spellings.
added 3 commits
May 10, 2026 13:42
Pre-existing block on main. webpki-roots (transitively via ureq) ships Mozilla's root cert bundle under CDLA-Permissive-2.0 — a permissive data-sharing license. Adding it to the allow list so cargo-deny CI passes for this PR; tracked alongside the permissive code licenses already on the list.
…tt-ae911e # Conflicts: # deny.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #41.
Summary
from_any: Vec<String>fallback list toEntityDef. The extractor triesfromfirst, then each entry infrom_anyin order, treating null as absent so a fallback can fill in.from_any: ["id"].packs/permit0/email/pack.lock.yamland adds two regression tests for the canonical and Google-style spellings.Why
Issue #41: hooks were 500'ing with
missing required field 'message_id' in tool call 'gmail_delete'(and the parallel error for read/move/archive/etc.) when the upstream MCP wrapper carried the message id underidrather thanmessage_id.Commit 753f283 hard-pinned
from: "message_id"to match the canonicalpermit0-gmailMCP wrapper. That fixed the canonical wrapper but broke:id)aliases.yamlthat rewritelabel_message/label_thread(withlabelIds: ["TRASH"]) togmail_delete— the alias rewrites the tool name only, leaving the originalidparameter in placefrom_anylets one normalizer accept multiple parameter spellings without forking per upstream.Test plan
cargo test --workspace— green (added two regression tests incrates/permit0-dsl/tests/pack_integration.rs)cargo clippy --workspace --all-targets -- -D warnings— greenpermit0 serve --uidaemon:gmail_deletewithmessage_id→ ALLOWgmail_deletewithid(was 500) → ALLOWgmail_movewithmessage_id+destination→ ALLOWlabel_messagewithid+labelIds: ["TRASH"](alias-routes togmail_delete) → ALLOWgmail_deletewith empty params → still errors as expectedcargo run -- calibrate testhas 3 pre-existing failures on this branch (email send escalation from 753f283), unrelated to this change — confirmed by stash-and-test against main.