#15403·dynamo

DEP: Hosted-tool orchestration service for Responses clients

Author: elizabethtCreated Sep 30, 2026Updated Sep 30, 2026
Labelslanguage::pythondynamo-llmfrontend

Summary

Add opt-in hosted web search for Responses clients using Dynamo inference. Start with a runnable hosted-tool orchestration service reference implementation that translates web_search to a private function, executes searches through an operator-configured HTTP service, and resumes generation. The native frontend continues to reject hosted tools until an execution path is configured. This DEP extends #12859 without closing its broader file-search and MCP scope.

Motivation

Clients can send {"type":"web_search"} to /v1/responses. The current Responses-to-Chat adapter rejects that definition before generation. Parsing a search call is insufficient: a serving component must perform the search, pass results back to the model, and reconstruct the client's Responses lifecycle. This is separate from function-name namespace collisions addressed by #15401.

Proposal

Ownership and first implementation

Ship a standalone Python hosted-tool orchestration service example in the Dynamo repository. Clients direct Responses requests to the service, which calls a separately configured Dynamo /v1/responses endpoint. This keeps network credentials, tool execution, and multi-turn policy out of the shared frontend-crates parsers and renderers. No GPU worker change is required.

The service owns the model/tool execution loop: it executes hosted searches, returns tool results to the model, and assembles the Responses output. Existing inference/API gateways continue to own traffic entry, authentication, routing, and policy. Issue #12859 does not prescribe a separate service; this DEP proposes it as a reference implementation pending maintainer review.

Use a fixed operator-configured HTTP search endpoint. The orchestration service sends {"query":"...","max_results":5} and receives {"results":[{"url":"https://...","title":"...","snippet":"..."}]}. The endpoint and optional bearer credential are server configuration, never request fields. The orchestration service does not fetch result URLs, follow provider redirects, or forward client authorization to the search provider.

The public API accepts a documented subset of web_search, with omitted/auto, none, required, and explicit web-search choice. Preserve ordinary function tools and namespaced function definitions. Only the generated private search function is executed by the orchestration service. Reject unsupported hosted tools, options, and stateful Responses features explicitly before dispatch.

Request lifecycle

  1. Validate request options and limits. Allocate a request-local private search name that cannot collide with client tool definitions or historical function names.
  2. Convert hosted search to a function schema and call Dynamo. Buffer each model turn so private function names never escape to clients.
  3. Execute selected searches under a request deadline, response-size cap, and maximum hosted-call count. Treat retrieved snippets as untrusted data.
  4. Append function results to the internal history and resume generation. Track output-token usage across all turns so max_output_tokens is a request budget, not a per-turn reset.
  5. Return web_search_call items for completed searches, retain client-executed function calls, and attach URL citations only for source references actually present in generated answer text. Aggregate model usage across turns.

Streaming and failures

Provide ordered Responses SSE events with one response ID and increasing sequence numbers. Search progress is emitted while work occurs. Model turns are buffered in the first implementation; final text is emitted after its turn completes. This is explicitly not token-by-token backend streaming. Emit completed search items before final answer items. Terminal errors must emit response.failed, never a successful completion, and include any already completed output.

Client disconnect cancels active upstream/provider HTTP work. Bound request body, provider response, model response, search count, and total elapsed time. Provider errors must be sanitized so credentials, URLs containing credentials, and response bodies do not leak. No retries that silently multiply search work.

Staged native integration

After the reference behavior is reviewed and validated with clients, move the execution loop behind a configured native frontend capability. Reuse shared protocol types for hosted output items/events. Add frontend-crates changes only where types, rendering, or parsing need a demonstrated extension. Native integration must retain request cancellation, metrics, tracing, and token budgets across model turns. It requires separate implementation review and is not claimed by the orchestration service PR.

Alternatives

  • Client-executed function search already works but requires client configuration changes and does not honor hosted web_search requests transparently.
  • Native Rust implementation immediately would couple the first provider experiment to inference lifecycle changes. The orchestration service provides an executable contract first.
  • Removing the current rejection or dropping the hosted definition would falsely imply search was performed.

Requirements and validation

  • Demonstrate hosted-only and mixed function/search requests without executing client functions.
  • Cover omitted/auto, none, required, explicit search choice, and invalid selections.
  • Verify private-name collisions, provider schema errors, bounded response bodies, provider timeouts, disconnect cancellation, and call/token budget exhaustion.
  • Verify JSON and SSE output identities, event order, aggregate usage, and citation spans, including Unicode text.
  • Run deterministic HTTP tests with scripted inference and provider services without GPU or external credentials.
  • Document setup, provider contract, supported subset, buffered streaming, and limitations. Real-provider validation requires operator-supplied provider configuration.

References

The source requirements are the existing public issue and the request to implement hosted search. No internal requirements document was supplied.