fix(agents): update deprecated pydantic-ai parameter#908
fix(agents): update deprecated pydantic-ai parameter#908steveant wants to merge 1 commit intocoleam00:mainfrom
Conversation
Rename `result_type` to `output_type` in DocumentAgent to fix compatibility with pydantic-ai 1.0.x. The Agent class renamed this parameter in the 1.0 release.
WalkthroughA parameter name in the Agent instantiation within DocumentAgent is updated from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 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: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)python/src/**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
python/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (1)
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| agent = Agent( | ||
| model=self.model, | ||
| deps_type=DocumentDependencies, | ||
| result_type=DocumentOperation, | ||
| output_type=DocumentOperation, |
There was a problem hiding this comment.
Document agent ctor incompatible with pinned pydantic-ai
The document agent now calls Agent(..., output_type=DocumentOperation, ...), but python/uv.lock still pins pydantic-ai at 0.0.55 (python/uv.lock lines 2125-2133). In that version the Agent constructor expects result_type; output_type is not a recognized keyword, so _create_agent will raise TypeError and the document agent cannot start unless the dependency is upgraded to ≥1.0 or the old parameter is kept.
Useful? React with 👍 / 👎.
|
Superseded by #928 which consolidates this fix along with other improvements. |
…#908) * Fix: graph nodes not clickable and logs not filtered by selected node (#897) Graph nodes had no selection infrastructure — elementsSelectable was false, WorkflowDagViewer had no onNodeClick/selectedNodeId props, and WorkflowLogs showed unfiltered tool events regardless of the selected node. Tool call cards also remained spinning after workflow completion when the lock_changed SSE event was missed. Changes: - ExecutionDagNode: add `selected` prop with ring-2 ring-accent-bright highlight - WorkflowDagViewer: add onNodeClick/selectedNodeId props, enable elementsSelectable, pass selected flag to node data, wire onNodeClick to ReactFlow - WorkflowExecution: pass selectedDagNode and setSelectedDagNode to WorkflowDagViewer; pass selectedNodeId to WorkflowLogs - WorkflowLogs: add selectedNodeId prop, filter toolEvents by stepName when a node is selected, update query key to re-run on node change, add safety-net finalization of in-flight SSE tool calls on isRunning → false transition Fixes #897 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: add clarifying comment for partial-key query invalidation in WorkflowLogs Documents that the 2-segment prefix key in queryClient.invalidateQueries intentionally covers all node-filtered variants (prefix match in React Query v5 covers 'all' + per-node keys), making the behavior clear to future developers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous approach (PR #908) included selectedNodeId in the React Query key, causing a cache miss flash on every node click, and only filtered tool events (not messages) — so the log view never actually changed. Replace with scroll-to-timestamp: compute each node's start time from workflow events, then smoothly scroll the message list to the first message at or after that timestamp when the user clicks a node in either the Graph or Logs tab. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…coleam00#908) * Fix: graph nodes not clickable and logs not filtered by selected node (coleam00#897) Graph nodes had no selection infrastructure — elementsSelectable was false, WorkflowDagViewer had no onNodeClick/selectedNodeId props, and WorkflowLogs showed unfiltered tool events regardless of the selected node. Tool call cards also remained spinning after workflow completion when the lock_changed SSE event was missed. Changes: - ExecutionDagNode: add `selected` prop with ring-2 ring-accent-bright highlight - WorkflowDagViewer: add onNodeClick/selectedNodeId props, enable elementsSelectable, pass selected flag to node data, wire onNodeClick to ReactFlow - WorkflowExecution: pass selectedDagNode and setSelectedDagNode to WorkflowDagViewer; pass selectedNodeId to WorkflowLogs - WorkflowLogs: add selectedNodeId prop, filter toolEvents by stepName when a node is selected, update query key to re-run on node change, add safety-net finalization of in-flight SSE tool calls on isRunning → false transition Fixes coleam00#897 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: add clarifying comment for partial-key query invalidation in WorkflowLogs Documents that the 2-segment prefix key in queryClient.invalidateQueries intentionally covers all node-filtered variants (prefix match in React Query v5 covers 'all' + per-node keys), making the behavior clear to future developers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous approach (PR coleam00#908) included selectedNodeId in the React Query key, causing a cache miss flash on every node click, and only filtered tool events (not messages) — so the log view never actually changed. Replace with scroll-to-timestamp: compute each node's start time from workflow events, then smoothly scroll the message list to the first message at or after that timestamp when the user clicks a node in either the Graph or Logs tab. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…coleam00#908) * Fix: graph nodes not clickable and logs not filtered by selected node (coleam00#897) Graph nodes had no selection infrastructure — elementsSelectable was false, WorkflowDagViewer had no onNodeClick/selectedNodeId props, and WorkflowLogs showed unfiltered tool events regardless of the selected node. Tool call cards also remained spinning after workflow completion when the lock_changed SSE event was missed. Changes: - ExecutionDagNode: add `selected` prop with ring-2 ring-accent-bright highlight - WorkflowDagViewer: add onNodeClick/selectedNodeId props, enable elementsSelectable, pass selected flag to node data, wire onNodeClick to ReactFlow - WorkflowExecution: pass selectedDagNode and setSelectedDagNode to WorkflowDagViewer; pass selectedNodeId to WorkflowLogs - WorkflowLogs: add selectedNodeId prop, filter toolEvents by stepName when a node is selected, update query key to re-run on node change, add safety-net finalization of in-flight SSE tool calls on isRunning → false transition Fixes coleam00#897 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: add clarifying comment for partial-key query invalidation in WorkflowLogs Documents that the 2-segment prefix key in queryClient.invalidateQueries intentionally covers all node-filtered variants (prefix match in React Query v5 covers 'all' + per-node keys), making the behavior clear to future developers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous approach (PR coleam00#908) included selectedNodeId in the React Query key, causing a cache miss flash on every node click, and only filtered tool events (not messages) — so the log view never actually changed. Replace with scroll-to-timestamp: compute each node's start time from workflow events, then smoothly scroll the message list to the first message at or after that timestamp when the user clicks a node in either the Graph or Logs tab. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Updates
result_typetooutput_typeinDocumentAgentfor compatibility with pydantic-ai 1.0.x.Problem
The
Agentclass in pydantic-ai renamed theresult_typeparameter tooutput_typein version 1.0. This causes the document agent to fail initialization:Solution
Single-line fix renaming the parameter.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.