Repository navigation
Description
Executor version
executor v2.0.0-beta.31 (4e1b45faad7f0b5599e95985131a73299f3115b5)
How do you run Executor?
CLI
Operating system
macOS (Apple Silicon)
Integration involved
OpenAPI spec via liveOpenapiRouter
What happened
When an OpenAPI definition host rejects requests without User-Agent, a URL-backed liveOpenapiRouter fails to load its tools. The source request receives HTTP 403, and Executor reports AppEvaluationFailed / OpenapiError invalid_definition. (That error classification is reported separately in #2409.)
A fetch wrapper passed in liveOpenapiRouter({ fetch }) does not affect this request: the cache loader supplies its own invocation fetch.
What you expected
The framework's source download should send the same default User-Agent: Executor used by generated OpenAPI operation requests.
Steps to reproduce
- Run an HTTP server with
GET /openapi.jsonthat returns a small valid OpenAPI document only whenUser-Agentis present, and HTTP 403 otherwise. A control route that accepts either request should return the same document. - Deploy an app containing:
import { defineApp } from "apps";
import { liveOpenapiRouter } from "apps/openapi";
export default defineApp({}, async ({ cache, fetch, signal }) => ({
tools: liveOpenapiRouter({
source: { url: "http://127.0.0.1:<port>/openapi.json" },
allowedOrigin: "http://127.0.0.1:<port>",
securitySchemes: {},
methods: {},
oauth: [],
cache,
fetch,
signal,
}),
}));- List or call the generated tool.
Expected: the document loads and the tool is available. Actual on beta.31: the source request has no User-Agent, the host returns 403, and tool listing/call returns 502 AppEvaluationFailed with OpenapiError invalid_definition.
The same run with an embedded source.document or a host that accepts requests without the header succeeds. The generated operation call in the control receives User-Agent: Executor.
Diagnostics / logs
The source download is context.fetch(url, { signal, redirect: "manual" }) at packages/apps/src/implementation/openapi-source.ts:431-447. The cache loader supplies the invocation fetch at packages/apps/src/implementation/cache.ts:78-89, so the router's fetch option is not used for this load. Generated operation requests add the default at packages/apps/src/implementation/openapi-request.ts:388-390.
The v2 branch at ae2832ae739964817a88fc30dc19f959aa2dc962 and beta.31 release have the same source-download code.
Before you submit
- I searched the open issues for a duplicate.
- I removed all keys, tokens, and credentials from this report.
Activity