fix: only count final-phase output as visible for handoff decisions
Progress messages (phase: 'progress') were setting sawVisibleOutput=true, which blocked failover handoffs when Claude usage was exhausted. Now only final-phase output counts as visible, allowing reviewer handoff to codex even after progress messages were shown.
This commit is contained in:
@@ -534,7 +534,16 @@ export async function runAgentForGroup(
|
|||||||
if (!evaluation.shouldForwardOutput) {
|
if (!evaluation.shouldForwardOutput) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof outputText === 'string' && outputText.length > 0) {
|
// Only count final-phase output as "visible" for handoff decisions.
|
||||||
|
// Progress messages (phase: 'progress') should not block failover
|
||||||
|
// handoffs — they don't represent meaningful completed work.
|
||||||
|
const isFinalPhase =
|
||||||
|
output.phase === undefined || output.phase === 'final';
|
||||||
|
if (
|
||||||
|
isFinalPhase &&
|
||||||
|
typeof outputText === 'string' &&
|
||||||
|
outputText.length > 0
|
||||||
|
) {
|
||||||
streamedState = {
|
streamedState = {
|
||||||
...evaluation.state,
|
...evaluation.state,
|
||||||
sawVisibleOutput: true,
|
sawVisibleOutput: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user