Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6aa6298
updated test
tim-inkeep Feb 9, 2026
a8a84ae
added changeset
tim-inkeep Feb 9, 2026
13b2858
added tests
tim-inkeep Feb 9, 2026
105396d
Merge branch 'main' into bugfix/schema-validation-user
tim-inkeep Feb 9, 2026
3743ffb
updated
tim-inkeep Feb 9, 2026
a3a069d
tupecheck
tim-inkeep Feb 9, 2026
68baa4f
Merge branch 'main' into bugfix/schema-validation-user
tim-inkeep Feb 9, 2026
0dfba21
Merge branch 'main' into bugfix/schema-validation-user
tim-inkeep Feb 10, 2026
24ce207
Merge branch 'main' into bugfix/schema-validation-user
tim-inkeep Feb 10, 2026
753cbf5
few fixes for GenericPromptEditor/GenericJsonEditor (#1904)
dimaMachina Feb 10, 2026
eda0de2
local time for traces, end date only when agent is done running in tr…
shagun-singh-inkeep Feb 10, 2026
903960a
updated tests
tim-inkeep Feb 10, 2026
1429cca
Merge branch 'main' into bugfix/schema-validation-user
tim-inkeep Feb 10, 2026
a5b019c
updated
tim-inkeep Feb 10, 2026
bc2a16b
updated tests
tim-inkeep Feb 10, 2026
6911b96
made a single transaction
tim-inkeep Feb 10, 2026
d5443b4
renamed function
tim-inkeep Feb 10, 2026
b7187e5
updated
tim-inkeep Feb 10, 2026
6a1b44d
Merge branch 'main' into bugfix/schema-validation-user
tim-inkeep Feb 10, 2026
cf8acf7
updated tool results to have the tool call id
tim-inkeep Feb 10, 2026
7032a66
added changeset
tim-inkeep Feb 10, 2026
6452c33
Merge branch 'main' into bugfix/artifact-saving-tool-ids
tim-inkeep Feb 11, 2026
4e56033
Merge branch 'main' into bugfix/artifact-saving-tool-ids
tim-inkeep Feb 11, 2026
259a9ad
address spicedb comments
omar-inkeep Feb 11, 2026
aa2ec19
updated
tim-inkeep Feb 12, 2026
a9d0248
reverted bad changes
tim-inkeep Feb 12, 2026
575bf43
removed
tim-inkeep Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/afraid-crabs-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inkeep/agents-api": patch
---

Added tool call id to tool call results
15 changes: 11 additions & 4 deletions agents-api/src/domains/run/agents/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,10 @@ export class Agent {

const parsedResult = parseEmbeddedJson(rawResult);

const enhancedResult = this.enhanceToolResultWithStructureHints(parsedResult);
const enhancedResult = this.enhanceToolResultWithStructureHints(
parsedResult,
toolCallId
);

toolSessionManager.recordToolResult(sessionId, {
toolCallId,
Expand Down Expand Up @@ -2486,14 +2489,15 @@ ${output}`;

/**
* Analyze tool result structure and add helpful path hints for artifact creation
* Also adds tool call ID to the result for easy reference
* Only adds hints when artifact components are available
*/
private enhanceToolResultWithStructureHints(result: any): any {
private enhanceToolResultWithStructureHints(result: any, toolCallId?: string): any {
if (!result) {
return result;
}

// Only add structure hints if artifact components are available
// Only add structure hints and tool call ID if artifact components are available
if (!this.artifactComponents || this.artifactComponents.length === 0) {
return result;
}
Expand Down Expand Up @@ -2696,9 +2700,10 @@ ${output}`;
const allSelectors = [...usefulSelectors, ...nestedContentPaths];
const uniqueSelectors = [...new Set(allSelectors)].slice(0, 15);

// Add structure hints to the original result (not the parsed version)
// Add structure hints and tool call ID to the original result (not the parsed version)
const enhanced = {
...result,
...(toolCallId ? { _toolCallId: toolCallId } : {}),
_structureHints: {
terminalPaths: terminalPaths, // All field paths that contain actual values
arrayPaths: arrayPaths, // All array structures found
Expand All @@ -2709,6 +2714,8 @@ ${output}`;
maxDepthFound: Math.max(...allPaths.map((p) => (p.match(/\./g) || []).length)),
totalPathsFound: allPaths.length,
artifactGuidance: {
toolCallId:
'🔧 CRITICAL: Use the _toolCallId field from this result object. This is the exact tool call ID you must use in your artifact:create tag. NEVER generate or make up a tool call ID.',
creationFirst:
'🚨 CRITICAL: Artifacts must be CREATED before they can be referenced. Use ArtifactCreate_[Type] components FIRST, then reference with Artifact components only if citing the SAME artifact again.',
baseSelector:
Expand Down