Conversation
|
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 (1)
📝 WalkthroughWalkthroughAdds feedback-driven refinement: two POST endpoints (/refine and /weekly/refine) accept previous response + feedback, build initial agent state, and run new LangGraph agents (coach_refine_graph and weekly_coach_refine_graph) to produce validated refined SkillLab or WeeklyRoutine responses. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API as /refine Endpoint
participant Agent as coach_refine_graph
participant LLM1 as OpenAI (gpt-4o-mini)
participant Retriever as retrieve_drills
participant LLM2 as OpenAI (gpt-4o)
Client->>API: POST /refine (original_request + previous_response + feedback)
API->>Agent: invoke graph with initial_state
Agent->>LLM1: classify_feedback (re_retrieve | regenerate_only)
LLM1-->>Agent: feedback_type
alt feedback_type == "re_retrieve"
Agent->>Retriever: re_retrieve (update context)
Retriever-->>Agent: updated context
end
Agent->>LLM2: refine_generate (profile + previous_response + feedback + context)
LLM2-->>Agent: refined JSON
Agent->>Agent: validate JSON -> final_response
Agent-->>API: final_response
API->>Client: SuccessResponse[SkillLabResponse]
sequenceDiagram
participant Client
participant API as /weekly/refine Endpoint
participant Agent as weekly_coach_refine_graph
participant LLM1 as OpenAI (gpt-4o-mini)
participant Retriever as retrieve_drills
participant LLM2 as OpenAI (gpt-4o)
Client->>API: POST /weekly/refine (original_request + previous_response + feedback)
API->>Agent: invoke graph with initial_state (week_plan from previous_response.days)
Agent->>LLM1: classify_feedback (re_retrieve | regenerate_only)
LLM1-->>Agent: feedback_type
alt feedback_type == "re_retrieve"
Agent->>Retriever: re_retrieve (per-day drill retrieval)
Retriever-->>Agent: updated per-day context
end
Agent->>Agent: refine_generate (aggregate per-day context + available_time)
Agent->>LLM2: prompt for WeeklyRoutineResponse JSON
LLM2-->>Agent: refined weekly routine JSON
Agent->>Agent: validate JSON -> final_response
Agent-->>API: final_response
API->>Client: SuccessResponse[WeeklyRoutineResponse]
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/api/v1/endpoints/skill.py`:
- Around line 205-210: In the except asyncio.TimeoutError handler, suppress the
original exception chain by re-raising the HTTPException with "from None" so the
traceback doesn't include the TimeoutError; update the raise HTTPException(...)
in the block that catches asyncio.TimeoutError (the endpoint's timeout handler)
to use "raise HTTPException(... ) from None" referencing asyncio.TimeoutError
and HTTPException to locate the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2570895b-4f47-4631-8e89-7932c85464ca
📒 Files selected for processing (4)
src/api/v1/endpoints/skill.pysrc/models/refine_schema.pysrc/services/agents/coach_refine_agent.pysrc/services/agents/weekly_coach_refine_agent.py
어떤 변경사항인가요?
작업 상세 내용
체크리스트
관련 이슈
리뷰 포인트
참고사항 및 스크린샷(선택)
피드백 루프 그래프 구조:
classify_feedback ──조건분기──┬── re_retrieve → refine_generate → END
└─────────────→ refine_generate → END
Summary by CodeRabbit