Skip to content

fix: trim discovery transports and return 422 on version mismatch#145

Open
damaz91 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
damaz91:fix/trim-discovery-transports
Open

fix: trim discovery transports and return 422 on version mismatch#145
damaz91 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
damaz91:fix/trim-discovery-transports

Conversation

@damaz91

@damaz91 damaz91 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

This PR includes the following fixes:

  1. Python Server: Trim unsupported transports (MCP, A2A, and Embedded) from the discovery profile. Currently, only the REST transport is fully implemented and served. Advertising other transports causes conformant agents to attempt using them, leading to errors or 404s.
  2. Node.js Server: Correct the version negotiation error response. Return HTTP 422 Unprocessable Entity with a structured UcpErrorDetail instead of HTTP 400 Bad Request when the client requests an unsupported version, aligning with the spec and Python implementation.

Category (Required)

  • Core Protocol: Changes to the base communication layer, global context, or breaking refactors. (Requires Technical Council approval)
  • Governance/Contributing: Updates to GOVERNANCE.md, CONTRIBUTING.md, or CODEOWNERS. (Requires Governance Council approval)
  • Capability: New schemas (Discovery, Cart, etc.) or extensions. (Requires Maintainer approval)
  • Documentation: Updates to README, or documentations regarding schema or capabilities. (Requires Maintainer approval)
  • Infrastructure: CI/CD, Linters, or build scripts. (Requires DevOps Maintainer approval)
  • Maintenance: Version bumps, lockfile updates, or minor bug fixes. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool (resolver, linter, validator). (Requires Maintainer approval)
  • Community Health (.github): Updates to templates, workflows, or org-level configs. (Requires DevOps Maintainer approval)

Related Issues

Fixes #133

Checklist

  • I have followed the Contributing Guide (including Conventional Commits title requirements and ! for breaking changes).
  • My changes pass all local linting and formatting checks.
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk.

Screenshots / Logs (if applicable)

@damaz91
damaz91 requested a review from carolinerg1 July 23, 2026 11:38
@damaz91 damaz91 changed the title fix: trim unsupported transports from Python server discovery profile fix: trim discovery transports and return 422 on version mismatch Jul 24, 2026
damaz91 added 2 commits July 24, 2026 14:35
Only REST transport is currently supported by the Python server.
Removing MCP, A2A, and Embedded transports from the discovery profile
to prevent clients from attempting to use them.

Closes Universal-Commerce-Protocol#133

TAG=agy
CONV=4aee53ae-545a-4ca3-8b91-fee3b95e9ef7
Align Node.js version negotiation error response with the spec and Python
implementation by returning HTTP 422 and a structured UcpErrorDetail.

TAG=agy
CONV=430e7e91-3e21-4a9d-802a-80c71390c95c
@damaz91
damaz91 force-pushed the fix/trim-discovery-transports branch from 3c857cb to 48f0478 Compare July 24, 2026 14:37
Align reference Python server error responses with error_response.json and message_error.json schemas.

- Use 'messages' wrapper instead of 'errors'.

- Use standard 'severity' enums (unrecoverable, requires_buyer_input).

- Raise UcpError/UcpVersionError in dependencies and format in central handler.

- Update integration tests to match new structure.

TAG=agy

CONV=66cef4ea-c19e-4693-8c23-b155a5e0cddc
@damaz91
damaz91 force-pushed the fix/trim-discovery-transports branch from 48f0478 to 579b8aa Compare July 24, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Python server's discovery profile advertises transports it does not serve (mcp, a2a, embedded)

2 participants