feat(actions,vendo): any REST API with a spec becomes agent tools - #1465
Closed
yousefh409 wants to merge 2 commits into
Closed
feat(actions,vendo): any REST API with a spec becomes agent tools#1465yousefh409 wants to merge 2 commits into
yousefh409 wants to merge 2 commits into
Conversation
Greptile SummaryAdds an OpenAPI connector that converts in-memory REST specifications into agent tools, sharing the existing extraction and HTTP request execution behavior. Local-server coverage confirms configured base URLs, path and query serialization, JSON request bodies, response handling, and per-call authentication headers work together. Confidence Score: 5/5No blocking failure remains. There are no accepted P0 or P1 findings. Reviews (3): Last reviewed commit: "chore: changeset for the OpenAPI connect..." | Re-trigger Greptile |
yousefh409
force-pushed
the
yousefh409/ingest-s2-openapi
branch
from
August 18, 2026 12:53
7ead67b to
29f79ae
Compare
This was referenced Aug 18, 2026
yousefh409
changed the base branch from
yousefh409/ingest-s1-definetool
to
main
August 18, 2026 19:58
openApiConnector({ spec, baseUrl, headers, name }) turns an OpenAPI
document into guarded tools. It is reuse, not new machinery: the same
extractor `vendo sync` runs over a spec file, and the same HTTP dispatch
a host tool executes through.
Two factorings made that sharing possible:
- extractOpenApi's document half moved to the pure src/openapi-document.ts
(the binding-identity.ts precedent). sync/openapi.ts keeps node:fs and
the spec-file entry points; the connector is handed the document in
memory. Keeping it in sync/ would have dragged sync/common.ts and its
TypeScript compiler into the runtime entry, which the portability gate
forbids outright (FORBIDDEN_INPUTS: packages/actions/dist/sync/).
Route naming and extractedRisk moved alongside it into
binding-identity.ts, re-exported from sync/common.ts.
- registry.ts's HTTP leg — argument binding, path substitution, the tRPC
envelope, the fetch — is runtime/http-dispatch.ts now, used by the
registry and the connector both. The JSON accept/content-type envelope
moved inside fetchHostTool, so neither caller sets it.
McpAuthContext and McpHeadersResolver stay working as deprecated aliases
of ConnectorAuthContext / ConnectorHeadersResolver. Both connectors are
re-exported from @vendoai/vendo/server (and so from vendoai/server), and
docs-site/capabilities/connectors.mdx documents them — mcpConnector's
first page.
The test stands up a live HTTP fixture, points the connector at a spec
describing it, and executes through createActions: no stub on either
side. It proves the round trip, that baseUrl beats servers[0], that a
headers resolver sees the principal and grant, and that risk tracks the
method.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
yousefh409
force-pushed
the
yousefh409/ingest-s2-openapi
branch
from
August 18, 2026 20:22
29f79ae to
422267b
Compare
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Collaborator
Author
|
Landed on |
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
Adds
openApiConnector({ spec, baseUrl, headers, name })— turns an OpenAPI document into guarded agent tools. It is reuse, not new machinery: the same extractorvendo syncruns over a spec file, and the same HTTP dispatch a host tool executes through, both refactored to be shared rather than duplicated.Two factorings made the sharing possible:
extractOpenApi's document-level half moved to the purepackages/actions/src/openapi-document.ts;sync/openapi.tskeeps thenode:fsand spec-file entry points, and the connector is handed the document in memory instead.registry.ts's HTTP leg (argument binding, path substitution, the tRPC envelope, the fetch) is nowpackages/actions/src/runtime/http-dispatch.ts, used by both the registry and the connector.McpAuthContext/McpHeadersResolverstay working as deprecated aliases of the newConnectorAuthContext/ConnectorHeadersResolver. Both connectors are re-exported from@vendoai/vendo/server(andvendoai/server), anddocs-site/capabilities/connectors.mdxdocuments them —mcpConnector's first page.Public surface
packages/actions/src/connectors/openapi.ts:Tool names normalize under
openapi_<name>; risk derives fromextractedRisk(method).Net effect
Nets −482/+104 lines by de-duplicating the OpenAPI extractor and HTTP dispatch instead of adding a parallel implementation.
Testing
7 tests stand up a live in-test HTTP fixture server and execute through
createActions— no stub on either side. They prove the round trip, thatbaseUrlbeatsservers[0], that a headers resolver sees the principal and grant, and that risk tracks the method. Full@vendoai/actionspackage: 651 tests passing.Stack
Part of a 4-PR stack (data ingestion + custom tools + connectors + tenant connectors). This PR is based on the
defineToolPR (#1464) and is the second-from-bottom of the stack. The merge unit is the stack tip — this PR is a review window, not an independent merge.🤖 Generated with Claude Code
Summary by cubic
Turns any OpenAPI document into guarded agent tools at runtime via
openApiConnector({ spec, baseUrl, headers, name }). Previously specs only produced host tools at sync; now the connector reuses the same extractor and HTTP dispatch for identical behavior.packages/actions/src/openapi-document.ts;sync/openapi.tsnow only reads files. Route naming and method-based risk moved tobinding-identity.ts(re-exported fromsync/common.ts).packages/actions/src/runtime/http-dispatch.tsand are used by both the registry and connector; JSON accept/content-type are set insidefetchHostTool.openapi_<name>_<operationId>(collisions throw). Risk derives from method (DELETE→destructive, othersungraded).baseUrlpassed to the connector overrides the spec’s absoluteservers[0]; relative servers fall back to the host origin.ConnectorAuthContext/ConnectorHeadersResolverenable per-call headers;McpAuthContext/McpHeadersResolverremain as deprecated aliases. Both connectors are exported from@vendoai/vendo/server.specis the document itself (JSON/YAML text or object), never a path or URL./capabilities/connectors. Live HTTP tests cover round trips,baseUrlprecedence, per-call headers (principal/grant), YAML parsing, and method-based risk.Migration
ConnectorAuthContext/ConnectorHeadersResolverwhen convenient.openApiConnectorfrom@vendoai/vendo/server, pass the spec document, optionally setbaseUrl, and provideheaders(object or resolver) if you need dynamic auth.Written for commit 422267b. Summary will update on new commits.