Skip to content

fix(task): rewrite main-session gate prompt to prevent self-answering#1738

Merged
yanyihan-xiaomi merged 1 commit into
mainfrom
fix/task-gate-prompt
Jul 15, 2026
Merged

fix(task): rewrite main-session gate prompt to prevent self-answering#1738
yanyihan-xiaomi merged 1 commit into
mainfrom
fix/task-gate-prompt

Conversation

@yanyihan-xiaomi

@yanyihan-xiaomi yanyihan-xiaomi commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Rewrite task gate's main-session reentry prompt from "complete the work then continue or respond" to a structured decision tree that prevents the model from self-answering
  • Offer question tool as the primary exit path when user input is needed
  • Add explicit negative constraints: "Do NOT answer your own questions or assume user intent"

Problem

When the model's turn is classified as "final" with open/in_progress tasks, the task gate injects a synthetic user message. The old prompt said:

For EACH: complete the work then `task done <id> <summary>`, or `task abandon <id> <reason>` if it is genuinely not needed.
Then continue or respond.

This caused the model to, after asking the user a question:

  1. Receive the gate nudge saying "complete the work"
  2. Answer its own question ("I'll just fix the core logic")
  3. Start implementing, ignoring that the user never responded

Solution

Replace the main-session gate prompt with a structured decision tree:

  1. Need user input → use question tool (supports choices, free-text via empty options, recommendations)
  2. Work incomplete, no user input needed → continue working, then task done
  3. Already complete → task done
  4. Blocked externally → task block
  5. No longer needed → task abandon

When the model uses the question tool, the turn is not classified as "final" (pending tool call), so the gate never re-fires.

Subagent path is unchanged.

The task gate's reentry text told the model to 'complete the work then
continue or respond', which caused it to answer its own questions and
start new implementation when it should have been waiting for user input.

Rewrite the main-session prompt to:
- Offer 'use question tool' as the primary action when user input is needed
- Keep 'continue working' as valid only when no user input is required
- Add explicit negative constraints against self-answering
- Mention question tool supports all inquiry types (choices, free-text, recommendations)
- Preserve subagent prompt unchanged (different semantics)
@yanyihan-xiaomi yanyihan-xiaomi merged commit 99511b3 into main Jul 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant