Repository navigation
Conversation
An operation is left out with its reason when its path has a placeholder with no declared path parameter, writes a declared parameter as :name, *name or beside a regex group such as (\d+), has a stray brace such as /users/{id?}, or is a GET or HEAD that requires a body. An optional GET or HEAD body, and a declared path parameter the path does not hold, are not sent and are named in the tool description, so the tool stays callable.
Release-note: Fix: OpenAPI imports now explain which operations cannot be called and why, instead of offering tools that always fail.
yashgix
force-pushed
the
import-diagnostics
branch
from
November 25, 2026 05:04
2c8de9c to
af5d3a9
Compare
This branch has not been deployed
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.
Problem
Some OpenAPI operations compile into tools that can never make a valid request. A path that names
{report_slug}while the operation declaresreport_id, a template like/users/{id?}, or a GET that requires a body all end the same way: the tool is offered, an agent calls it, and every call fails with an error the agent cannot fix. The agent spends turns on a tool that was never usable.Change
Import now checks each operation for these cases. It leaves the operation out of the tool list and records the reason with the other skipped operations:
:nameor*name, or beside a regex group such as(\d+), which OpenAPI never fills/users/{id?}fetchcannot sendOperations that stay callable
The check refuses only what cannot work. Tools that send a correct request today keep working, and the tool description says what was left out:
?counts as held, because the request builder fills it (/search?limit={limit}sends?limit=5). One after#does not, because the fragment is dropped./files/{id}:copy,/items(archived)/{id}.Behaviour changes
Verification
Results for this change alone, on the final commit:
bun run e2e:self-host --test-name "OpenAPI import reports a misnamed path parameter, a :name placeholder and a required GET body, drops an optional body, and keeps an operation with a path parameter its path does not hold"passes. It covers each case above, a call to a kept tool with an extra path parameter that reaches/items/7, and a/search?limit=5call. With realv2product code and only this scenario added, it fails at the first operation the check refuses.oxlintare clean on the changed files.tscpasses for the root ande2eprojects.bun run typecheck(9 projects) andbun run e2e:checkpass.Import-level results on public specs, offline. They were observed in the combined benchmark (this change and #2590 applied together) and were not measured for this change alone. Which operations import exposes does not depend on #2590, so they describe this change's import behaviour:
v2exposes: 22 whose path has a placeholder no declared parameter fills, and 11 written as:nameor*name. This was counted before a final narrowing of the regex-group rule, which can only lower it.The query-encoding results are in #2590 and are not part of this change.
Scope and limits
?(/find?limit={limit}with nolimitdeclared) is not diagnosed. It is sent aslimit=%7Blimit%7D. A query may also hold literal braces, so diagnosing it needs a rule for which braces count./jobs/:jobId.jsondeclaringjobId, and/jobs/:iddeclaringjobId. Both send the colon segment as written. A wildcard written{resource_path*}or{*path}has a different name from the declared parameter, so it is refused as an undeclared placeholder.pr:checkcannot run as a whole becausev2andmainshare no history. The release-note check ande2e:check-descriptionran on an earlier revision of this change that edits the same four files, and were not rerun on the final commit.apps-versionwas not run. No live provider was called.I directed the scope and review of this contribution, using Claude Code during implementation and additional AI tools for independent review. The tests, measurements, and known limitations are documented above.