Skip to content

ak-plan: warn that releasing an active task can discard unpushed worker changes #223

Description

@saltbo

Summary

During stalled-task recovery, the leader repeatedly ran ak task release on an in_progress task whose worker had reported staged/local implementation but had not pushed a branch. The next session started from a clean base, and the implementation had to be reconstructed.

The leader workflow did not make the environment-reset/data-loss risk explicit before release.

Command

ak task release kcnpv6zaiwr2 -o json

Expected

Before releasing an active task with no remote PR/branch, the CLI or ak-plan skill should clearly warn that a fresh runtime session may not preserve uncommitted or unpushed files, and should require a durable handoff when the current session is still reachable.

Actual

The command immediately moved the task to todo and redispatched it. A later worker session reported a clean detached checkout with no staged, unstaged, untracked, stashed, or remote task changes.

Context

  • ak version: 1.4.0
  • OS: macOS
  • Runtime: Codex
  • Auth type: leader agent
  • Task: kcnpv6zaiwr2

Reproduction

  1. Have a worker claim a task and create local/staged changes without pushing.
  2. From a leader session, run ak task release <task-id>.
  3. Allow redispatch to create a fresh session.
  4. Observe that the new session can start from the repository base without the prior local changes.

Proposed Skill Change

Add a mandatory pre-release recovery gate to ak-plan and ak-task: inspect whether the task has a pushed PR/branch or a worker-authored durable commit. If the active session may still contain unpushed changes, first request an emergency commit/push and wait using the standard monitoring backoff. State explicitly that release may dispatch a fresh environment and must not be used as a generic nudge. Also consider an interactive CLI warning or --force requirement when releasing in_progress tasks with no PR URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions