fix(issue-10,13): check every agy artifact for holders and purge orphaned leftovers
Round-3 review of f5a6575 (planner-reviewer-codex-01, R1/R2).
R1 - the adapter's in-use check handed only the conversation DB to lsof, so a
holder that keeps the presence lock (or a sidecar) open while naming the uuid
on no command line and in no session variable was invisible, and the held
lock was unlinked from under it. AgyAgentAdapter.conversation_in_use now
passes every path of the conversation (DB, -wal/-shm/-journal, brain,
annotation, presence lock).
R2 - both resolver stages required the DB, so once an interrupted or pre-#10
purge had removed it, the WAL/annotation/lock left behind were "no artifact"
(exit 5) forever. BaseAgentAdapter.has_artifacts (default: a uuid-bearing
artifact path that exists) replaces the resolver's path fallback, and agy's
override accepts any of its pieces.
Tests: a flock holder that names the uuid nowhere is refused and nothing is
removed; orphaned leftovers resolve to agy and are purged. VERSIONS.md
v4.4.3 items 1-2 and orc-onboard SKILL.md updated.
Refs #10 #13
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
1 parent
f5a6575bf2
commit
fae70c13d9
6 files changed
+90
-9
No files matched your search
@@ -13,8 +13,9 @@ def _resolve_purge_target(agent_hint: str, uuid: str, workspace: str):
|
||||
|
||||
An explicit agent is trusted as long as its artifact exists. `auto` tries
|
||||
each adapter's own verification first (revalidate mode: an orchestrator
|
||||
conversation is not in any workspace cache), then a plain path check for
|
||||
adapters whose artifact path embeds the uuid.
|
||||
conversation is not in any workspace cache), then the adapter's own
|
||||
`has_artifacts` - which, for agy, also accepts orphaned sidecars, the
|
||||
annotation or the presence lock left behind after the DB is gone.
|
||||
"""
|
||||
from lib_py.agents.base import DiscoveryContext
|
||||
names = [agent_hint] if agent_hint and agent_hint != 'auto' else list(PURGE_PROBE_ORDER)
|
||||
@@ -32,11 +33,10 @@ def _resolve_purge_target(agent_hint: str, uuid: str, workspace: str):
|
||||
pass
|
||||
for name, adapter, ctx in probes:
|
||||
try:
|
||||
path = adapter.artifact_path(uuid, ctx)
|
||||
if adapter.has_artifacts(uuid, ctx):
|
||||
return name, adapter, ctx
|
||||
except Exception:
|
||||
continue
|
||||
if uuid in path and os.path.exists(path):
|
||||
return name, adapter, ctx
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user