add-atomic-clear

Add atomic clear-route-pin command

Metadata

Statusdone
Assignedagent-867
Agent identity7ae4731fae60d11b5cea1f066f583a4986346cf86fc7005ee8373bd0980ae13b
Created2026-07-26T09:53:58.953981997+00:00
Started2026-07-26T10:11:58.240419179+00:00
Completed2026-07-26T10:47:37.823056977+00:00
Tokens15915213 in / 33479 out

Description

Objective

Add a supported atomic way to remove a task's explicit execution-route pin and return it to normal profile inheritance. This is distinct from wg retry --current-profile, which snapshots and writes a new exact pin.

CLI contract

Preferred surface: wg edit <task> --clear-route-pin (choose an equally explicit spelling only if CLI consistency requires it).

Atomically clear all task-level route-affecting state for future execution:

  • preferred model
  • structured reasoning override
  • deprecated/legacy provider field
  • route-specific persisted Pi/Claude session identity

Do not erase historical actual_executor, actual_model, attempt provenance, usage, evaluation evidence, logs, worktree, or task status. The command edits inheritance metadata only; it does not itself retry or spawn the task. Plain wg edit behavior remains backward compatible.

Semantics

  • After clearing, the next new attempt resolves from whichever project profile is effective at dispatch time; this dynamic inheritance is intentional and must be clearly distinguished from deterministic wg retry --current-profile.
  • Emit a clear audit log naming every cleared field and the profile that would currently inherit, without pinning it.
  • For an in-progress attempt, preserve its recorded actual route/session and make the clear apply only to a future attempt; fail closed if the data model cannot represent that safely.
  • Keep Pi/direct-Codex/direct-Claude execution systems explicit and never introduce fallback.

Validation

  • A pinned task becomes model/reasoning/provider/session-unpinned in one command.
  • Historical actual route, usage, provenance, status, and worktree remain unchanged.
  • Its next attempt inherits the then-current profile; a profile flip before dispatch is reflected because this command intentionally clears rather than snapshots.
  • In-progress behavior is safe and tested.
  • wg show --json and human output distinguish inherited/unpinned from exact task pins.
  • Help/docs contrast --clear-route-pin with retry --current-profile.
  • Permanent credential-free human-flow smoke test passes.
  • cargo fmt --check, cargo clippy, and focused tests pass.

Work independently from direct-Codex restoration. Minimize shared CLI-file edits and message the Codex task if an unavoidable overlap is discovered.

Depends on

Required by

Log