Skip to content

bug: agent action implement cannot resolve a workspace for planning-artifact WPs #551

@robertDouglass

Description

@robertDouglass

Summary

Even after repairing Mission 077 lane metadata, spec-kitty agent action implement still cannot start a planning-artifact WP. The command claims it is creating a workspace, but then aborts because no workspace can be resolved for the WP.

This blocks the canonical implement/review loop for planning-artifact work packages such as WP01 in 077-mission-terminology-cleanup.

Concrete failure

Observed in /private/tmp/241/spec-kitty after lane metadata was repaired and status validation passed:

spec-kitty agent action implement WP01 \
  --mission-run 077-mission-terminology-cleanup \
  --agent codex:gpt-5-codex:implementer:orchestrator

Result:

Creating workspace for WP01...
No crashed implementation sessions found.
Error: implement completed but no workspace could be resolved for WP01.

This happened after spec-kitty agent status validate --mission 077-mission-terminology-cleanup was already green.

Why this is a bug

Planning-artifact WPs are valid WPs in the mission model. If the CLI exposes agent action implement WP01, then the workflow layer has to know how to create or resolve the execution context for that WP.

Right now the command surface suggests support, but the underlying workspace resolver only understands lane-backed worktrees.

Likely root cause

From code inspection, there is a split-brain between the generic workspace abstraction and the agent workflow path:

  • src/specify_cli/core/worktree.py::create_wp_workspace(...) already has execution-mode handling for planning artifacts and can route them to repo-root execution
  • but the implement workflow is still lane-centric:
    • src/specify_cli/lanes/implement_support.py::create_lane_workspace(...) allocates a lane worktree
    • src/specify_cli/workspace_context.py::resolve_workspace_for_wp(...) resolves via lane/worktree context
    • src/specify_cli/cli/commands/agent/workflow.py expects the implement path to yield a workspace path through that lane-backed mechanism

So the system has a planning-artifact execution concept, but the agent action implement path is not consistently using it.

Expected behavior

One of these should happen for planning-artifact WPs:

  1. agent action implement uses the same execution-mode-aware workspace abstraction as create_wp_workspace(...) and resolves planning-artifact WPs to repo root, or
  2. the command rejects planning-artifact WPs explicitly with a clear message and points the caller to the supported path

The current behavior is the worst of both worlds: it starts the workflow, claims a workspace is being created, and then dies with an internal-resolution error.

Notes

This is separate from the bad lanes.json metadata bug. I hit this only after manually repairing lane metadata, which means even a corrected Mission still cannot use the standard implement loop for planning-artifact WPs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-bugConfirmed bugs, fix soonbugSomething isn't workingworkflowWorkflow/UX improvements

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions