Skip to content

Standardize strict type hints for context managers and settings #305

@rayrishu19-wq

Description

@rayrishu19-wq

Consistent and strict type hints improve maintainability, IDE autocompletion, and static analysis accuracy.

This issue proposes to:

  • Add explicit type hints to __aexit__ methods (currently untyped in core/rate_limit.py).
    • Add return type hints to lifespan and other @asynccontextmanager methods (e.g., in api/app.py and messaging/trees/data.py).
      • Tighten type hints for configuration validators in config/settings.py to avoid Any where possible.
        • Improve Ollama base URL validation error message for better clarity.
          While the current ty check may pass without these, adding them ensures the codebase adheres to the strict engineering standards mentioned in AGENTS.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions