fix(prompt): prevent immediate BackgroundOutput polling after background task launch
Tool return values contained CTAs ("Use background_output to check") that
caused models to immediately poll instead of waiting for <system-reminder>
notifications. Unified all 5 tool return messages with explicit "Do NOT call
background_output now" guard, added pre-notification warning to BackgroundOutput
tool description, and strengthened Background Result Collection sections across
all 3 Sisyphus prompt variants (default, gpt-5-4, main) with BLOCKING
anti-pattern enforcement.
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -251,9 +251,10 @@ result = task(..., run_in_background=false) // Never wait synchronously for exp
|
||||
2. Continue only with non-overlapping work
|
||||
- If you have DIFFERENT independent work \u2192 do it now
|
||||
- Otherwise \u2192 **END YOUR RESPONSE.**
|
||||
3. System sends \`<system-reminder>\` on each task completion - then call \`background_output(task_id="...")\`
|
||||
4. Need results not yet ready? **End your response.** The notification will trigger your next turn.
|
||||
5. Cleanup: Cancel disposable tasks individually via \`background_cancel(taskId="...")\`
|
||||
3. **STOP. END YOUR RESPONSE.** The system will send \`<system-reminder>\` when tasks complete.
|
||||
4. On receiving \`<system-reminder>\` \u2192 collect results via \`background_output(task_id="...")\`
|
||||
5. **NEVER call \`background_output\` before receiving \`<system-reminder>\`.** This is a BLOCKING anti-pattern.
|
||||
6. Cleanup: Cancel disposable tasks individually via \`background_cancel(taskId="...")\`
|
||||
|
||||
${buildAntiDuplicationSection()}
|
||||
|
||||
|
||||
@@ -331,9 +331,10 @@ result = task(..., run_in_background=false) // Never wait synchronously for exp
|
||||
2. Continue only with non-overlapping work
|
||||
- If you have DIFFERENT independent work → do it now
|
||||
- Otherwise → **END YOUR RESPONSE.**
|
||||
3. System sends \`<system-reminder>\` on completion → triggers your next turn
|
||||
4. Collect via \`background_output(task_id="...")\`
|
||||
5. Cleanup: Cancel disposable tasks individually via \`background_cancel(taskId="...")\`
|
||||
3. **STOP. END YOUR RESPONSE.** The system will send \`<system-reminder>\` when tasks complete.
|
||||
4. On receiving \`<system-reminder>\` → collect results via \`background_output(task_id="...")\`
|
||||
5. **NEVER call \`background_output\` before receiving \`<system-reminder>\`.** This is a BLOCKING anti-pattern.
|
||||
6. Cleanup: Cancel disposable tasks individually via \`background_cancel(taskId="...")\`
|
||||
|
||||
${buildAntiDuplicationSection()}
|
||||
|
||||
|
||||
@@ -260,9 +260,10 @@ Background result collection:
|
||||
2. Continue only with non-overlapping work
|
||||
- If you have DIFFERENT independent work → do it now
|
||||
- Otherwise → **END YOUR RESPONSE.**
|
||||
3. System sends \`<system-reminder>\` on completion → triggers your next turn
|
||||
4. Collect via \`background_output(task_id="...")\`
|
||||
5. Cancel disposable tasks individually via \`background_cancel(taskId="...")\`
|
||||
3. **STOP. END YOUR RESPONSE.** The system will send \`<system-reminder>\` when tasks complete.
|
||||
4. On receiving \`<system-reminder>\` → collect results via \`background_output(task_id="...")\`
|
||||
5. **NEVER call \`background_output\` before receiving \`<system-reminder>\`.** This is a BLOCKING anti-pattern.
|
||||
6. Cancel disposable tasks individually via \`background_cancel(taskId="...")\`
|
||||
|
||||
${buildAntiDuplicationSection()}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ export const BACKGROUND_TASK_DESCRIPTION = `Run agent task in background. Return
|
||||
|
||||
Use \`background_output\` to get results. Prompts MUST be in English.`
|
||||
|
||||
export const BACKGROUND_OUTPUT_DESCRIPTION = `Get output from background task. Use full_session=true to fetch session messages with filters. System notifies on completion, so block=true rarely needed. - Timeout values are in milliseconds (ms), NOT seconds.`
|
||||
export const BACKGROUND_OUTPUT_DESCRIPTION = `Get output from background task. Use full_session=true to fetch session messages with filters. System notifies on completion, so block=true rarely needed. - Timeout values are in milliseconds (ms), NOT seconds.
|
||||
|
||||
IMPORTANT: ONLY call this tool AFTER receiving a <system-reminder> notification for the task. Do NOT call immediately after launching a background task - wait for the notification first.`
|
||||
|
||||
export const BACKGROUND_CANCEL_DESCRIPTION = `Cancel running background task(s). Use all=true to cancel ALL before final answer.`
|
||||
|
||||
@@ -114,10 +114,9 @@ Description: ${task.description}
|
||||
Agent: ${task.agent}
|
||||
Status: ${task.status}
|
||||
|
||||
The system will notify you when the task completes.
|
||||
Use \`background_output\` tool with task_id="${task.id}" to check progress:
|
||||
- block=false (default): Check status immediately - returns full status info
|
||||
- block=true: Wait for completion (rarely needed since system notifies)`
|
||||
System notifies on completion. Use \`background_output\` with task_id="${task.id}" to check.
|
||||
|
||||
Do NOT call background_output now. Wait for <system-reminder> notification first.`
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error)
|
||||
return `[ERROR] Failed to launch background task: ${message}`
|
||||
|
||||
@@ -81,10 +81,9 @@ Description: ${task.description}
|
||||
Agent: ${task.agent} (subagent)
|
||||
Status: ${task.status}
|
||||
|
||||
The system will notify you when the task completes.
|
||||
Use \`background_output\` tool with task_id="${task.id}" to check progress:
|
||||
- block=false (default): Check status immediately - returns full status info
|
||||
- block=true: Wait for completion (rarely needed since system notifies)`
|
||||
System notifies on completion. Use \`background_output\` with task_id="${task.id}" to check.
|
||||
|
||||
Do NOT call background_output now. Wait for <system-reminder> notification first.`
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error)
|
||||
return `Failed to launch background agent task: ${message}`
|
||||
|
||||
@@ -88,10 +88,9 @@ Description: ${task.description}
|
||||
Agent: ${task.agent} (subagent)
|
||||
Status: ${task.status}
|
||||
|
||||
The system will notify you when the task completes.
|
||||
Use \`background_output\` tool with task_id="${task.id}" to check progress:
|
||||
- block=false (default): Check status immediately - returns full status info
|
||||
- block=true: Wait for completion (rarely needed since system notifies)`
|
||||
System notifies on completion. Use \`background_output\` with task_id="${task.id}" to check.
|
||||
|
||||
Do NOT call background_output now. Wait for <system-reminder> notification first.`
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error)
|
||||
return `Failed to launch background agent task: ${message}`
|
||||
|
||||
@@ -51,7 +51,9 @@ Agent: ${task.agent}
|
||||
Status: ${task.status}
|
||||
|
||||
Agent continues with full previous context preserved.
|
||||
Use \`background_output\` with task_id="${task.id}" to check progress.
|
||||
System notifies on completion. Use \`background_output\` with task_id="${task.id}" to check.
|
||||
|
||||
Do NOT call background_output now. Wait for <system-reminder> notification first.
|
||||
|
||||
<task_metadata>
|
||||
session_id: ${task.sessionID}
|
||||
|
||||
@@ -149,7 +149,9 @@ Description: ${task.description}
|
||||
Agent: ${task.agent}${args.category ? ` (category: ${args.category})` : ""}
|
||||
Status: ${task.status}
|
||||
|
||||
System notifies on completion. Use \`background_output\` with task_id="${task.id}" to check.${taskMetadataBlock}`
|
||||
System notifies on completion. Use \`background_output\` with task_id="${task.id}" to check.
|
||||
|
||||
Do NOT call background_output now. Wait for <system-reminder> notification first.${taskMetadataBlock}`
|
||||
} catch (error) {
|
||||
return formatDetailedError(error, {
|
||||
operation: "Launch background task",
|
||||
|
||||
Reference in New Issue
Block a user