mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-10-12 13:45:07 +00:00
Keep shadow-test failures from retrying successful production work
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
@@ -58,7 +58,14 @@ export async function optimizeAndRoute(
|
||||
|
||||
// Background Self-Learning: Asynchronously test the output
|
||||
// against a cheaper model to see if we can optimize later.
|
||||
shadowTestAgainstAlternative(serviceTask, result, getCheapestProvider(providers));
|
||||
// Shadow failures must not enter the production retry/circuit-breaker path.
|
||||
// Deferring the call also captures synchronous adapter failures.
|
||||
void Promise.resolve()
|
||||
.then(() => shadowTestAgainstAlternative(
|
||||
serviceTask, result, getCheapestProvider(providers)))
|
||||
.catch((error) => {
|
||||
console.error('Shadow evaluation failed', error);
|
||||
});
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user