fix(mcp): normalize form elicitation schemas#1278
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR normalizes the Astrid CLI’s MCP typed form elicitation schemas to be compatible with strict MCP clients (e.g., Codex) that reject optional top-level JSON Schema annotations before authorization can proceed.
Changes:
- Introduces a shared
form_elicitation::elicit<T>()helper that strips top-leveltitle/descriptionwhile preserving typed decoding and fail-secure behavior. - Routes ingress consent, capsule grant-on-use, and capability approval prompts through the shared helper.
- Adds regression tests for the serialized top-level schema keys and documents the fix in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/astrid-cli/src/commands/mcp/mod.rs | Registers the new shared form_elicitation module. |
| crates/astrid-cli/src/commands/mcp/ingress.rs | Switches ingress consent elicitation to use the compatibility helper. |
| crates/astrid-cli/src/commands/mcp/grant.rs | Switches grant-on-use elicitation to use the compatibility helper. |
| crates/astrid-cli/src/commands/mcp/elicit.rs | Switches capability approval elicitation to use the compatibility helper. |
| crates/astrid-cli/src/commands/mcp/form_elicitation.rs | Adds schema-normalizing elicitation implementation plus targeted regression coverage. |
| CHANGELOG.md | Documents the interoperability fix under [Unreleased]. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Linked Issue
Closes #1277
Summary
Normalizes Astrid MCP form elicitation schemas so strict clients such as Codex can present ingress, capsule-grant, and capability-approval prompts instead of rejecting them before authorization.
Changes
titleanddescriptionschema annotations[Unreleased]Verification
cargo fmt --all -- --checkcargo test -p astrid commands::mcp -- --nocapture(56 passed)cargo clippy -p astrid --all-features -- -D warningscargo test --workspace -- --quiet(full workspace passed; rerun outside the filesystem sandbox for localhost-bind tests)requestedSchemawith onlyproperties,required, andtype; an explicitallow: trueresponse authorizedlist_skillsand returned a successful tool resultChecklist
[Unreleased]— or[Unreleased]rolled into a version section for a release PR; not applicable to docs/CI-only changes)