fix: remove invalid mode kwarg from trace_span + add integration tests
- Remove mode=mode.value from trace_span calls (trace_span only accepts name and logger parameters) - Add TestPermissionModeIntegration tests that verify mode string->enum conversion works correctly through the full request flow - Add TestAgentMethodSignatures tests that verify function signatures match expected interfaces (catches invalid kwargs at test time) These tests would have caught both the mode string/enum issue and the trace_span invalid kwarg issue before they hit production. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -142,7 +142,7 @@ class TaskAgentImpl(BaseAgent):
|
||||
# Get agent configured for this mode
|
||||
agent = self._get_agent_for_mode(mode)
|
||||
|
||||
async with trace_span("task_agent_run", mode=mode.value):
|
||||
async with trace_span("task_agent_run"):
|
||||
try:
|
||||
result = await agent.run(prompt, deps=ctx)
|
||||
return result.output
|
||||
@@ -180,7 +180,7 @@ class TaskAgentImpl(BaseAgent):
|
||||
# Get agent configured for this mode
|
||||
agent = self._get_agent_for_mode(mode)
|
||||
|
||||
async with trace_span("task_agent_stream", mode=mode.value):
|
||||
async with trace_span("task_agent_stream"):
|
||||
try:
|
||||
async with agent.run_stream(prompt, deps=ctx) as result:
|
||||
async for chunk in result.stream_text():
|
||||
|
||||
Reference in New Issue
Block a user