Repository navigation
feat(ai-harness): routing.handoffTool can return undefined for the built-in tool - #2285
Conversation
🦋 Changeset detectedLatest commit: 890a5fe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ci: Version Packages
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many --targets=test:coverage --projects=... |
❌ Failed | 6m 14s | View ↗ |
nx affected --targets=test:sherif,test:knip,tes... |
✅ Succeeded | 7m 10s | View ↗ |
nx run-many --targets=build --exclude=examples/... |
✅ Succeeded | 1m 12s | View ↗ |
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-11-30 18:20:31 UTC
@tanstack/ai
@tanstack/ai-acp
@tanstack/ai-angular
@tanstack/ai-anthropic
@tanstack/ai-bedrock
@tanstack/ai-byteplus
@tanstack/ai-cartesia
@tanstack/ai-claude-code
@tanstack/ai-client
@tanstack/ai-cloudflare
@tanstack/ai-code-mode
@tanstack/ai-code-mode-snippets
@tanstack/ai-codex
@tanstack/ai-cohere
@tanstack/ai-compaction
@tanstack/ai-computer-local
@tanstack/ai-computer-playwright
@tanstack/ai-computer-sandbox
@tanstack/ai-computer-use
@tanstack/ai-devtools-core
@tanstack/ai-durable-stream
@tanstack/ai-effect
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-grok-build
@tanstack/ai-groq
@tanstack/ai-harness
@tanstack/ai-harness-cli
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-daytona
@tanstack/ai-isolate-e2b
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-isolate-quickjs-bun
@tanstack/ai-llmgateway
@tanstack/ai-lovable
@tanstack/ai-mcp
@tanstack/ai-mcp-sandbox
@tanstack/ai-memory
@tanstack/ai-meshy
@tanstack/ai-mistral
@tanstack/ai-muse
@tanstack/ai-neon
@tanstack/ai-octane
@tanstack/ai-ollama
@tanstack/ai-ollaya
@tanstack/ai-openai
@tanstack/ai-opencode
@tanstack/ai-openrouter
@tanstack/ai-optimize
@tanstack/ai-perplexity
@tanstack/ai-persistence
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-reactor
@tanstack/ai-remix
@tanstack/ai-sandbox
@tanstack/ai-sandbox-blaxel
@tanstack/ai-sandbox-boxd
@tanstack/ai-sandbox-cloudflare
@tanstack/ai-sandbox-daytona
@tanstack/ai-sandbox-docker
@tanstack/ai-sandbox-e2b
@tanstack/ai-sandbox-local-process
@tanstack/ai-sandbox-railway
@tanstack/ai-sandbox-sprites
@tanstack/ai-sandbox-upstash-box
@tanstack/ai-sandbox-vercel
@tanstack/ai-skills
@tanstack/ai-solid
@tanstack/ai-svelte
@tanstack/ai-tripo
@tanstack/ai-typesafe
@tanstack/ai-uthana
@tanstack/ai-utils
@tanstack/ai-vercel-compat
@tanstack/ai-vercel-gateway
@tanstack/ai-vertex
@tanstack/ai-vue
@tanstack/ai-worldlabs
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
@tanstack/svelte-ai-devtools
commit: |

🎯 Changes
routing.handoffToolis called for every speaker, the main model (from === null) included. An app that wants a custom tool for only some root agents still has to return a tool for the others.defaultHandoffToolis not exported, so the app has to copy the built-in tool, and the copy can drift from it.HandoffController.tool()already falls back:this.options.handoffTool?.(ctx) ?? defaultHandoffTool(ctx). This PR lets the types allow it:handoffToolreturnsAnyTool | undefinedindefine.tsandhandoff.ts.undefinedgives that speaker the built-inhandofftool.docs/harness/handoffs.mdsay so.The alternative is to export
defaultHandoffTool, so a factory can call it. Happy to switch if you prefer that.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Test plan
packages/ai-harness/tests/handoff-tool.test.ts, "gives a speaker the default handoff tool when the factory returns undefined": the factory returnsundefinedforfrom === nulland atransfertool for a root agent. The main model getshandoff, and its call records a handoff. The root agent getstransfer. Without the type change,tscrejects the factory.ai-harnesssuite passes (2587 tests).tsc,oxlint, andoxfmtare clean on the changed files.Summary by CodeRabbit