Skip to content

fix(store): prune rows of agents the scan did not visit - #161

Merged
RealZST merged 1 commit into
mainfrom
fix/prune-unscanned-agent-rows
Oct 18, 2026
Merged

RealZST merged 1 commit into
mainfrom
fix/prune-unscanned-agent-rows

Conversation

@RealZST

@RealZST RealZST commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Problem

scan_all skips agents whose detect() fails, so once an agent is uninstalled its rows are never produced again. Rows that point at files in a shared directory such as ~/.agents/skills kept the "install_meta and the file still exists" exemption forever, because the file is still there for the other agents. The Overview then kept counting those rows for an agent that is not installed: on my machine Devin Desktop showed 22 extensions with no ~/.codeium/windsurf on disk.

Fix

  • scanner::scan_all returns ScanResult { extensions, scanned_agents }, the latter being the adapters that passed detect().
  • New Store::sync_scan(&ScanResult); the CLI, web and desktop scan-and-sync callers all use it. The old sync_extensions stays for partial syncs and is now test-only.
  • In the stale-row pass, a row whose agent was not visited by the scan is pruned regardless of install_meta. The one exemption kept is store-held disabled state (disabled_config): an MCP entry HarnessKit disabled only exists there, and detection can fail transiently, so that copy must survive.
  • Rows with no agent (CLI binaries no skill names) count as visited.

Behaviour changes worth knowing

  • On the first scan after upgrade, every row of a currently undetected agent is removed. Rows come back on the next scan that detects the agent again, but marketplace install metadata on them does not.
  • Agents whose home comes from an environment variable (GROK_HOME, PI_CODING_AGENT_DIR, PENGUIN_HOME, DSH_HOME, OPENCLAW_*) are not detected by the desktop app when the default directory is absent, since it does not load the login-shell environment. Their rows are now pruned by a desktop scan and recreated by the next CLI scan. Narrow, and the root cause is the environment handling, not this change.
  • Kit installs targeted at an undetected agent produced rows the scan could never refresh; they are now pruned too. Kit removal already tolerates missing rows.

Verification

  • cargo test --workspace green; new tests: an end-to-end scan-then-sync with Codex and Devin Desktop adapters on a temp home (uninstall Devin, shared skill row pruned, Codex row kept, disabled MCP row kept), plus unit cases for the decision function.
  • Ran the new CLI against my real database (backed up first): exactly the rows of the two undetected agents were removed, 44 of 1043, nothing else changed. Full scan-and-sync still takes about 1.5 s on this machine.

🤖 Generated with Claude Code

scan_all skips agents that fail detection, so once an agent is
uninstalled its rows are never produced again. Rows pointing at files in
shared directories such as ~/.agents/skills kept the install_meta
exemption forever, because the file is still there, and the Overview
went on counting them for an agent that is not installed.

scan_all now reports which agents it visited and the scan-and-sync
callers go through Store::sync_scan, which prunes stale rows of
unvisited agents regardless of install_meta. Store-held disabled state
(disabled_config) is still kept, as detection can fail transiently and
that snapshot is the only copy.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@RealZST
RealZST merged commit 5df4c5c into main Oct 18, 2026
3 checks passed
@RealZST
RealZST deleted the fix/prune-unscanned-agent-rows branch October 18, 2026 15:10
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.

1 participant