Skip to content

Answer requests other than POST in the gateway; v0.57.1 - #248

Merged
fylorn merged 1 commit into
mainfrom
gateway-non-post-local
Oct 1, 2026
Merged

fylorn merged 1 commit into
mainfrom
gateway-non-post-local

Conversation

@fylorn

@fylorn fylorn commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Patch release: the gateway answers requests other than POST itself instead of forwarding them.

Problem

Every upstream API the gateway forwards to takes POST, and hop::send always sends the upstream request as POST. Any other method that reached the catch-all route was therefore:

  • sent on as an empty POST;
  • recorded as a failed request;
  • with failover, tried on the next upstreams as well.

Hermes Agent, which ThinkWatch Lite can now connect, sends five such GETs when it starts (/api/v1/models, /api/tags, /v1/props, /props, /version; detect_local_server_type in agent/model_metadata.py). It uses them to tell whether a server is LM Studio, Ollama, llama.cpp or vLLM. Each of them showed up in Traffic as a failed request. An upstream that answered one of them with 200 made Hermes take the gateway for that kind of server.

Change

  • In passthrough, after the key check and the WebSocket branch, a method other than POST gets a 404 in the client's error format (Anthropic when anthropic-version is present, otherwise Chat Completions).
  • The request is not forwarded and not recorded. The new message code is gw.method.not_forwarded.
  • A request without a key still gets 401, so an unknown caller learns nothing about the gateway.
  • /v1/models, /v1beta/models, /api/hello, /healthz and WebSocket upgrades have their own routes or branch and are unchanged.
  • no_files now uses the same not_found helper.
  • New crates/tw-gateway/tests/probes.rs covers the Hermes probe paths, other methods, the 401 without a key, the Anthropic error shape, and that POST is still forwarded and recorded. Before the change, the probes got the fake upstream's 200.

Release

  • Bumps the workspace to 0.57.1, with release-notes/0.57.1.md.
  • The control-plane protocol (31) and the request store schema (23) are unchanged.

Checks

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace: 2044 passed
  • msg-codes.txt regenerated

🤖 Generated with Claude Code

Every upstream API the gateway forwards to takes POST, and the gateway
always sent the upstream request as POST. Any other method that reached the
catch-all route was sent on as an empty POST, recorded as a failed request
and, with failover, tried on the next upstreams. Hermes Agent sends five such
GETs when it starts (/api/v1/models, /api/tags, /v1/props, /props, /version)
to tell whether a server is LM Studio, Ollama, llama.cpp or vLLM; an upstream
that answered 200 made it take the gateway for one of them.

Such requests now get a 404 in the client's error format, after the key
check, and are neither forwarded nor recorded (new message code
gw.method.not_forwarded). Requests without a key still get 401. /v1/models,
/v1beta/models, /api/hello, /healthz and WebSocket upgrades are unchanged.
The Files API 404 shares the same helper.

Bumps the workspace to 0.57.1 with release-notes/0.57.1.md. The control-plane
protocol (31) and the request store schema (23) are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 2c0c9f3 into main Oct 1, 2026
4 checks passed
@fylorn
fylorn deleted the gateway-non-post-local branch October 1, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant