Skip to content

Fix remaining gaps in remote commit signing via forwarded SSH agent - #136

Merged
haacked merged 7 commits into
mainfrom
haacked/agent-sock-launchd-fix
Jul 8, 2026
Merged

Fix remaining gaps in remote commit signing via forwarded SSH agent#136
haacked merged 7 commits into
mainfrom
haacked/agent-sock-launchd-fix

Conversation

@haacked

@haacked haacked commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #135. Live testing surfaced two remaining gaps that kept commit signing from actually routing through a forwarded agent, plus a bootstrap improvement discovered along the way.

  • The LaunchAgent that sets the session-wide SSH_AUTH_SOCK default pointed straight at Secretive's socket, so any process that never sources .zshrc (GUI apps, tools that spawn non-interactive shells, including Claude Code's own tool calls) stayed on the local agent even with a live forwarded connection. It now points at the same agent.sock symlink zshrc.symlink maintains, seeding it to the local socket on first run.
  • git commit -S needs the exact public key to ask the agent for, and signingkey was hardcoded per machine, so signing only worked with whichever key lived on that specific host, even once SSH_AUTH_SOCK correctly pointed at a forwarded agent. agent.pub now tracks whichever key is actually active, captured from the forwarded agent when one is live and from a new user.localSigningKey gitconfig setting otherwise.
  • Bootstrap now generates the git signing config (previously set up by hand on each machine). Four of the five settings are identical everywhere now that signingkey points at the agent.pub indirection; localSigningKey is discovered by looking for a .pub file under Secretive's PublicKeys directory, falling back to a placeholder when no key exists yet.

Test plan

  • Verified on phils-macbook-pro with a live forwarded connection from phils-macbook-neo: a commit signed there resolves to GitHub@secretive.Phil's-MacBook-Neo.local, confirmed via git log --show-signature.
  • Confirmed a freshly spawned process (new Terminal window) inherits the corrected SSH_AUTH_SOCK default without needing .zshrc to run.
  • Dry-ran the bootstrap template substitution against this machine's real Secretive key path and confirmed it produces the same config already in use.
  • Bootstrap a new machine (or simulate by removing git/gitconfig.local.symlink) and confirm setup_gitconfig produces a working config, including the no-key-yet placeholder path.

haacked added 3 commits July 7, 2026 16:40
The LaunchAgent previously set the session-wide SSH_AUTH_SOCK default
straight to Secretive's socket, so any process that never sources
.zshrc (GUI apps, tools that spawn non-interactive shells, including
Claude Code's own tool calls) stayed on the local agent even with a
live forwarded connection. Now it points at the same stable symlink
zshrc.symlink uses, seeding it to the local socket on first run in
case no shell has initialized it yet.
git commit -S needs the exact public key to ask the agent for, and
signingkey was hardcoded per machine, so signing only ever worked
with whichever key happened to live on that specific host, even when
SSH_AUTH_SOCK correctly pointed at a forwarded agent. Now agent.pub
tracks whichever key is actually active, captured from the forwarded
agent when one is live and from user.localSigningKey (a new,
machine-specific gitconfig setting) otherwise. user.signingkey then
points at agent.pub instead of a fixed key file.
signingkey and the gpg/commit sections were previously set up by hand
on each machine outside of bootstrap. Four of those five settings are
now identical everywhere (signingkey points at the agent.pub
indirection rather than a fixed key file), so the template bakes them
in directly. localSigningKey is the one value that's genuinely
machine-specific: bootstrap finds it by looking for a .pub file under
Secretive's PublicKeys directory, falling back to a placeholder with
instructions when no key exists yet.
@haacked
haacked requested a review from Copilot July 7, 2026 23:49
@haacked
haacked marked this pull request as ready for review July 7, 2026 23:49

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@haacked
haacked merged commit aa66f5e into main Jul 8, 2026
1 check passed
@haacked
haacked deleted the haacked/agent-sock-launchd-fix branch July 8, 2026 00:49
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