fix(agent-isolation): show the touch overlay for agent-run git on Linux - #1365
Merged
Merged
Conversation
… touch watcher's owner Claude Code on Linux runs a hook through `sh -c`, so the hook's $PPID is a shell that exits as soon as the hook returns, and the watcher's parent-liveness check ended the watch before the key ever blocked. Generated-by: Claude Code (Opus 5.5)
potiuk
added a commit
that referenced
this pull request
Sep 24, 2026
Reconciles the spec-loop specs with the functionality that shipped between 5c75abd and bcd8b7f: - agent-isolation-sandbox: the hardware-key touch policy (sig cached + aut off with OpenPGP signing, aut cached with gpg.format=ssh) (#1367); touch-watcher owner is the harness (#1365); macOS overlay closes on deactivation (#1325); whole-user git hooks allowRead and dispatcher flavour (#1364, #1322, #1358); agent-guard finds the git subcommand past global flags (#1330); agent-guard plugin counts as a complete install (#1323); per-tool cooldown_days, bubblewrap 0.13.0 (#1360). - sandbox-diagnostics: ten catalogue entries (prek/uv not found, git hooks silently skipped) (#1359, #1364); doctor probes as scripts, with probes 7 and 8 (#1336, #1362, #1364); verify's 12 checks and conditional-checks.md (#1334). - vetted-command-surface: HTTP read backend with the OSV and CVE.org operations (#1326); the vetted-op-read recipe spelling (#1339); the plugin copy resolves standalone (#1357). - cve-tooling: tools/osv (contract:security-cross-ref) and the cve-org check through vetted-ops (#1297, #1326). - security-issue-lifecycle: step 2b proposes going ahead on a quiet reporter (#1340); the post-advisory security-pages update (#1355). - meta-and-quality-tooling: name: must match the skill directory (#1361); skill-evals fixture containment and grader retry (#1315, #1341); optimize-skill budgets, eval gate, rewrite and extract-code passes (#1331, #1332, #1335, #1338); diff-scoped prek CI (#1317). - marketplace-distribution: substrate plugins (#1368, #1357). - adversarial-review (new): the tool and substrate plugin as shipped (#1368), with its known gaps. Generated-by: Claude Opus 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git commit/pushthe agent runs on Linux.armgave the watcher$PPIDas its owner, but Claude Code runs a hook command throughsh -c, so$PPIDis that shell — which exits the moment the hook returns. The parent-liveness check in_watchthen ends the watch on its first poll, before the key has blocked. Thewrappath (commits from the operator's own terminal) passes$$and is unaffected, which is why the overlay still shows there.armnow resolves the owner by walking up from$PPIDpast shell processes to the harness itself, and uses that pid for the watcher's parent check, the registration's owner (so the next arm's sweep does not kill a live session's watcher), and theh-<pid>owner id fallback. Where the harness starts the hook directly (possibly macOS), the walk stops at$PPIDand nothing changes.Type of change
tools/agent-isolationhook script + its regression testTest plan
test_watcher_outlives_the_shell_the_hook_ran_inarms throughsh -c 'bash gpg-touch-overlay.sh arm'; it fails onmain(the registered owner is the exitedsh, not the test process) and passes with the fix.uv run pytestintools/agent-isolation— all tests pass (run outside the Claude Code sandbox:test_agent_socket_rows_follow_the_connections_held_openneedssocket(AF_UNIX), which the Linux sandbox's seccomp filter rejects).prek runon the changed files passes.kill -0 <sh pid>failing andbreakon the first iteration; after it, the watcher tracked theclaudeprocess, counted the blocked polls, and raised the GTK overlay during agit ls-remoteover ssh.RFC-AI-0004 compliance
psfor its own ancestors.Linked issues
Regression from #1296, which added the parent-liveness check.
Notes for reviewers (optional)
The shell names skipped are
sh,bash,dash,zsh(plus login-shell-forms). A harness that wraps hooks in some other interpreter would still hit the old behaviour; widening the list is cheap if one turns up.🤖 Generated with Claude Code