Skip to content

responses: support namespace tool calls - #8

Closed
pd95 wants to merge 4 commits into
fix/mlx-external-reconfigurefrom
feature/responses-namespace-tools-upstream
Closed

pd95 wants to merge 4 commits into
fix/mlx-external-reconfigurefrom
feature/responses-namespace-tools-upstream

Conversation

@pd95

@pd95 pd95 commented May 22, 2026

Copy link
Copy Markdown
Owner

Motivation

The Responses API can group tools under a namespace and represents the
namespace and function name as separate fields. Ollama's internal chat API has
only a flat function name. Passing namespaced tools through without an
injective mapping either loses the namespace on output or makes two children
with the same name ambiguous.

That prevents clients using namespaced tool collections from reliably
round-tripping calls through Ollama's /v1/responses endpoint, especially when
static tools, deferred tool search, prior history, and streamed output are used
together.

What this changes

  • maps every external (namespace, name) pair to a unique internal name;
  • restores the exact namespace and child name on Responses output;
  • applies the same resolver to streaming, non-streaming, and tool-call history;
  • preserves explicit flat tools when an internal name would otherwise collide;
  • canonicalizes unqualified aliases instead of selecting an ambiguous tool;
  • retains Ollama's existing deferred tool-search behavior.

Dependency and scope

This PR is layered after the MLX build fix but is otherwise a standalone
Responses API change with no model-runtime dependency.

Compare:
fix/mlx-external-reconfigure...feature/responses-namespace-tools-upstream

It transports namespace identity only. It does not add custom/freeform tools,
execute tools, or change cached-token accounting.

Validation

Namespace collision, round-trip, tool-search, history, and literal streaming
and non-streaming middleware tests pass. The integrated Linux test/lint/build
and Darwin MLX build gates also pass.

Refresh and AI assistance

Adapted onto Ollama v0.34.0; head
c53c2ebe046e20eec8271b50ab727234ddab1efa. Codex materially assisted the
implementation review, tests, refresh validation, and this PR description.

@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from 6c84ab2 to cd9d5f2 Compare June 14, 2026 12:02
@pd95
pd95 marked this pull request as draft June 14, 2026 15:04
@pd95 pd95 closed this Jun 14, 2026
@pd95 pd95 reopened this Jun 14, 2026
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from cd9d5f2 to eb608e4 Compare June 22, 2026 19:59
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from eb608e4 to cbb9112 Compare July 8, 2026 12:30
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from cbb9112 to 079c0cf Compare August 8, 2026 17:37
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch 2 times, most recently from 12bff25 to a962d6a Compare August 14, 2026 21:08
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch 2 times, most recently from 507808d to fbeb2c0 Compare August 28, 2026 14:46
@pd95
pd95 changed the base branch from main to fix/mlx-external-reconfigure August 28, 2026 14:50
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from fbeb2c0 to 15b572c Compare August 31, 2026 05:38
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from 15b572c to 3c05eb9 Compare September 5, 2026 09:33
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from 3c05eb9 to c53c2eb Compare September 14, 2026 06:09
@pd95
pd95 removed this pull request from stack #26 September 14, 2026 18:24
@pd95
pd95 added this pull request to stack #27 September 14, 2026 18:24
pd95 and others added 4 commits September 17, 2026 21:19
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@pd95
pd95 force-pushed the feature/responses-namespace-tools-upstream branch from c53c2eb to 3a78148 Compare September 18, 2026 12:17
@pd95

pd95 commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

Closing because GitHub prevents retargeting this stack-managed PR across the two new v0.34.1 Darwin build layers. A replacement follows on the same head branch.

@pd95 pd95 closed this Sep 18, 2026
@pd95

pd95 commented Sep 18, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #32.

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