UAT: # type: ignore suppressions in providers/registry.py violate CONTRIBUTING.md code standards #3421

Closed
opened 2026-04-05 16:38:16 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/providers-registry-type-ignore-suppressions
  • Commit Message: fix(providers): remove type: ignore suppressions from registry.py and resolve underlying type errors
  • Milestone: None (Backlog)
  • Parent Epic: #3365

Background

The file src/cleveragents/providers/registry.py contains 11 instances of # type: ignore comments, which explicitly violates the CONTRIBUTING.md code standard that states: "The use of # type: ignore or any other mechanism to disable type checking is strictly forbidden."

What Was Tested

Code-level analysis of src/cleveragents/providers/registry.py.

Expected Behaviour (from CONTRIBUTING.md)

All code must be statically typed and pass nox -e typecheck (Pyright). The use of # type: ignore is strictly forbidden.

Actual Behaviour

The _create_provider_llm method and create_ai_provider method contain 11 # type: ignore suppressions:

Line Suppression Context
475 # type: ignore[arg-type] ChatOpenAI kwargs
482 # type: ignore[arg-type] ChatAnthropic kwargs
490 # type: ignore[arg-type] ChatGoogleGenerativeAI kwargs
525 # type: ignore[arg-type] AzureChatOpenAI kwargs
529 # type: ignore[import-untyped] langchain_groq import
533 # type: ignore[arg-type] ChatGroq kwargs
537 # type: ignore[import-untyped] langchain_together import
541 # type: ignore[arg-type] ChatTogether kwargs
545 # type: ignore[import-untyped] langchain_cohere import
549 # type: ignore[arg-type] ChatCohere kwargs
657 # type: ignore[arg-type] llm_factory return

Steps to Reproduce

  1. Open src/cleveragents/providers/registry.py
  2. Search for # type: ignore
  3. Observe 11 violations of the CONTRIBUTING.md code standard

Subtasks

  • Audit all 11 # type: ignore occurrences in src/cleveragents/providers/registry.py and document the root cause of each underlying Pyright error
  • Resolve import-untyped suppressions (lines 529, 537, 545) — add inline type stubs, py.typed markers, or pyrightconfig.json stubPath entries for langchain_groq, langchain_together, and langchain_cohere
  • Resolve arg-type suppressions (lines 475, 482, 490, 525, 533, 541, 549, 657) — refactor kwargs construction to use properly typed TypedDict or overloaded factory signatures so Pyright accepts the call sites without suppression
  • Verify nox -e typecheck passes with zero errors after removing all suppressions
  • Tests (Behave): confirm existing unit test scenarios still pass; add new scenarios if new typed helpers are introduced
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off
  • Zero # type: ignore comments remain in src/cleveragents/providers/registry.py
  • nox -e typecheck passes with no errors or warnings related to this file
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done
  • All nox stages pass
  • Coverage >= 97%

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/providers-registry-type-ignore-suppressions` - **Commit Message**: `fix(providers): remove type: ignore suppressions from registry.py and resolve underlying type errors` - **Milestone**: None (Backlog) - **Parent Epic**: #3365 ## Background The file `src/cleveragents/providers/registry.py` contains 11 instances of `# type: ignore` comments, which explicitly violates the CONTRIBUTING.md code standard that states: *"The use of `# type: ignore` or any other mechanism to disable type checking is strictly forbidden."* ### What Was Tested Code-level analysis of `src/cleveragents/providers/registry.py`. ### Expected Behaviour (from CONTRIBUTING.md) All code must be statically typed and pass `nox -e typecheck` (Pyright). The use of `# type: ignore` is strictly forbidden. ### Actual Behaviour The `_create_provider_llm` method and `create_ai_provider` method contain 11 `# type: ignore` suppressions: | Line | Suppression | Context | |------|-------------|---------| | 475 | `# type: ignore[arg-type]` | ChatOpenAI kwargs | | 482 | `# type: ignore[arg-type]` | ChatAnthropic kwargs | | 490 | `# type: ignore[arg-type]` | ChatGoogleGenerativeAI kwargs | | 525 | `# type: ignore[arg-type]` | AzureChatOpenAI kwargs | | 529 | `# type: ignore[import-untyped]` | langchain_groq import | | 533 | `# type: ignore[arg-type]` | ChatGroq kwargs | | 537 | `# type: ignore[import-untyped]` | langchain_together import | | 541 | `# type: ignore[arg-type]` | ChatTogether kwargs | | 545 | `# type: ignore[import-untyped]` | langchain_cohere import | | 549 | `# type: ignore[arg-type]` | ChatCohere kwargs | | 657 | `# type: ignore[arg-type]` | llm_factory return | ### Steps to Reproduce 1. Open `src/cleveragents/providers/registry.py` 2. Search for `# type: ignore` 3. Observe 11 violations of the CONTRIBUTING.md code standard ## Subtasks - [ ] Audit all 11 `# type: ignore` occurrences in `src/cleveragents/providers/registry.py` and document the root cause of each underlying Pyright error - [ ] Resolve `import-untyped` suppressions (lines 529, 537, 545) — add inline type stubs, `py.typed` markers, or `pyrightconfig.json` `stubPath` entries for `langchain_groq`, `langchain_together`, and `langchain_cohere` - [ ] Resolve `arg-type` suppressions (lines 475, 482, 490, 525, 533, 541, 549, 657) — refactor kwargs construction to use properly typed `TypedDict` or overloaded factory signatures so Pyright accepts the call sites without suppression - [ ] Verify `nox -e typecheck` passes with zero errors after removing all suppressions - [ ] Tests (Behave): confirm existing unit test scenarios still pass; add new scenarios if new typed helpers are introduced - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - [ ] All subtasks above are completed and checked off - [ ] Zero `# type: ignore` comments remain in `src/cleveragents/providers/registry.py` - [ ] `nox -e typecheck` passes with no errors or warnings related to this file - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done - All nox stages pass - Coverage >= 97% > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

PR #3459 created on branch fix/providers-registry-type-ignore-suppressions. I will monitor and handle all review feedback until merged.

Implementation summary:

  • Added type stubs for langchain_groq, langchain_together, and langchain_cohere in typings/ directory (resolves import-untyped suppressions)
  • Removed all 8 arg-type suppressions from LLM constructor call sites (unnecessary with current pyrightconfig.json settings)
  • Fixed llm_factory closure type issue by capturing narrowed ProviderType in local variable
  • nox -e typecheck → 0 errors | nox -e lint → all checks passed

Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker

PR #3459 created on branch `fix/providers-registry-type-ignore-suppressions`. I will monitor and handle all review feedback until merged. **Implementation summary:** - Added type stubs for `langchain_groq`, `langchain_together`, and `langchain_cohere` in `typings/` directory (resolves `import-untyped` suppressions) - Removed all 8 `arg-type` suppressions from LLM constructor call sites (unnecessary with current pyrightconfig.json settings) - Fixed `llm_factory` closure type issue by capturing narrowed `ProviderType` in local variable - `nox -e typecheck` → 0 errors | `nox -e lint` → all checks passed --- **Automated by CleverAgents Bot** Supervisor: Implementation | Agent: ca-issue-worker
Author
Owner

This issue is being moved to the backlog. This is a presentation bug that affects the formatting of the output when there is only one actor. The user can still see the actor's information, and the core functionality of listing actors is not broken. This is a minor issue that can be moved to the backlog.

This issue is being moved to the backlog. This is a presentation bug that affects the formatting of the output when there is only one actor. The user can still see the actor's information, and the core functionality of listing actors is not broken. This is a minor issue that can be moved to the backlog.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#3421
No description provided.