agents plan execute fails with "plan is read-only" when action has read_only: true #4194

Open
opened 2026-04-07 00:41:16 +00:00 by brent.edwards · 2 comments
Member

Metadata

  • Commit Message: fix(plan): allow execution of plans created from read-only actions
  • Branch: fix/plan-execute-read-only

Background and Context

Actions can be configured with read_only: true (as in examples/actions/simple.yaml) to indicate that the action does not modify files — e.g. a lint check. However, agents plan execute currently refuses to run plans created from such actions, treating the read_only flag as a prohibition on execution rather than a constraint on file writes during execution. Read-only plans should be fully executable.

Current Behavior

Reproduction steps:

Use a unique working directory for each run (e.g. named after the date and a sequence number) to avoid conflicts when multiple test runs share the same system.

cd ~
mkdir -p test/20260406-03    # use a unique name per run, e.g. YYYYMMDD-NN
cd test/20260406-03
mkdir data
uv venv
source .venv/bin/activate
uv pip install /app
agents init --yes

cat <<EOF > strategist.yaml
name: local/strategist
type: llm
description: "Plans and strategizes work"
version: "1.0"
provider: claude
model: haiku
context_view: strategist
system_prompt: |
    You are a strategic planner. Analyze the task and produce a clear,
    step-by-step plan for an executor to follow.
EOF
agents actor add local/strategist --config strategist.yaml

cat <<EOF > executor.yaml
name: local/executor
type: llm
description: "Executes tasks provided by the strategist"
version: "1.0"
provider: claude
model: haiku
context_view: executor
system_prompt: |
  You are an executor. Follow the plan provided and execute
  each step carefully and completely.
EOF
agents actor add local/executor --config executor.yaml

agents action create --config /app/examples/actions/simple.yaml
agents project create --description "Linting project" local/lint-project
agents plan use local/lint-check local/lint-project

Note the plan ID printed by agents plan use, then run:

agents plan execute <PLAN-ID>

Actual output:

Cannot execute plan '<PLAN-ID>': plan is read-only.
Unexpected error:

Expected Behavior

agents plan execute runs the plan and produces output including execution progress, sandbox activity, and a strategy summary. The read_only: true flag in the action config should constrain what the plan may do during execution (i.e. no file writes), not prevent it from executing at all.

Acceptance Criteria

  • agents plan execute succeeds for plans created from actions with read_only: true.
  • The read_only flag prevents file modifications during execution but does not block execution itself.
  • The error message Cannot execute plan '...': plan is read-only. is no longer shown when running agents plan execute on a validly created plan.
  • Plans created from actions with read_only: false (or no read_only field) continue to behave as before.

Supporting Information

The action definition is at examples/actions/simple.yaml, which includes read_only: true. The read_only field is documented in the action schema. The error string plan is read-only can be used to locate the check in the source that needs to be corrected.

Subtasks

  • Locate the code path in agents plan execute that rejects execution when the plan is flagged read-only
  • Determine the correct semantics of read_only: true — it should constrain file writes, not prohibit execution
  • Fix the execution check so that read-only plans can be executed
  • Tests (Behave): Add scenario verifying agents plan execute succeeds for a plan created from a read_only: true action
  • Tests (Robot): Add integration test covering the full workflow from action creation to plan execution with read_only: true
  • 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.
  • 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.
