Skip to content

Commit a06d8e1

Browse files
committed
Give json-schema-ref-no-deref its own handler
One @register per function: revert the stacked decorators and add a dedicated handler. It just initializes and lists tools (ClientSession never resolves $refs), with a docstring explaining why that is sufficient.
1 parent 7a2e7ab commit a06d8e1

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/actions/conformance/client.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ async def handle_callback(self) -> tuple[str, str | None]:
164164

165165

166166
@register("initialize")
167-
# SEP-2106: json-schema-ref-no-deref only requires the client to call tools/list against a
168-
# server advertising a tool with a network $ref. ClientSession never walks inputSchema or
169-
# resolves $refs, so plain initialize + list_tools satisfies it; no dedicated handler needed.
170-
@register("json-schema-ref-no-deref")
171167
async def run_initialize(server_url: str) -> None:
172168
"""Connect, initialize, list tools, close."""
173169
async with streamable_http_client(url=server_url) as (read_stream, write_stream):
@@ -178,6 +174,18 @@ async def run_initialize(server_url: str) -> None:
178174
logger.debug("Listed tools successfully")
179175

180176

177+
@register("json-schema-ref-no-deref")
178+
async def run_json_schema_ref_no_deref(server_url: str) -> None:
179+
"""Initialize and list tools; the scenario fails only if the client fetches a network $ref.
180+
181+
ClientSession never walks inputSchema or resolves $refs, so listing is enough (SEP-2106).
182+
"""
183+
async with streamable_http_client(url=server_url) as (read_stream, write_stream):
184+
async with ClientSession(read_stream, write_stream) as session:
185+
await session.initialize()
186+
await session.list_tools()
187+
188+
181189
@register("tools_call")
182190
async def run_tools_call(server_url: str) -> None:
183191
"""Connect, initialize, list tools, call add_numbers(a=5, b=3), close."""

0 commit comments

Comments
 (0)