Skip to content

fix: remove misleading @defer decorator comments#36

Merged
Josephrp merged 2 commits intoDeepCritical:devfrom
MarioAderman:fix/issue-2-remove-defer-decorator
Oct 6, 2025
Merged

fix: remove misleading @defer decorator comments#36
Josephrp merged 2 commits intoDeepCritical:devfrom
MarioAderman:fix/issue-2-remove-defer-decorator

Conversation

@MarioAderman
Copy link
Copy Markdown

Description

Removes all misleading references to non-existent @defer decorator from the codebase. Neither pydantic_ai nor pydantic_graph uses the so-called decorator. For simplicity's sake references were removed.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 📚 Documentation update

Component

  • Tool Registry
  • Bioinformatics Flow (Data Fusion)
  • Agent System
  • Documentation

Related Issues

Changes Made

  • Removed 7 misleading @defer comments from DeepResearch/src/tools/deep_agent_tools.py
  • Removed 10 misleading @defer comments from DeepResearch/src/tools/bioinformatics_tools.py
  • Removed misleading "Register Deferred Tools" code example section from README.md

Testing

  • I have tested these changes locally
  • All existing tests pass
  • I have tested with different configurations

Test Configuration

# No functional changes - only documentation/comments removed
# All tools continue to work correctly with standard Pydantic AI patterns
uv run pytest tests/ -v

Configuration Changes

  • No configuration changes

Documentation

  • Updated README
  • Added code comments

Performance Impact

  • No performance impact

Zero functional changes - only misleading documentation removed.

Breaking Changes

  • No breaking changes

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Investigation Summary

Key Finding: The @defer decorator NEVER existed in Pydantic AI (verified across all versions).

Screenshots/Output

Before

# Note: defer decorator is not available in current pydantic-ai version

# @defer - not available in current pydantic-ai version
def write_todos_tool(request: WriteTodosRequest, ctx: RunContext[DeepAgentState]):
    ...

After

def write_todos_tool(request: WriteTodosRequest, ctx: RunContext[DeepAgentState]):
    ...

Reviewer Notes

This PR only removes misleading documentation. No functional code changes were made. All tools continue to work correctly as they were already implemented using proper Pydantic AI patterns.

Removes all references to non-existent @defer decorator from codebase.
The @defer decorator never existed in Pydantic AI. Tools are correctly
implemented using standard Pydantic AI patterns.

Changes:
- Removed 16 @defer comments from tool files
- Updated README Known Issues section
- All tools continue to work correctly (no functional changes)

Fixes #2
@MarioAderman MarioAderman requested a review from Josephrp October 6, 2025 17:44
Signed-off-by: marioaderman <108372419+MarioAderman@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MarioAderman MarioAderman enabled auto-merge October 6, 2025 17:56
@Josephrp Josephrp disabled auto-merge October 6, 2025 17:56
@Josephrp Josephrp merged commit b569d74 into DeepCritical:dev Oct 6, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Pydantic-AI defer decorator not available in current version

2 participants