## Metadata - **Commit Message**: `fix(plan): allow execution of plans created from read-only actions` - **Branch**: `fix/plan-execute-read-only` ## Background and Context Actions can be configured with `read_only: true` (as in `examples/actions/simple.yaml`) to indicate that the action does not modify files — e.g. a lint check. However, `agents plan execute` currently refuses to run plans created from such actions, treating the `read_only` flag as a prohibition on execution rather than a constraint on file writes during execution. Read-only plans should be fully executable. ## Current Behavior **Reproduction steps:** Use a unique working directory for each run (e.g. named after the date and a sequence number) to avoid conflicts when multiple test runs share the same system. ``` cd ~ mkdir -p test/20260406-03 # use a unique name per run, e.g. YYYYMMDD-NN cd test/20260406-03 mkdir data uv venv source .venv/bin/activate uv pip install /app agents init --yes cat <<EOF > strategist.yaml name: local/strategist type: llm description: "Plans and strategizes work" version: "1.0" provider: claude model: haiku context_view: strategist system_prompt: | You are a strategic planner. Analyze the task and produce a clear, step-by-step plan for an executor to follow. EOF agents actor add local/strategist --config strategist.yaml cat <<EOF > executor.yaml name: local/executor type: llm description: "Executes tasks provided by the strategist" version: "1.0" provider: claude model: haiku context_view: executor system_prompt: | You are an executor. Follow the plan provided and execute each step carefully and completely. EOF agents actor add local/executor --config executor.yaml agents action create --config /app/examples/actions/simple.yaml agents project create --description "Linting project" local/lint-project agents plan use local/lint-check local/lint-project ``` Note the plan ID printed by `agents plan use`, then run: ``` agents plan execute <PLAN-ID> ``` **Actual output:** ``` Cannot execute plan '<PLAN-ID>': plan is read-only. Unexpected error: ``` ## Expected Behavior `agents plan execute` runs the plan and produces output including execution progress, sandbox activity, and a strategy summary. The `read_only: true` flag in the action config should constrain what the plan may do during execution (i.e. no file writes), not prevent it from executing at all. ## Acceptance Criteria - `agents plan execute` succeeds for plans created from actions with `read_only: true`. - The `read_only` flag prevents file modifications during execution but does not block execution itself. - The error message `Cannot execute plan '...': plan is read-only.` is no longer shown when running `agents plan execute` on a validly created plan. - Plans created from actions with `read_only: false` (or no `read_only` field) continue to behave as before. ## Supporting Information The action definition is at `examples/actions/simple.yaml`, which includes `read_only: true`. The `read_only` field is documented in the action schema. The error string `plan is read-only` can be used to locate the check in the source that needs to be corrected. ## Subtasks - [ ] Locate the code path in `agents plan execute` that rejects execution when the plan is flagged read-only - [ ] Determine the correct semantics of `read_only: true` — it should constrain file writes, not prohibit execution - [ ] Fix the execution check so that read-only plans can be executed - [ ] Tests (Behave): Add scenario verifying `agents plan execute` succeeds for a plan created from a `read_only: true` action - [ ] Tests (Robot): Add integration test covering the full workflow from action creation to plan execution with `read_only: true` - [ ] 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. - 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.
brent.edwards added this to the v3.2.0 milestone 2026-04-07 00:41:16 +00:00
brent.edwards changed title from agents plan execute stops with "plan is read-only". to agents plan execute fails with "plan is read-only" when action has read_only: true 2026-04-07 00:45:52 +00:00
Owner

Issue triaged by project owner:

  • State: Verified — Clear bug: read_only: true on an action incorrectly makes the plan read-only during execution
  • Priority: Critical (already set) — Blocks plan execution for any action with read_only: true
  • Milestone: v3.2.0 (already set) — Plan execution is core M3 functionality
  • Story Points: 3 — M (already set) — Requires investigation of how read_only propagates from action to plan
  • MoSCoW: Must Have (already set) — Plan execution must work correctly
  • Assignee: HAL9000 — default assignment to maintain velocity

The read_only flag on an action describes the action's behavior (whether it modifies the filesystem), not the plan's mutability. The plan execution engine is incorrectly interpreting this flag.


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

Issue triaged by project owner: - **State**: Verified ✅ — Clear bug: `read_only: true` on an action incorrectly makes the plan read-only during execution - **Priority**: Critical ✅ (already set) — Blocks plan execution for any action with `read_only: true` - **Milestone**: v3.2.0 ✅ (already set) — Plan execution is core M3 functionality - **Story Points**: 3 — M (already set) — Requires investigation of how `read_only` propagates from action to plan - **MoSCoW**: Must Have ✅ (already set) — Plan execution must work correctly - **Assignee**: HAL9000 — default assignment to maintain velocity The `read_only` flag on an action describes the action's behavior (whether it modifies the filesystem), not the plan's mutability. The plan execution engine is incorrectly interpreting this flag. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Owner

Label compliance fix applied:

  • Removed duplicate org-level labels (bug, MoSCoW/Must have, Priority/Critical, State/Unverified, Type/Bug)
  • Kept repo-level labels: MoSCoW/Must Have, Points/3, Priority/Critical, State/Verified, Type/Bug
  • Note: State/Unverified (org-level) conflicted with State/Verified (repo-level). Kept State/Verified as it was added more recently by implementation workers.

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Removed duplicate org-level labels (bug, MoSCoW/Must have, Priority/Critical, State/Unverified, Type/Bug) - Kept repo-level labels: MoSCoW/Must Have, Points/3, Priority/Critical, State/Verified, Type/Bug - Note: State/Unverified (org-level) conflicted with State/Verified (repo-level). Kept State/Verified as it was added more recently by implementation workers. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#4194
No description provided.