FIRE-815 | Bugfix | Reduce rogue import time on startup#55
Conversation
Summary by CodeRabbit
WalkthroughThe PR defers imports across multiple modules using TYPE_CHECKING guards and local (in-function) imports, updates type hints to string-based forward references, adds a few package-level re-exports, and adjusts GenericAgentExecutor’s flow for session resolution and part conversions. No new features; primary behavioral change is import timing and minor executor control-flow refinement. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as API Layer
participant Exec as GenericAgentExecutor
participant Sess as SessionService
participant Runner as ADK Runner
participant GenAI as GenAI SDK
Client->>API: Request (context, event_queue)
API->>Exec: execute(context, event_queue)
rect rgb(245,248,255)
note right of Exec: Lazy import GenAI types
Exec->>Sess: _upsert_session(context.session_id?)
Sess-->>Exec: session_id
end
Exec->>Exec: convert_a2a_parts_to_genai()
Exec->>Runner: run(model, content, session_id)
alt streaming updates
Runner-->>Exec: Event (update)
Exec-->>API: forward update
end
Runner-->>Exec: Event (final)
Exec->>Exec: convert_genai_parts_to_a2a()
Exec-->>API: final event
API-->>Client: Response stream
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (25)
🧰 Additional context used📓 Path-based instructions (1)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (11)rogue/ui/components/config_screen.py (2)
rogue/server/services/llm_service.py (1)
rogue/evaluator_agent/run_evaluator_agent.py (2)
rogue/ui/components/scenario_generator.py (2)
rogue/server/api/__init__.py (4)
rogue/ui/app.py (1)
rogue/ui/components/report_generator.py (2)
rogue/ui/components/interviewer.py (1)
rogue/prompt_injection_evaluator/run_prompt_injection_evaluator.py (1)
examples/tshirt_store_agent/tshirt_store_agent_executor.py (2)
rogue/common/generic_agent_executor.py (2)
🔇 Additional comments (35)
Comment |
No description provided.