Files
anomalyco_opencode/packages
Kit Langton c4c60e76ae refactor(llm): polish openai-responses hosted tools and body schemas
Three small cleanups in the OpenAI Responses protocol:

- Unify `HOSTED_TOOL_NAMES` + `hostedToolInput` into one `HOSTED_TOOLS`
  record per tool: `{ name, input: (item) => unknown }`. Adding a new
  hosted tool is now a single entry instead of two parallel switches that
  must stay in sync.
- Tighten `isHostedToolItem`'s narrowing to include the `type` field, so
  callers know they're dealing with a known hosted-tool shape (not just
  "has an id"). Drives a cleaner `hostedToolEvents` signature.
- Split the body schema into a shared `OpenAIResponsesCoreFields` record
  used by both the HTTP body (adds `stream: true`) and the WebSocket
  `response.create` message (adds `type`). Removes the destructure-and-
  strip dance at schema definition time. Runtime conversion in
  `webSocketMessage` still strips `stream` because OpenAI's WebSocket API
  doesn't expect it on the wire.

Plus a tiny fix in bedrock-converse.ts: explicit `Route.model<BedrockConverseModelInput>`
type argument so the mapInput overload selects properly (was inferring
to the narrower `RouteModelInput`).
2026-05-07 13:15:16 -04:00
..
2026-05-02 19:53:06 +00:00
2026-05-02 19:53:06 +00:00
2026-05-03 02:10:52 +00:00
2026-05-02 19:53:06 +00:00
2026-05-02 19:53:06 +00:00
2026-05-03 00:10:53 +00:00