UAT: agents project context set --execution-env-priority error message is misleading — says "requires --execution-environment" but spec allows it independently #2088

Open
opened 2026-04-03 03:58:47 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/acms-context-set-exec-env-priority-validation
  • Commit Message: fix(cli): align execution-env-priority validation with spec in context set command
  • Milestone: v3.7.0
  • Parent Epic: #396

Summary

The agents project context set command rejects --execution-env-priority when --execution-environment is not also provided:

--execution-env-priority requires --execution-environment

However, the spec defines --execution-env-priority as an independent option that controls priority semantics for the project-level execution environment. The spec says:

--execution-env-priority fallback|override: Priority semantics for the project-level execution environment. fallback (default): defers to auto-detected devcontainers when present; used only when no closer-scoped environment exists. override: always uses the specified environment, bypassing devcontainer auto-detection. See §Execution Environment Routing.

The spec does NOT state that --execution-env-priority requires --execution-environment to be set simultaneously. A user may want to change the priority of a previously-set execution environment without re-specifying the environment name.

Expected Behavior (from spec)

agents project context set --execution-env-priority override myproject should succeed and update only the priority field, leaving the previously-set execution_environment unchanged.

Actual Behavior

$ agents project context set --execution-env-priority override myproject
Error: --execution-env-priority requires --execution-environment

The command exits with code 1 even when an execution_environment was previously set for the project.

Code Location

src/cleveragents/cli/commands/project_context.py, lines ~430-440:

if execution_env_priority is not None:
    # --execution-env-priority requires --execution-environment
    if execution_environment is None:
        err_console.print(
            "[red]--execution-env-priority requires --execution-environment[/red]"
        )
        raise typer.Exit(1)

Steps to Reproduce

  1. Create a project: agents project create local/myproject
  2. Set execution environment: agents project context set --execution-environment host local/myproject
  3. Try to change priority: agents project context set --execution-env-priority override local/myproject
  4. Observe: Error — --execution-env-priority requires --execution-environment

Impact

  • Users cannot update the execution environment priority without re-specifying the environment name, which is a usability regression from the spec.
  • The spec explicitly defines --execution-env-priority as an independent option.

Subtasks

  • Remove the requirement that --execution-env-priority must be accompanied by --execution-environment
  • When --execution-env-priority is set without --execution-environment, read the existing execution_environment from the stored policy and update only the priority
  • Add a BDD scenario testing --execution-env-priority without --execution-environment
  • Ensure the existing test features/project_context_set_exec_env_priority.feature covers this case

Definition of Done

  • agents project context set --execution-env-priority override <project> succeeds when an execution environment was previously set
  • BDD test added and passing
  • No regressions

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

## Metadata - **Branch**: `fix/acms-context-set-exec-env-priority-validation` - **Commit Message**: `fix(cli): align execution-env-priority validation with spec in context set command` - **Milestone**: v3.7.0 - **Parent Epic**: #396 ## Summary The `agents project context set` command rejects `--execution-env-priority` when `--execution-environment` is not also provided: ``` --execution-env-priority requires --execution-environment ``` However, the spec defines `--execution-env-priority` as an independent option that controls priority semantics for the project-level execution environment. The spec says: > `--execution-env-priority fallback|override`: Priority semantics for the project-level execution environment. `fallback` (default): defers to auto-detected devcontainers when present; used only when no closer-scoped environment exists. `override`: always uses the specified environment, bypassing devcontainer auto-detection. See §Execution Environment Routing. The spec does NOT state that `--execution-env-priority` requires `--execution-environment` to be set simultaneously. A user may want to change the priority of a previously-set execution environment without re-specifying the environment name. ## Expected Behavior (from spec) `agents project context set --execution-env-priority override myproject` should succeed and update only the priority field, leaving the previously-set `execution_environment` unchanged. ## Actual Behavior ``` $ agents project context set --execution-env-priority override myproject Error: --execution-env-priority requires --execution-environment ``` The command exits with code 1 even when an `execution_environment` was previously set for the project. ## Code Location `src/cleveragents/cli/commands/project_context.py`, lines ~430-440: ```python if execution_env_priority is not None: # --execution-env-priority requires --execution-environment if execution_environment is None: err_console.print( "[red]--execution-env-priority requires --execution-environment[/red]" ) raise typer.Exit(1) ``` ## Steps to Reproduce 1. Create a project: `agents project create local/myproject` 2. Set execution environment: `agents project context set --execution-environment host local/myproject` 3. Try to change priority: `agents project context set --execution-env-priority override local/myproject` 4. Observe: Error — `--execution-env-priority requires --execution-environment` ## Impact - Users cannot update the execution environment priority without re-specifying the environment name, which is a usability regression from the spec. - The spec explicitly defines `--execution-env-priority` as an independent option. ## Subtasks - [ ] Remove the requirement that `--execution-env-priority` must be accompanied by `--execution-environment` - [ ] When `--execution-env-priority` is set without `--execution-environment`, read the existing `execution_environment` from the stored policy and update only the priority - [ ] Add a BDD scenario testing `--execution-env-priority` without `--execution-environment` - [ ] Ensure the existing test `features/project_context_set_exec_env_priority.feature` covers this case ## Definition of Done - [ ] `agents project context set --execution-env-priority override <project>` succeeds when an execution environment was previously set - [ ] BDD test added and passing - [ ] No regressions --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-03 03:59:29 +00:00
freemo self-assigned this 2026-04-03 16:58:08 +00:00
Author
Owner

MoSCoW classification: Could Have

Rationale: This is a low-priority or backlog item. Desirable but not necessary for the milestone. Include only if time permits.


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

MoSCoW classification: **Could Have** Rationale: This is a low-priority or backlog item. Desirable but not necessary for the milestone. Include only if time permits. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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.

Blocks
#396 Epic: ACMS Context Pipeline
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2088
No description provided.