We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 276eb29 commit a4fed4fCopy full SHA for a4fed4f
packages/agents-core/src/run.ts
@@ -1164,11 +1164,12 @@ export class Runner extends RunHooks<any, AgentOutputType<unknown>> {
1164
}
1165
1166
if (result.state._currentStep.type === 'next_step_final_output') {
1167
- await saveStreamResultToSession(options.session, result);
1168
await this.#runOutputGuardrails(
1169
result.state,
1170
result.state._currentStep.output,
1171
);
+ // Guardrails must succeed before persisting session memory to avoid storing blocked outputs.
1172
+ await saveStreamResultToSession(options.session, result);
1173
this.emit(
1174
'agent_end',
1175
result.state._context,
0 commit comments