fix(scheduler): forward only final agent output to chat
Scheduled tasks only suppressed phase 'progress', so intermediate preambles (e.g. "I'll run the watchdog checks.") leaked to the chat each run while the actual <internal>-wrapped result was correctly stripped. The interactive path treats intermediate/tool-activity as silent (toVisiblePhase); align the scheduler to forward only the final message, with error outputs still falling through to rotation/error handling. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@ import {
|
||||
suspendTask,
|
||||
} from './task-suspension.js';
|
||||
import { getTaskQueueJid, isGitHubCiTask } from './task-watch-status.js';
|
||||
import { ScheduledTask } from './types.js';
|
||||
import { normalizeAgentOutputPhase, ScheduledTask } from './types.js';
|
||||
import { resolveGroupIpcPath } from './group-folder.js';
|
||||
import { schedulePairedFollowUpOnce } from './paired-follow-up-scheduler.js';
|
||||
import {
|
||||
@@ -216,7 +216,16 @@ async function runTask(
|
||||
outputText,
|
||||
evaluation,
|
||||
}) => {
|
||||
if (streamedOutput.phase === 'progress') {
|
||||
// Only the agent's final message should reach the chat. Progress,
|
||||
// intermediate (e.g. a preamble like "I'll run the watchdog
|
||||
// checks."), and tool-activity outputs are silent in the
|
||||
// interactive path (see toVisiblePhase); the scheduler must honor
|
||||
// the same contract. Errors still fall through so rotation/error
|
||||
// handling below can run.
|
||||
if (
|
||||
streamedOutput.status !== 'error' &&
|
||||
normalizeAgentOutputPhase(streamedOutput.phase) !== 'final'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user