Skip to main content
Sometimes agents ask clarifying questions instead of completing the task. Without intervention, the task stalls — the agent is waiting for input that never comes. Polpo detects when an agent’s output contains a question and auto-generates an answer:
  1. Detection: After the agent finishes (or during activity polling), Polpo checks the agent’s latest output for questions
  2. Classification: An LLM determines if the output is a genuine question or just rhetorical
  3. Answer generation: The LLM generates an answer using project context (memory, task description, related tasks)
  4. Injection: The answer is sent to the agent, and execution continues

Detection Methods

Polpo uses two detection approaches:

Heuristic Detection

Fast pattern matching for common question patterns:
  • Ends with ?
  • Contains phrases like “should I”, “would you like”, “which approach”
  • Agent explicitly asks for clarification

LLM Classification

When heuristics are ambiguous, Polpo classifies the output:
  • Question: Genuine request for information → generate answer
  • Rhetorical: Agent is thinking out loud → no action needed
  • Completion: Agent is done → proceed to assessment

Auto-Answer

When a question is detected, Polpo generates an answer using:
  • Task description: What the agent was asked to do
  • Project memory: Persistent context from .polpo/memory.md
  • Related tasks: Other tasks in the same mission group
  • Agent role: The agent’s configured role and expertise
The answer aims to be decisive — it makes concrete choices rather than saying “it depends”.

Configuration

{
  "settings": {
    "maxQuestionRounds": 2
  }
}
After maxQuestionRounds, the task continues without further Q&A to prevent infinite loops.

Events

EventPayloadWhen
task:question{ taskId, question }Question detected
task:answered{ taskId, question, answer }Answer generated

Phase Tracking

During Q&A, the task phase is clarification:
Question detection phase flow: execution → clarification → execution → review
The questionRounds counter on the task tracks how many Q&A rounds have occurred.

Example Flow

Question detection example: agent asks about JWT vs sessions, Polpo generates contextual answer, agent continues
Question detection only runs during the execution and fix phases. During review, agent output is treated as task completion, not a question.