Skip to content

fix(windows host): a deleted agent's empty root is not an installed agent - #9

Merged
armstrongsam25 merged 1 commit into
mainfrom
077-fix-host-ghost-roots
Sep 3, 2026
Merged

armstrongsam25 merged 1 commit into
mainfrom
077-fix-host-ghost-roots

Conversation

@armstrongsam25

Copy link
Copy Markdown
Contributor

What

First look at Agents on this PC after real deletions (rig, 2026-09-03): when inventory reconciliation deletes an agent's last v3 revision it removes <agent>/revisions/<rev> and leaves <agent>/revisions/ behind, and ByoAgentHost._installed_agent_ids counted any directory under the agents root — so two long-deleted agents were listed as installed, offline agents named by their ids.

  • A root counts as installed only while it holds a legacy flat bundle or at least one revision directory (_root_has_bundle).
  • The reconciliation delete decision prunes the empty revisions/ shell and the agent root (_prune_empty_agent_root).
  • The host's own inventory pass sweeps ghost roots left by earlier deletions, so existing installs heal on the next connect.

Evidence

  • Rig: %LOCALAPPDATA%\AstralDeep\agents held two empty shells (21c00397-…, e4b0276c-…) and the just-deleted 1e538e7c-…; after one reconnect on this branch the server decided agent_deleted for the tombstoned revision and the directory holds only the pre-existing legacy bundle, .staging and .host-identity.json.
  • tests/test_local_agents_077.py::test_inventory_skips_and_prunes_a_root_whose_revisions_are_gone (new) and the extended test_invalid_inventory_is_all_or_nothing_and_valid_delete_removes_revision fail on main and pass here; Windows-client suite 1050 passed offscreen.
  • Provenance ledger digests rebound for the two imported files (tests/test_protocol.py green).

No new dependencies; no wire change; no AstralDeep composition change needed (the Deep pin can move whenever the next repin happens).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AnCh2F8vbpctZUdYzdViB1

…gent

Rig finding (2026-09-03, first look at "Agents on this PC" after real
deletions): when inventory reconciliation deletes an agent's last v3 revision
it removed `<agent>/revisions/<rev>` and left `<agent>/revisions/` behind, and
`_installed_agent_ids` counted any directory under the agents root — so two
long-deleted agents were listed as installed, offline agents named by their
ids. A root now counts as installed only while it holds a legacy bundle or at
least one revision, and the delete decision prunes the empty shell and root.
Pinned in test_local_agents_077 and the reconciliation delete test; ledger
digests rebound.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AnCh2F8vbpctZUdYzdViB1
@armstrongsam25
armstrongsam25 merged commit 923f8c7 into main Sep 3, 2026
3 checks passed
@armstrongsam25
armstrongsam25 deleted the 077-fix-host-ghost-roots branch September 3, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants