refactor(agent-manager): add error logging for agent prompt refusal

This commit is contained in:
Mohamed Boudra
2025-10-26 09:52:43 +01:00
parent fdaf403f13
commit 7fee9d4dc4
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -224,7 +224,7 @@
"sessionId": "9f844826-2c8e-414f-a236-a9279233b053"
},
"createdAt": "2025-10-26T08:32:55.726Z",
"lastActivityAt": "2025-10-26T08:37:47.226Z",
"lastActivityAt": "2025-10-26T08:43:50.999Z",
"cwd": "/Users/moboudra/dev/voice-dev"
}
]
@@ -417,6 +417,10 @@ export class AgentManager {
stopReason: response.stopReason,
};
} else if (response.stopReason === "refusal") {
console.error(
`[Agent ${agentId}] Agent refused to process the prompt`,
response
);
agent.state = {
type: "failed",
lastError: "Agent refused to process the prompt",