Reclassifying Capacity Exhaustion as Terminal Error (#28716)

This commit is contained in:
luisfelipe-alt
2026-08-06 18:17:36 -07:00
committed by GitHub
parent d5c9a97dc0
commit 2139b121bc
5 changed files with 128 additions and 34 deletions
+5 -3
View File
@@ -131,9 +131,11 @@ export class Task {
this.autoExecute = autoExecute;
this.config.setFallbackModelHandler(
// For a2a-server, we want to automatically switch to the fallback model
// and retry the current request seamlessly. The 'retry_always' intent
// achieves this, ensuring a smooth fallback experience for the user.
async () => 'retry_always',
// for future requests without retrying the current one.
async (failedModel, fallbackModel) => {
this.config.activateFallbackMode(fallbackModel, failedModel);
return 'stop';
},
);
}