Skip to content

fix(gateway): block upstream built-in tools (web search, URL reading) with 400 - #461

Open
dmae97 wants to merge 1 commit into
feat/omk-gateway-pg-racefrom
feat/omk-gateway-builtin-tools
Open

dmae97 wants to merge 1 commit into
feat/omk-gateway-pg-racefrom
feat/omk-gateway-builtin-tools

Conversation

@dmae97

@dmae97 dmae97 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Per PM decision 2026-11-17 in the provider room.

  • tools accepts only type: "function" entries with a function name. Anything else (for example deepseek_web_search, deepseek_read_url) returns 400 unsupported_tool before the upstream call. That means 0 upstream calls and 0 usage_events rows.
  • An object tool_choice must be type: "function". String values (auto, none, required) pass as before.
  • Matching is on the tool type, not the name, so a function tool named web_search (omk's local tool) still passes unchanged.
  • File input was already rejected (image_input_unsupported), and unknown top-level params are already dropped by the allow-list.

Stacked on feat/omk-gateway-pg-race (which waits on #391). Only gateway/src/validate.ts and gateway/test/params.test.ts change.

Tests: 157 passed, 1 skipped (PGlite), including 6 new cases. Typecheck is clean.

Note: tools: null (and any non-array tools) now returns 400 as well. The omk client never sends it; kept as is for v1 (PM 2026-11-17).

…ols with 400

Built-in tools such as deepseek_web_search and deepseek_read_url are billed
per call outside token metering. Reject any non-function tool or tool_choice
before the upstream call (0 upstream calls, 0 usage rows). Matching is on the
tool type, so a function tool named web_search still passes.

This branch has not been deployed

No deployments
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