Ensure Anthropic fallback request processor keeps app state#608
Conversation
WalkthroughAdds app_state to RequestProcessor construction in the Anthropic controller. Introduces a unit test verifying DI fallback constructs a RequestProcessor with ApplicationStateService when IRequestProcessor is absent. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Test as Test
participant DI as ServiceProvider
participant C as AnthropicController
participant RP as RequestProcessor
participant AS as ApplicationStateService
Test->>DI: get_anthropic_controller()
note right of DI: IRequestProcessor not registered
DI-->>C: AnthropicController (constructed)
C->>DI: Resolve dependencies
DI-->>AS: ApplicationStateService
C->>RP: new RequestProcessor(app_state=AS)
note over C,RP: Fallback path wires app_state
Test-->>C: Assertions on internal RP.app_state
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (2)src/core/app/controllers/anthropic_controller.py (1)
tests/unit/anthropic_frontend_tests/test_anthropic_controller_di_fallback.py (3)
🪛 Ruff (0.13.3)tests/unit/anthropic_frontend_tests/test_anthropic_controller_di_fallback.py38-38: Unused method argument: (ARG002) 50-50: Unused method argument: (ARG002) 52-52: Unused method argument: (ARG002) 53-53: Unused method argument: (ARG002) 64-64: Unused method argument: (ARG002) 64-64: Unused method argument: (ARG002) 73-73: Unused method argument: (ARG002) 74-74: Unused method argument: (ARG002) 79-79: Unused method argument: (ARG002) 88-88: Unused method argument: (ARG002) 88-88: Unused method argument: (ARG002) 100-100: Unused method argument: (ARG002) 101-101: Unused method argument: (ARG002) 102-102: Unused method argument: (ARG002) 103-103: Unused method argument: (ARG002) 104-104: Unused method argument: (ARG002) 105-105: Unused method argument: (ARG002) 112-112: Unused method argument: (ARG002) 113-113: Unused method argument: (ARG002) 114-114: Unused method argument: (ARG002) 115-115: Unused method argument: (ARG002) 116-116: Unused method argument: (ARG002) 117-117: Unused method argument: (ARG002) 124-124: Unused method argument: (ARG002) 125-125: Unused method argument: (ARG002) 126-126: Unused method argument: (ARG002) 127-127: Unused method argument: (ARG002) 128-128: Unused method argument: (ARG002) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (5)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
✅ APPROVED This PR successfully fixes the DI issue in the Anthropic controller's fallback RequestProcessor path. Review Findings:
The fix adds the missing parameter when creating RequestProcessor in the fallback path, preventing potential issues where the fallback processor wouldn't have access to application state. Safe to merge. 🚀 |
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68ec24c75d088333bc0d3e5950ad0e4f
Summary by CodeRabbit