Repository navigation
Conversation
….body
Most YAML HTTP tools declare only inputs_schema (no `inputs` list), so
their {placeholders} were never substituted (sent literally, e.g.
/region/%7Bregion%7D) and their required fields were never validated.
_input_fields() now falls back to inputs_schema.properties for any name
the `inputs` list doesn't declare (the list still wins on conflicts),
including `secret: true` for log masking.
Also:
- accept `http.body` as an alias for `http.body_map` (24 tools sent an
empty body); nested JSON values keep their structure instead of being
sent as a Python repr
- resolve {placeholders} in headers, so API keys can travel in a header
instead of the query string
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ax 5) httpx does not follow redirects by default, so every upstream that answers with a 3xx (40 tools in the live probe) failed the run. Redirects are now followed only when they stay on the same host or upgrade http->https, never downgrade to http, and at most 5 hops. When an allowed redirect changes host, credential headers (Authorization, Cookie, *api-key*, *token*, ...) and secret-valued query params are stripped first. Disallowed redirects fail the run with a message that names hosts only, so secrets in URLs never reach run logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s expected
Many upstreams answer 200 with a landing page, login wall or error page;
the run then COMPLETED with {"text": "<html>..."}. Following redirects
made this more common (19 of 40 redirecting tools end on HTML).
Every response is now checked after raise_for_status():
- JSON tool (Accept mentions json, or a response_map reading anything
other than the {"text": ...} wrapper): the body must parse as JSON
- text tool (response_map reads only `text`, e.g. KEGG/efetch): the
body must not be HTML
- no expectation: unchanged
Failure messages name the content type and host only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
A static and live audit of all 1,716 HTTP tools that TES registers here found that most fail inside this executor before the upstream API sees a valid request:
inputs_schema, with noinputslist. Their{placeholders}were never substituted, so the URL went out literally, e.g./vep/human/region/%7Bregion%7D/%7Ballele%7D. Their required fields were never validated either.http.body. Onlyhttp.body_mapwas read, so they POSTed an empty body.What
_input_fields()falls back toinputs_schema.propertiesfor any name theinputslist doesn't declare. Where both exist, theinputsentry wins. Schemasecret: trueis honoured for log masking.http.bodyis accepted as an alias forhttp.body_map. Nested JSON values, such as GraphQLvariables, keep their structure instead of being sent as a Python repr.Header values are templated, so API keys can go in a header rather than the query string.
Redirects:
Authorization,Cookie,*api-key*,*token*, …) and secret-valued query params are stripped first.Response-kind guard on every response, not only redirects. Many upstreams return 200 with a landing page, login wall or error page, and the run used to finish COMPLETED with
{"text": "<html>…"}. Now:Acceptmentions json, or aresponse_mapthat reads anything other than the{"text": …}wrapper): the body must parse as JSON. The body is parsed rather than trusting the content type, so mislabelled JSON still passes.response_mapreads onlytext, e.g. KEGG, efetch, Cactus): the body must not be HTML. Without this exception, 16 working text tools would have broken.From the live probe: this fails 19 redirect-to-HTML runs, plus 11 tools that previously "succeeded" with HTML or XML (DisGeNET, UniChem, DepMap, Orphanet, …).
Tests
428 passed (26 new: schema fallback, body alias and nesting, header templating and masking, 8 redirect-policy cases, 9 response-kind cases). The ruff error count is unchanged from
main(25, all pre-existing).Merge order
Merge and deploy this before the TES PR (OmniBioAI/omnibioai-tes, branch
fix/http-tool-definitions). TES's new CI gate assumes this executor behaviour.🤖 Generated with Claude Code