#10975: fix: add missing clientTools parameter to runEmbeddedAttempt call
agents
Cluster:
Error Handling in Agent Tools
#### Summary
Passes the `clientTools` parameter through to `runEmbeddedAttempt`, enabling client-defined tools in the gateway's OpenResponses `/v1/responses` endpoint.
#### Repro Steps
1. Send a request to `/v1/responses` with `tools` array containing client-defined tools
2. Observe that the model never receives or calls those tools
#### Root Cause
The `clientTools` parameter flows through the request chain but was missing in one handoff:
- `openresponses-http.ts:460` extracts `clientTools` from payload ✓
- `agentCommand` passes it to `runEmbeddedPiAgent` ✓
- `runEmbeddedPiAgent` was **not** forwarding it to `runEmbeddedAttempt` ✗
The output handler for client tool calls already exists (run.ts:687-698), but the input was never wired.
#### Behavior Changes
- Client-defined tools in `/v1/responses` requests now reach the inference provider
- No breaking changes
#### Codebase and GitHub Search
- Found related issue #9635 discussing clientTools in voice-call plugin context
- Traced full flow from endpoint to provider to identify the gap
#### Tests
- `pnpm build`: pass
- `pnpm lint` (changed file): pass
- CI will run full test suite
lobster-biscuit
**Sign-Off**
- Models used: Claude Opus 4.5
- Submitter effort: AI-assisted, fix path validated by tracing request flow
- Agent notes: One-line fix at run.ts:356
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Fixes a missing parameter handoff so `clientTools` from OpenResponses `/v1/responses` requests are forwarded into the embedded PI runner’s `runEmbeddedAttempt` call.
- This enables client-defined (hosted) tools to be included in the agent session’s `customTools` set, allowing the model to call them.
- Change is localized to `src/agents/pi-embedded-runner/run.ts` and aligns with existing client tool-call output handling already present in the embedded runner.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a single-parameter forward (`clientTools`) into an already-supported downstream path (`runEmbeddedAttempt` consumes `params.clientTools`). No new behavior is introduced beyond fixing previously broken wiring, and the edit is local with no apparent side effects.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#9339: fix: enhance OpenAI compatibility for tool calling
by 0xrushi · 2026-02-05
79.9%
#11854: fix: resolve per-agent tools.exec config in pi-tools
by Yida-Dev · 2026-02-08
79.3%
#12608: fix: sanitize client tool call IDs per provider requirements
by piyushhhxyz · 2026-02-09
78.9%
#7044: feat: Add local model tool calling support
by jokelord · 2026-02-02
78.1%
#8270: fix: support snake_case 'tool_use' in transcript repair (#8264)
by heliosarchitect · 2026-02-03
78.1%
#14368: fix: skip auth profile cooldown on format errors to prevent provide...
by koatora20 · 2026-02-12
77.9%
#14328: fix: strip incomplete tool_use blocks from errored/aborted messages...
by Kropiunig · 2026-02-12
77.7%
#3362: fix: auto-repair and retry on orphan tool_result errors
by samhotchkiss · 2026-01-28
77.2%
#9861: fix(agents): re-run tool_use/tool_result repair after limitHistoryT...
by CyberSinister · 2026-02-05
77.1%
#7525: Agents: skip errored tool calls during pairing
by justinhuangcode · 2026-02-02
77.1%