Skip to content
This repository was archived by the owner on Jul 12, 2026. It is now read-only.

Commit ea1c92d

Browse files
fix: Remove unused RunContext import causing runtime error
RunContext was imported but never used at runtime in get_agent(). Also updated TYPE_CHECKING import to use CallContext alias for compatibility. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent a9c8f44 commit ea1c92d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

imagine/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from imagine.services.r2 import R2Service
88

99
if TYPE_CHECKING:
10-
from pydantic_ai import RunContext
10+
from pydantic_ai import CallContext as RunContext
1111

1212
# Lazy agent initialization to avoid import errors when OPENROUTER_API_KEY is not set
1313
_agent: Any = None
@@ -156,7 +156,7 @@ def get_agent() -> Any:
156156
"""
157157
global _agent
158158
if _agent is None:
159-
from pydantic_ai import Agent, RunContext
159+
from pydantic_ai import Agent
160160

161161
_agent = Agent(
162162
'openrouter:anthropic/claude-haiku-4.5',

0 commit comments

Comments
 (0)