Skip to content

4.3.0: name resolution still fails closed on a terminated LaunchServices record (follow-up to #677) #709

Description

@gabrielexito-stack

Follow-up to #677. That fix ("distinguishes repeated explicit EPERM on a foreign prohibited helper from genuinely uncertain metadata") resolved the root-owned-daemon case, but on 4.3.0 the same fail-closed behaviour still occurs for a terminated process that LaunchServices has not yet reaped. A dead PID falls on the "genuinely uncertain metadata" side of that split, so one stale LS record aborts the entire mutation inventory and every name-resolved command on the machine fails.

Reproduction

$ peekaboo --version
Peekaboo 4.3.0 (main/44eff916c, built: 2026-09-02T13:31:24-07:00)

$ peekaboo app hide --app Finder --no-remote
⛔ Action refused before dispatch; refresh the target before retrying
Error: Application inventory was incomplete while resolving 'Finder'. Application PID 424 lacked process-generation identity and was omitted. Hint: Refresh the target inventory and retry with its exact PID, process generation, and window ID.

Same with the daemon path (--no-remote omitted), so this is not a runtime-host artifact.

PID 424 does not exist

$ ps -o pid,uid,stat,comm -p 424
  PID   UID STAT COMM
$ echo $?
1

$ kill -0 424
kill: kill 424 failed: no such process

It is only a residual LaunchServices ASN entry:

$ lsappinfo info -only pid,name,bundleid,LSDisplayName,StatusLabel 424
"pid"=424
"LSDisplayName"="openclaw"
"CFBundleIdentifier"="com.apple.iWork.Keynote"
"StatusLabel"=[ NULL ]

(The bundle id is stale/mismatched too — this is a dead node process whose LS record was never cleaned up.) It survives a daemon kill/respawn and persists across runs.

Impact

Every --app <name> command is refused machine-wide until the LS record clears. --pid <n> still works and is the only workaround:

$ peekaboo click --app Calculator --on B7      # refused, same error
$ peekaboo click --pid 31462 --on B7           # ✓ works

Suggested handling

processStartIdentity failing with ESRCH (or the PID otherwise not existing) means the entry is dead, not uncertain — a dead process cannot be a mutation target and cannot cause PID-reuse ambiguity against a live named target. Treating "process is gone" the same way #678 treats "explicit EPERM on a foreign prohibited helper" (drop the entry, keep the inventory complete) would close this without weakening the uniqueness guard, since a genuinely reused PID would resolve and fingerprint successfully.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions