Skip to content

pack-compose.staging-* directories not garbage-collected after failed compose #5

@yzhao062

Description

@yzhao062

Summary

Failed composer runs leave behind pack-compose.staging-<pid>/ directories under .agent-config/. These are not garbage-collected on subsequent runs, so each anywhere-agents invocation re-emits a "blocking orphan staging dir(s); resolve manually" error before the wheel-side recovery (pack verify --fix --yes) heals the project.

Reproduction

Surfaced during the v0.6.0 pre-release sandbox (Windows, May 2026):

  1. A maintainer project carried .agent-config/pack-compose.staging-6304/ from a prior failed compose, plus three orphan staged*.diff files.

  2. Bare anywhere-agents v0.6.0 emits stderr:

    error: reconciliation surfaced blocking orphan staging dir(s); resolve manually
    error: pack 'aa-core-skills' active entry requires host ['claude-code']...
    [anywhere-agents] pack composition did not complete (rc=1)
    
  3. Wheel-side recovery succeeds: Bootstrap exited with code 1 but wheel-side recovery succeeded; project is now in a coherent state.

  4. Re-running anywhere-agents reproduces the same noisy stderr indefinitely; the staging dir is never removed.

The project ends in a coherent state (exit 0), but the user-visible stderr is noisy on every run.

Suggested fix

Add a garbage-collection pass in the existing reconcile_orphans flow at scripts/packs/reconciliation.py (or in the pack verify --fix heal path) that removes pack-compose.staging-* directories older than a threshold (24h is a safe starting point). Skip removal when a directory's PID still has an associated live process, so concurrent compose runs are not affected.

Scope

Not a v0.6.0 regression (the same orphan path existed in v0.5.x). The final state is correct (exit 0); only the per-run stderr noise is wrong. Targeting v0.6.x for cleanup.

Related

  • v0.6.0 CHANGELOG entry under ### Fixed.
  • The companion aa-core-skills host-mismatch issue under codex was fixed in v0.6.0 ("Host-aware bundled-default seeding") and is unrelated to this orphan-GC concern.

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