Skip to content

Commit 998a8d9

Browse files
committed
fix: access tool parameters from part.state.input instead of part.parameters
Session message ToolPart stores input in part.state.input, not part.parameters. When parameters were undefined, all tools of the same type got identical signatures, causing the deduplicator to incorrectly mark them all as duplicates.
1 parent 6ff41a8 commit 998a8d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/janitor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ export class Janitor {
109109
toolCallIds.push(normalizedId)
110110

111111
const cachedData = this.toolParametersCache.get(part.callID) || this.toolParametersCache.get(normalizedId)
112-
const parameters = cachedData?.parameters || part.parameters
112+
// Session messages store input in part.state.input, not part.parameters
113+
const parameters = cachedData?.parameters ?? part.state?.input ?? part.parameters
113114

114115
toolMetadata.set(normalizedId, {
115116
tool: part.tool,

0 commit comments

Comments
 (0)