@exreve/exk 1.0.60 → 1.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/agentSession.js +7 -2
- package/dist/ttc-cli.tar.gz +0 -0
- package/package.json +1 -1
package/dist/cli/agentSession.js
CHANGED
|
@@ -1086,8 +1086,8 @@ export class AgentSessionManager {
|
|
|
1086
1086
|
// The structured result lives in tool_use_result for built-in tools.
|
|
1087
1087
|
// For MCP tools, tool_use_result is a content-block array we need to parse.
|
|
1088
1088
|
let toolResult = null;
|
|
1089
|
-
let toolUseId =
|
|
1090
|
-
// STEP 1:
|
|
1089
|
+
let toolUseId = null;
|
|
1090
|
+
// STEP 1: Extract tool_use_id from message.content (authoritative source)
|
|
1091
1091
|
if (Array.isArray(msg.message?.content)) {
|
|
1092
1092
|
const contentBlocks = msg.message.content;
|
|
1093
1093
|
const toolResultBlock = contentBlocks.find((c) => c.type === 'tool_result');
|
|
@@ -1095,6 +1095,11 @@ export class AgentSessionManager {
|
|
|
1095
1095
|
toolUseId = toolResultBlock.tool_use_id;
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
+
// STEP 1b: Fallback — use parent_tool_use_id if STEP 1 didn't find it
|
|
1099
|
+
// (subagent results where the message.content may not contain tool_result block)
|
|
1100
|
+
if (!toolUseId && msg.parent_tool_use_id) {
|
|
1101
|
+
toolUseId = msg.parent_tool_use_id;
|
|
1102
|
+
}
|
|
1098
1103
|
// STEP 2: Use tool_use_result as the primary data source.
|
|
1099
1104
|
// For built-in tools (Bash, Read, Edit, Write, Glob, Grep) it's a structured
|
|
1100
1105
|
// object like {stdout, stderr} or {type:'text', file:{...}} — use directly.
|
package/dist/ttc-cli.tar.gz
CHANGED
|
Binary file
|