Repository navigation
feat(ai-harness): keep routed agents' tool calls across turns, harnessAgent as a root agent, and routing.handoffTool #2145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,852
−181
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
46cd641
feat(ai-harness): keep routed agents' tool calls, root harnessAgent, …
AlemTuzlak d07a002
fix(ai-harness): pass custom handoff notes to the target and correct …
8548c7b
fix(ai-harness): stop same-turn root harnessAgent resends and duplica…
727c6c8
fix(ai-harness): fold unstamped parallel routed answers as user text …
f8c9ad1
fix(ai-harness): split BlobBody type import for oxlint
97cc34a
fix(ai-harness): fold fabricated handoff notes for every speaker in o…
16f1438
fix(ai-harness): keep a root agent's own handoff out of child turn co…
43e6445
Fix: fold unstamped hosts, pass the handoff tool name, and correct th…
tombeckenham 1ff2461
fix(ai-harness): keep routed child turns alive when parent media is m…
d63c20f
test(ai-harness): keep the root image fixture as a content part
tombeckenham 2ef4af9
test(ai-harness): treat an unreaped Linux zombie as stopped
tombeckenham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| '@tanstack/ai-harness': minor | ||
| --- | ||
|
|
||
| Routed agents now remember their own tool calls, you can pass your own handoff tool, and a `harnessAgent` can be a root agent. | ||
|
|
||
| - `routing.history` sets what each model call gets of the routed runs of earlier turns. With `'own'` (the default), a routed agent gets its own earlier runs in full, with tool calls and results. It gets the other agents and the main model as labeled text in a user message, for example `main:\n...`. The main model gets the routed answers the same way, so no model reads the words of another speaker as its own. `'all'` gives every speaker every routed run in full. `'text'` gives routed runs as text only, as before. | ||
| - `routing.handoffTool` makes the handoff tool of each speaker. It gets `from`, `targets`, `allowHuman`, and `handoff`. The tool can have any name and its own fields. | ||
| - A `harnessAgent` in `agents` with `routing` keeps one child session across turns. Each turn sends it what happened in the thread since its last turn. Its model gets the `handoff` tool, so it can hand back. | ||
|
|
||
| The default `history: 'own'` changes the messages that routed agents and handoff targets get. A target gets the turns of the main model as labeled text. To keep the earlier messages, and the prompt cache of the provider for a handoff target, set `routing: { router, history: 'text' }`. | ||
|
|
||
| An app tool with the name of the handoff tool now replaces the harness tool. Before, the turn failed with a duplicate tool error. | ||
|
|
||
| A handoff from the `handoff` tool of a root agent now adds the note messages to the thread, as a router or code handoff does. Before, the next speaker did not see that the agent handed off. On models that reject a context that ends on an assistant message (new Claude models), the main model failed after a hand-back. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identify the parent harness as the owner of
routing.“A
harnessAgentinagentswithrouting” can direct readers to configureroutingon the child harness. That configuration fails the turn. State that the parent harness hasroutingand lists theharnessAgentinagents. (raw.githubusercontent.com)