fix(codex-runtime): advertise strict hermes-tools MCP schemas - #26432
Open
lidge-jun wants to merge 1 commit into
Open
fix(codex-runtime): advertise strict hermes-tools MCP schemas#26432lidge-jun wants to merge 1 commit into
lidge-jun wants to merge 1 commit into
Conversation
lidge-jun
force-pushed
the
codex/26010-hermes-tools-strict-mcp-schemas
branch
from
May 17, 2026 03:33
a259af3 to
c8971ec
Compare
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for targeting a real Codex MCP interoperability problem. The advertised-schema change is not sufficient on its own because it leaves the execution contract split.
Problems
agent/transports/hermes_tools_mcp_server.py:180-186builds FastMCP's tool from_dispatch(**kwargs)and then replaces only.parameters. FastMCP 1.26.0 validates calls through the separatefn_metadatagenerated from that callable, so direct arguments allowed by the advertised Hermes schema can fail beforehandle_function_call. The isolated live smoke recorded in #29821 reproduced this on this PR head askwargs Field required.tests/agent/transports/test_hermes_tools_mcp_server.py:143-198checks only a fake manager's advertised schema; it never invokes FastMCP's actual validation/dispatch path.
Suggested changes
- Align the execution-time FastMCP argument model with the authoritative Hermes schema, or install a raw validated-arguments adapter rather than changing
.parametersalone. - Add an actual FastMCP call-path regression test proving direct arguments reach
handle_function_call.
Automated hermes-sweeper review.
| description=description, | ||
| ) | ||
| if hasattr(tool, "parameters"): | ||
| tool.parameters = input_schema |
Contributor
There was a problem hiding this comment.
This only changes tools/list: FastMCP still validates calls through fn_metadata, which was generated from the **kwargs handler at registration. A call using the newly advertised direct fields can therefore fail with kwargs Field required before Hermes dispatches it. Update the execution-time argument model/adapter too, and cover a real call_tool invocation.
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.
Summary
hermes-toolsMCP callback.additionalProperties: falseto object schemas.Refs #26010 (T15).
Verification
python3 -m py_compile agent/transports/hermes_tools_mcp_server.py tests/agent/transports/test_hermes_tools_mcp_server.py../hermes-pr-8733-wecom-media-path-boundary/.venv/bin/python -m py_compile agent/transports/hermes_tools_mcp_server.py tests/agent/transports/test_hermes_tools_mcp_server.py../hermes-pr-8733-wecom-media-path-boundary/.venv/bin/python -m pytest -o addopts='' tests/agent/transports/test_hermes_tools_mcp_server.py -q— 11 passed../hermes-pr-8733-wecom-media-path-boundary/.venv/bin/python -m ruff check agent/transports/hermes_tools_mcp_server.py tests/agent/transports/test_hermes_tools_mcp_server.pygit diff --checkReal behavior proof
Behavior addressed:
hermes-toolsMCP callback tools now advertise Hermes' original JSON parameter schema with strict object metadata instead of FastMCP's generic**kwargs-derived schema.Real environment tested: Local macOS checkout using the existing sibling Hermes
.venvbecause this new worktree did not have its own virtualenv. No live Codex turn was required for the schema advertisement proof.Exact steps or command run after this patch:
Evidence after fix: The server registered 13 available local tools and
browser_navigateadvertised an object input schema withadditionalPropertiesset toFalseand a realpropertiesobject.Observed result after fix: A local MCP list-tools path sees strict schema metadata on advertised Hermes callback tools. The optional local environment was missing
websockets, so some browser-dialog dependent tools were skipped by existing discovery behavior, but the server still registered available tools and exposed strict schemas for them.What was not tested: A full live Codex app-server MCP call was not run, and the full repository test suite was not run.