Conversation
…k handling and retry logic
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR enhances command execution resilience by refactoring streaming output handling for both summarize and ask flows. New text-extraction utilities normalize MCP/LangChain stream item formats, updated execute methods coerce results to required schemas, and explicit retry/fallback logic handles empty or invalid structured responses by retrying without schema or invoking the LLM directly. ChangesCommand Execution Resilience
Sequence DiagramsequenceDiagram
participant Agent
participant TextExtraction
participant Coercion
participant LLM
Agent->>TextExtraction: stream items
TextExtraction->>Coercion: extracted text
Coercion->>Coercion: normalize to schema
alt normalization succeeds
Coercion-->>Agent: return result
else normalization empty/invalid
Agent->>Agent: retry via agent.run (no schema)
alt retry succeeds
Agent-->>Coercion: return result
else retry empty
Agent->>LLM: ainvoke fallback prompt
LLM->>Coercion: coerce LLM response
Coercion-->>Agent: return result
end
end
🎯 3 (Moderate) | ⏱️ ~20 minutes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…k handling and retry logic
Summary by CodeRabbit