fix(agents): mark sensitive-stop payload as error with isError flag

Add isError: true to the sensitive stop_reason payload so downstream consumers (e.g. cron delivery) correctly treat it as an error. Add 'sensitive' to the error kind union type.
This commit is contained in:
MoerAI 2026-03-16 14:59:01 +09:00
parent 33316ea4be
commit 1adc05aa6a
2 changed files with 3 additions and 1 deletions

View File

@ -1320,6 +1320,7 @@ export async function runEmbeddedPiAgent(
text:
"I can't respond to that - the content was flagged by the model's safety filter. " +
"Please rephrase or try a different topic.",
isError: true,
},
],
meta: {

View File

@ -41,7 +41,8 @@ export type EmbeddedPiRunMeta = {
| "compaction_failure"
| "role_ordering"
| "image_size"
| "retry_limit";
| "retry_limit"
| "sensitive";
message: string;
};
/** Stop reason for the agent run (e.g., "completed", "tool_calls"). */