BUG-HUNT: [type-safety] Type error in action_model_bench.py test setup #4151

Open
opened 2026-04-06 11:32:16 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/benchmarks/action-model-bench-constructor-args
  • Commit Message: fix(benchmarks): add missing required arguments to Action constructor in action_model_bench
  • Milestone: (none — backlog)
  • Parent Epic: #2810

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.

Bug Report: [type-safety] — Type error in action_model_bench.py test setup

Severity Assessment

  • Impact: The benchmark test for the minimal Action object is not running correctly due to a type error. This could lead to a false sense of security about the performance of minimal Action object creation.
  • Likelihood: This bug is guaranteed to trigger every time the asv benchmarks are run.
  • Priority: Low

Location

  • File: asv/benchmarks/action_model_bench.py
  • Function/Class: TimeAsCliDict.setup
  • Lines: 213-221

Description

The pyright type checker has identified a type error in the setup of the TimeAsCliDict benchmark. The Action constructor is called without several required arguments, even though those arguments have default values in the Action model definition. Pydantic's constructor requires all fields to be present, even if they have default values.

Evidence

213:         self.minimal_action = Action(
214:             namespaced_name=NamespacedName(
215:                 server=None, namespace="local", name="minimal"
216:             ),
217:             description="Minimal action",
218:             definition_of_done="Done",
219:             strategy_actor="openai/gpt-4",
220:             execution_actor="openai/gpt-4",
221:         )

pyright output:

/app/asv/benchmarks/action_model_bench.py:213:31 - error: Arguments missing for parameters "long_description", "reusable", "read_only", "state", "created_by" (reportCallIssue)

Expected Behavior

The minimal_action object should be created successfully without any type errors.

Actual Behavior

The creation of the minimal_action object fails the type check.

Suggested Fix

The Action constructor call in asv/benchmarks/action_model_bench.py should be updated to include all required arguments, even those with default values.

Category

type-safety

Subtasks

  • Inspect the Action model definition to identify all required fields and their default values
  • Update the Action constructor call in TimeAsCliDict.setup to include all required arguments (long_description, reusable, read_only, state, created_by)
  • Run nox -e typecheck to confirm the type error is resolved
  • Run nox -e benchmark (or equivalent ASV invocation) to confirm the benchmark setup executes without error

Definition of Done

  • Action constructor call in asv/benchmarks/action_model_bench.py includes all required arguments
  • nox -e typecheck passes with no errors in action_model_bench.py
  • ASV benchmark setup for TimeAsCliDict executes without runtime errors
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/benchmarks/action-model-bench-constructor-args` - **Commit Message**: `fix(benchmarks): add missing required arguments to Action constructor in action_model_bench` - **Milestone**: *(none — backlog)* - **Parent Epic**: #2810 > **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. ## Bug Report: [type-safety] — Type error in `action_model_bench.py` test setup ### Severity Assessment - **Impact**: The benchmark test for the minimal `Action` object is not running correctly due to a type error. This could lead to a false sense of security about the performance of minimal `Action` object creation. - **Likelihood**: This bug is guaranteed to trigger every time the `asv` benchmarks are run. - **Priority**: Low ### Location - **File**: `asv/benchmarks/action_model_bench.py` - **Function/Class**: `TimeAsCliDict.setup` - **Lines**: 213-221 ### Description The `pyright` type checker has identified a type error in the setup of the `TimeAsCliDict` benchmark. The `Action` constructor is called without several required arguments, even though those arguments have default values in the `Action` model definition. Pydantic's constructor requires all fields to be present, even if they have default values. ### Evidence ```python 213: self.minimal_action = Action( 214: namespaced_name=NamespacedName( 215: server=None, namespace="local", name="minimal" 216: ), 217: description="Minimal action", 218: definition_of_done="Done", 219: strategy_actor="openai/gpt-4", 220: execution_actor="openai/gpt-4", 221: ) ``` `pyright` output: ``` /app/asv/benchmarks/action_model_bench.py:213:31 - error: Arguments missing for parameters "long_description", "reusable", "read_only", "state", "created_by" (reportCallIssue) ``` ### Expected Behavior The `minimal_action` object should be created successfully without any type errors. ### Actual Behavior The creation of the `minimal_action` object fails the type check. ### Suggested Fix The `Action` constructor call in `asv/benchmarks/action_model_bench.py` should be updated to include all required arguments, even those with default values. ### Category type-safety ## Subtasks - [ ] Inspect the `Action` model definition to identify all required fields and their default values - [ ] Update the `Action` constructor call in `TimeAsCliDict.setup` to include all required arguments (`long_description`, `reusable`, `read_only`, `state`, `created_by`) - [ ] Run `nox -e typecheck` to confirm the type error is resolved - [ ] Run `nox -e benchmark` (or equivalent ASV invocation) to confirm the benchmark setup executes without error ## Definition of Done - [ ] `Action` constructor call in `asv/benchmarks/action_model_bench.py` includes all required arguments - [ ] `nox -e typecheck` passes with no errors in `action_model_bench.py` - [ ] ASV benchmark setup for `TimeAsCliDict` executes without runtime errors - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:12:35 +00:00
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#4151
No description provided.