Skip to content

Commit b8c6ed5

Browse files
committed
fix(orchestrator): Improve workflow guidance to encourage proper task completion
**Problem:** Workflow guidance was too aggressive in pushing agents to respond immediately after receiving tool results. Old guidance said "If the tool results contain enough information → RESPOND to the user NOW" which caused agents (especially Claude) to give quick summaries instead of properly analyzing data to complete the user's specific request. **Example Failure:** User: "Fetch all comments and summarize issues/requests" Claude: Fetches data ✅, sees "respond NOW", gives page summary ❌ Missing: Actual extraction and organization of issues/requests **Solution:** Improved guidance to balance loop prevention with task completion: - Still prevents loops: "Do NOT repeat a tool call that already succeeded" - Adds analysis step: "ANALYZE the data to address the user's specific request" - Emphasizes completion: "Complete that task with the data you have" - Clarifies expectations: "Don't just summarize - extract, organize, and present" **Testing:** ⚠️ Guidance improved but Claude task quality issue persists ⚠️ Root cause likely deeper - continuing investigation in next session **Note:** This is part of ongoing work to fix Claude task completion quality. Loop bug and double alternation bugs are FULLY FIXED (commits b6c0973, f1a3d0b).
1 parent f1a3d0b commit b8c6ed5

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Sources/APIFramework/AgentOrchestrator.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,16 +1656,18 @@ public class AgentOrchestrator: ObservableObject, IterationController {
16561656
16571657
MANDATORY NEXT STEPS:
16581658
1. REVIEW what data the tools just gave you
1659-
2. If the tool results contain enough information → RESPOND to the user NOW
1660-
3. Only if the existing results are incomplete → Use a DIFFERENT tool to get different data
1659+
2. ANALYZE the data to address the user's specific request
1660+
3. If you have enough data to COMPLETE the user's request → Process it and respond
1661+
4. Only if the data is incomplete → Use DIFFERENT tools to get more information
16611662
16621663
CRITICAL RULES:
16631664
- Do NOT repeat a tool call that already succeeded
16641665
- Do NOT call the same operation on the same URL/file again
16651666
- Calling a tool twice with identical parameters gives identical results
1666-
- If you have data, USE it - don't keep fetching the same data
1667+
- ALWAYS analyze and process the data you received before responding
1668+
- Don't just summarize - extract, organize, and present what the user asked for
16671669
1668-
Process and analyze the data you already have before requesting more.
1670+
The user asked you to do something specific. Complete that task with the data you have.
16691671
"""
16701672
} else {
16711673
/// No todos, no tools - suspicious unless answering user

0 commit comments

Comments
 (0)