feat(smartagent): record native tool results in message history by adding optional toolName to continueWithNativeTools and passing tool identifier from DualAgent
This commit is contained in:
@@ -495,7 +495,8 @@ Please output the exact XML format above.`
|
||||
|
||||
// Continue with appropriate method based on mode
|
||||
if (useNativeTools) {
|
||||
const continueResult = await this.driver.continueWithNativeTools(resultMessage);
|
||||
const toolNameForHistory = `${proposal.toolName}_${proposal.action}`;
|
||||
const continueResult = await this.driver.continueWithNativeTools(resultMessage, toolNameForHistory);
|
||||
driverResponse = continueResult.message;
|
||||
pendingNativeToolCalls = continueResult.toolCalls;
|
||||
} else {
|
||||
@@ -505,8 +506,10 @@ Please output the exact XML format above.`
|
||||
} catch (error) {
|
||||
const errorMessage = `Tool execution failed: ${error instanceof Error ? error.message : String(error)}`;
|
||||
if (useNativeTools) {
|
||||
const toolNameForHistory = `${proposal.toolName}_${proposal.action}`;
|
||||
const continueResult = await this.driver.continueWithNativeTools(
|
||||
`TOOL ERROR: ${errorMessage}\n\nPlease try a different approach.`
|
||||
`TOOL ERROR: ${errorMessage}\n\nPlease try a different approach.`,
|
||||
toolNameForHistory
|
||||
);
|
||||
driverResponse = continueResult.message;
|
||||
pendingNativeToolCalls = continueResult.toolCalls;
|
||||
|
||||
Reference in New Issue
Block a user