Lack of Enums for execution_environment and execution_env_priority in ContextConfig #8274

Open
opened 2026-04-13 07:14:43 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit Message: refactor(core): use enums for ContextConfig.execution_environment and ContextConfig.execution_env_priority
  • Branch Name: refactor/context-config-enums

Background and Context

The ContextConfig model in src/cleveragents/domain/models/core/project.py has two fields, execution_environment and execution_env_priority, that are of type str.

Using strings for these fields is not ideal, as it can lead to typos and other errors. It also makes the code harder to understand, as it's not immediately clear what the valid values are.

Expected Behavior

The execution_environment and execution_env_priority fields should use enums to define the valid values. This would improve type safety and make the code more readable and maintainable.

Acceptance Criteria

  • The execution_environment and execution_env_priority fields in the ContextConfig model use enums.
  • The enums are well-documented.
  • The changes are covered by unit tests.

Subtasks

  • Define an ExecutionEnvironment enum with all valid values for execution_environment
  • Define an ExecutionEnvPriority enum with all valid values for execution_env_priority
  • Update ContextConfig model to use the new enums for both fields
  • Add docstrings/documentation to the new enums
  • Update any existing usages of these fields throughout the codebase
  • Write/update unit tests to cover the enum-typed fields

Definition of Done

This issue should be closed when:

  • Both execution_environment and execution_env_priority fields in ContextConfig are typed with their respective enums (not plain str)
  • The enums are documented with clear docstrings
  • All existing usages of these fields have been updated to use the enum values
  • Unit tests cover the new enum fields and pass
  • The branch refactor/context-config-enums is merged

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `refactor(core): use enums for ContextConfig.execution_environment and ContextConfig.execution_env_priority` - **Branch Name**: `refactor/context-config-enums` ## Background and Context The `ContextConfig` model in `src/cleveragents/domain/models/core/project.py` has two fields, `execution_environment` and `execution_env_priority`, that are of type `str`. Using strings for these fields is not ideal, as it can lead to typos and other errors. It also makes the code harder to understand, as it's not immediately clear what the valid values are. ## Expected Behavior The `execution_environment` and `execution_env_priority` fields should use enums to define the valid values. This would improve type safety and make the code more readable and maintainable. ## Acceptance Criteria - The `execution_environment` and `execution_env_priority` fields in the `ContextConfig` model use enums. - The enums are well-documented. - The changes are covered by unit tests. ## Subtasks - [ ] Define an `ExecutionEnvironment` enum with all valid values for `execution_environment` - [ ] Define an `ExecutionEnvPriority` enum with all valid values for `execution_env_priority` - [ ] Update `ContextConfig` model to use the new enums for both fields - [ ] Add docstrings/documentation to the new enums - [ ] Update any existing usages of these fields throughout the codebase - [ ] Write/update unit tests to cover the enum-typed fields ## Definition of Done This issue should be closed when: - Both `execution_environment` and `execution_env_priority` fields in `ContextConfig` are typed with their respective enums (not plain `str`) - The enums are documented with clear docstrings - All existing usages of these fields have been updated to use the enum values - Unit tests cover the new enum fields and pass - The branch `refactor/context-config-enums` is merged --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.2.0 milestone 2026-04-13 07:15:35 +00:00
Author
Owner

[AUTO-EPIC] Epic Linkage

This issue is a child of Epic #8043 — M3 UAT Bug Resolution — Spec Alignment Backlog (v3.2.0).

Lack of enums for execution_environment and execution_env_priority in ContextConfig is a type safety issue that falls under the M3 UAT bug resolution scope.

Dependency direction: This issue (#8274) BLOCKS Epic #8043.


Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## [AUTO-EPIC] Epic Linkage This issue is a child of **Epic #8043** — M3 UAT Bug Resolution — Spec Alignment Backlog (v3.2.0). Lack of enums for execution_environment and execution_env_priority in ContextConfig is a type safety issue that falls under the M3 UAT bug resolution scope. **Dependency direction**: This issue (#8274) BLOCKS Epic #8043. --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
Author
Owner

Verified — Using enums instead of raw strings for execution_environment and execution_env_priority improves type safety and prevents invalid values. Could Have — low priority code quality improvement. Verified.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — Using enums instead of raw strings for execution_environment and execution_env_priority improves type safety and prevents invalid values. **Could Have** — low priority code quality improvement. Verified. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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.

Dependencies

No dependencies set.

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