- Detection: After the agent finishes (or during activity polling), Polpo checks the agent’s latest output for questions
- Classification: An LLM determines if the output is a genuine question or just rhetorical
- Answer generation: The LLM generates an answer using project context (memory, task description, related tasks)
- 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
Configuration
maxQuestionRounds, the task continues without further Q&A to prevent infinite loops.
Events
| Event | Payload | When |
|---|---|---|
task:question | { taskId, question } | Question detected |
task:answered | { taskId, question, answer } | Answer generated |
Phase Tracking
During Q&A, the task phase isclarification:
questionRounds counter on the task tracks how many Q&A rounds have occurred.
Example Flow
Question detection only runs during the
execution and fix phases. During review, agent output is treated as task completion, not a question.