Summary
Two-phase issue optimization: LLM analyzes and suggests improvements, human approves via label, system applies suggestions using the Formatter (#1).
Reference
📋 Proposal Document: langchain-issue-intake-proposal.md - See Enhancement #4
Design Philosophy
Eliminates complex stateful conversation in favor of a simple two-phase flow that reuses the Formatter (#478).
Flow
Phase 1: Human labels issue with `agents:optimize`
→ LLM analyzes, posts comment with suggestions + embedded JSON
→ Human reviews suggestions
Phase 2: Human adds `agents:apply-suggestions` label
→ System extracts JSON from comment
→ Routes to Formatter (#1) with suggestions
→ Updates issue body
→ Removes labels, adds `agents:formatted`
Why Hybrid Over Multi-Turn Conversation
| Aspect |
Original |
Hybrid |
| State management |
LangGraph state machine |
Stateless - JSON in comment |
| Human approval |
Implicit conversation |
Explicit label signal |
| Implementation |
Custom handler |
Reuses Formatter (#1) |
| Complexity |
5-7 days |
2-3 days |
Tasks
Acceptance Criteria
Implementation Notes
Priority: P1 | Effort: 2-3 days
Summary
Two-phase issue optimization: LLM analyzes and suggests improvements, human approves via label, system applies suggestions using the Formatter (#1).
Reference
📋 Proposal Document: langchain-issue-intake-proposal.md - See Enhancement #4
Design Philosophy
Eliminates complex stateful conversation in favor of a simple two-phase flow that reuses the Formatter (#478).
Flow
Why Hybrid Over Multi-Turn Conversation
Tasks
scripts/langchain/issue_optimizer.pywith analyzer chainANALYZE_ISSUE_PROMPTwith agent limitations contextagents:optimizelabel (Phase 1)agents:apply-suggestionslabel (Phase 2)Acceptance Criteria
agents:optimizetriggers analysis comment with structured suggestions<- Updated WORKFLOW_OUTPUTS.md suggestions-json: {...} -->markeragents:apply-suggestionsextracts JSON and calls FormatterImplementation Notes
Priority: P1 | Effort: 2-3 days