Repository navigation
feat: Git SSH commit signing via bw-agent - #3
Merged
Merged
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…nt_exe configure_git_signing() was using std::env::current_exe() which returns bw-agent-desktop.exe — the wrong binary for git-sign. Now looks for bw-agent(.exe) as a sibling, with a dev-workspace fallback to the parent target/ directory.
- Add externalBin to tauri.conf.json pointing to binaries/bw-agent - Add scripts/stage-sidecar.mjs to copy CLI binary with target-triple suffix that Tauri requires (must run before cargo build) - Add release CI step: build CLI + copy to src-tauri/binaries/ with target triple suffix before tauri-action runs - Add pnpm stage-sidecar and tauri:dev scripts for local dev - Add .gitignore for src-tauri/binaries/ (build artifacts)
Git's gpg.ssh.program is a single pathname — it does not split on spaces. Using 'bw-agent.exe git-sign' caused 'No such file or directory'. Solution: create a hardlink named bw-agent-git-sign(.exe) that points to bw-agent(.exe). The binary detects 'git-sign' in argv[0] and routes to the signing code path automatically (busybox pattern). - main.rs: argv[0] detection before clap parsing - git_sign.rs: add run_from_args() for positional arg parsing - commands.rs: ensure_git_sign_binary() creates hardlink at configure time - tauri.conf.json: externalBin includes both binaries - stage-sidecar.mjs & CI: create git-sign hardlink alongside sidecar
Tauri's build script validates externalBin paths exist. Without staging the sidecar binaries first, both cargo clippy (check job) and cargo test (test job) fail because the binaries directory is empty. The stage-sidecar.mjs script now auto-builds bw-agent if the binary is not found locally.
The bw-agent.exe sidecar was redundant — bw-agent-git-sign.exe is already a full copy of the CLI binary with argv[0] detection routing to the git-sign code path. Git only needs gpg.ssh.program to point to a single executable, so the extra sidecar served no purpose. Changes: - tauri.conf.json: remove binaries/bw-agent from externalBin - stage-sidecar.mjs: copy directly as bw-agent-git-sign-<triple> - commands.rs: simplify ensure_git_sign_binary() — just locate the sidecar, no runtime hardlink creation needed - release.yml: copy as git-sign name directly, no hardlink step
When git signs a commit via bw-agent-git-sign, the process chain contains the git-sign binary, not an SSH connection. Detect this pattern and display operation as 'git sign' instead of 'ssh'.
Instead of hardcoded target 'commit', extract the actual git subcommand (commit/tag/merge) from the parent process and show the working directory as the target.
Merged
5 tasks done
Reamd7
added a commit
that referenced
this pull request
Apr 21, 2026
…7-#9, #11-#13, #15, #16) (#4) * fix: v0.2.0 stability fixes - tray lock, approval timeout, token refresh, panic recovery - Wire tray Lock menu to vault lock logic (was disabled placeholder) - Add 30s timeout to SSH approval requests (prevents indefinite agent hang) - Implement token refresh before sync_vault in Reunlock, periodic sync, and manual sync paths - Replace 3x expect(lock poisoned) with graceful mutex recovery * fix: robustness improvements - silent failures, panic guards, configurable timeouts - Log dropped approval responses instead of silently discarding - Log DB migration failures instead of silently ignoring - Wrap access_log.record in spawn_blocking to prevent tokio thread starvation - Add Keys length assertion to prevent slice panics on malformed data - Consolidate sequential mutex locks in auth.rs ensure_unlocked - Add warning logs for all event emission failures (8 locations) - Add debug logs for decryption failures in key listing - Extract approval timeout and login retry count to Config - Reduce state lock hold time in ssh_agent.rs by snapshotting state - Graceful fallback for region::lock failure instead of unwrap panic - Log Unix socket cleanup failure - Extract SYNC_INTERVAL_TICKS constant replacing magic number * docs: update roadmap with v0.2.0 and v0.2.1 completion status * fix: add 32-bit Windows PEB offset support, mark roadmap items #8 #9 done - Replace hardcoded 64-bit PEB offsets with runtime pointer-size detection - #9 SSH op parsing already covers git sign, ls-remote, plain SSH beyond the 3 map entries * fix: add panic handler for crash logging, mark roadmap #11 #12 - Install std::panic::set_hook that writes crash.log with timestamp and panic message - #11 git config parsing evaluated as acceptable for current use case - #12 crash dump now writes to LOCALAPPDATA/bw-agent/crash.log * fix: expand process lists, use globset for pattern matching, update roadmap - Add tmux/docker/vscode/node/python/cargo etc to process black/whitelists - Replace hand-written glob with globset crate for standard ** and [a-z] support - Roadmap: #15 #16 fixed, #11 accepted, #17 already absent * chore: update Cargo.lock for globset dependency * fix: remove String::display() call on Unix-only code path
Reamd7
added a commit
that referenced
this pull request
Apr 22, 2026
* chore: rename app title to 'Bitwarden Agent' and show main window on launch * feat: add clap CLI with git-sign subcommand stub * feat: implement git-sign with sign/verify/find-principals/check-novalidate * feat: add git signing Tauri commands and settings UI Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * fix: align Unix socket path resolution with server (BW_SOCKET_PATH priority) * feat: implement match-principals for complete -Y subcommand coverage * fix: resolve bw-agent.exe path for git signing instead of using current_exe configure_git_signing() was using std::env::current_exe() which returns bw-agent-desktop.exe — the wrong binary for git-sign. Now looks for bw-agent(.exe) as a sibling, with a dev-workspace fallback to the parent target/ directory. * feat: bundle bw-agent CLI as Tauri sidecar for git signing - Add externalBin to tauri.conf.json pointing to binaries/bw-agent - Add scripts/stage-sidecar.mjs to copy CLI binary with target-triple suffix that Tauri requires (must run before cargo build) - Add release CI step: build CLI + copy to src-tauri/binaries/ with target triple suffix before tauri-action runs - Add pnpm stage-sidecar and tauri:dev scripts for local dev - Add .gitignore for src-tauri/binaries/ (build artifacts) * fix: use hardlink for gpg.ssh.program instead of space-separated args Git's gpg.ssh.program is a single pathname — it does not split on spaces. Using 'bw-agent.exe git-sign' caused 'No such file or directory'. Solution: create a hardlink named bw-agent-git-sign(.exe) that points to bw-agent(.exe). The binary detects 'git-sign' in argv[0] and routes to the signing code path automatically (busybox pattern). - main.rs: argv[0] detection before clap parsing - git_sign.rs: add run_from_args() for positional arg parsing - commands.rs: ensure_git_sign_binary() creates hardlink at configure time - tauri.conf.json: externalBin includes both binaries - stage-sidecar.mjs & CI: create git-sign hardlink alongside sidecar * fix: read data from stdin when git verify omits data file * style: cargo fmt * fix(ci): stage sidecar binaries before clippy and test Tauri's build script validates externalBin paths exist. Without staging the sidecar binaries first, both cargo clippy (check job) and cargo test (test job) fail because the binaries directory is empty. The stage-sidecar.mjs script now auto-builds bw-agent if the binary is not found locally. * refactor: drop standalone bw-agent.exe sidecar, keep only git-sign The bw-agent.exe sidecar was redundant — bw-agent-git-sign.exe is already a full copy of the CLI binary with argv[0] detection routing to the git-sign code path. Git only needs gpg.ssh.program to point to a single executable, so the extra sidecar served no purpose. Changes: - tauri.conf.json: remove binaries/bw-agent from externalBin - stage-sidecar.mjs: copy directly as bw-agent-git-sign-<triple> - commands.rs: simplify ensure_git_sign_binary() — just locate the sidecar, no runtime hardlink creation needed - release.yml: copy as git-sign name directly, no hardlink step * fix(ui): show git sign operation in logs instead of ssh When git signs a commit via bw-agent-git-sign, the process chain contains the git-sign binary, not an SSH connection. Detect this pattern and display operation as 'git sign' instead of 'ssh'. * fix(ui): show git subcommand and cwd for signing log entries Instead of hardcoded target 'commit', extract the actual git subcommand (commit/tag/merge) from the parent process and show the working directory as the target. --------- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Reamd7
added a commit
that referenced
this pull request
Apr 22, 2026
…7-#9, #11-#13, #15, #16) (#4) * fix: v0.2.0 stability fixes - tray lock, approval timeout, token refresh, panic recovery - Wire tray Lock menu to vault lock logic (was disabled placeholder) - Add 30s timeout to SSH approval requests (prevents indefinite agent hang) - Implement token refresh before sync_vault in Reunlock, periodic sync, and manual sync paths - Replace 3x expect(lock poisoned) with graceful mutex recovery * fix: robustness improvements - silent failures, panic guards, configurable timeouts - Log dropped approval responses instead of silently discarding - Log DB migration failures instead of silently ignoring - Wrap access_log.record in spawn_blocking to prevent tokio thread starvation - Add Keys length assertion to prevent slice panics on malformed data - Consolidate sequential mutex locks in auth.rs ensure_unlocked - Add warning logs for all event emission failures (8 locations) - Add debug logs for decryption failures in key listing - Extract approval timeout and login retry count to Config - Reduce state lock hold time in ssh_agent.rs by snapshotting state - Graceful fallback for region::lock failure instead of unwrap panic - Log Unix socket cleanup failure - Extract SYNC_INTERVAL_TICKS constant replacing magic number * docs: update roadmap with v0.2.0 and v0.2.1 completion status * fix: add 32-bit Windows PEB offset support, mark roadmap items #8 #9 done - Replace hardcoded 64-bit PEB offsets with runtime pointer-size detection - #9 SSH op parsing already covers git sign, ls-remote, plain SSH beyond the 3 map entries * fix: add panic handler for crash logging, mark roadmap #11 #12 - Install std::panic::set_hook that writes crash.log with timestamp and panic message - #11 git config parsing evaluated as acceptable for current use case - #12 crash dump now writes to LOCALAPPDATA/bw-agent/crash.log * fix: expand process lists, use globset for pattern matching, update roadmap - Add tmux/docker/vscode/node/python/cargo etc to process black/whitelists - Replace hand-written glob with globset crate for standard ** and [a-z] support - Roadmap: #15 #16 fixed, #11 accepted, #17 already absent * chore: update Cargo.lock for globset dependency * fix: remove String::display() call on Unix-only code path
Reamd7
added a commit
that referenced
this pull request
Apr 22, 2026
* chore: rename app title to 'Bitwarden Agent' and show main window on launch * feat: add clap CLI with git-sign subcommand stub * feat: implement git-sign with sign/verify/find-principals/check-novalidate * feat: add git signing Tauri commands and settings UI Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * fix: align Unix socket path resolution with server (BW_SOCKET_PATH priority) * feat: implement match-principals for complete -Y subcommand coverage * fix: resolve bw-agent.exe path for git signing instead of using current_exe configure_git_signing() was using std::env::current_exe() which returns bw-agent-desktop.exe — the wrong binary for git-sign. Now looks for bw-agent(.exe) as a sibling, with a dev-workspace fallback to the parent target/ directory. * feat: bundle bw-agent CLI as Tauri sidecar for git signing - Add externalBin to tauri.conf.json pointing to binaries/bw-agent - Add scripts/stage-sidecar.mjs to copy CLI binary with target-triple suffix that Tauri requires (must run before cargo build) - Add release CI step: build CLI + copy to src-tauri/binaries/ with target triple suffix before tauri-action runs - Add pnpm stage-sidecar and tauri:dev scripts for local dev - Add .gitignore for src-tauri/binaries/ (build artifacts) * fix: use hardlink for gpg.ssh.program instead of space-separated args Git's gpg.ssh.program is a single pathname — it does not split on spaces. Using 'bw-agent.exe git-sign' caused 'No such file or directory'. Solution: create a hardlink named bw-agent-git-sign(.exe) that points to bw-agent(.exe). The binary detects 'git-sign' in argv[0] and routes to the signing code path automatically (busybox pattern). - main.rs: argv[0] detection before clap parsing - git_sign.rs: add run_from_args() for positional arg parsing - commands.rs: ensure_git_sign_binary() creates hardlink at configure time - tauri.conf.json: externalBin includes both binaries - stage-sidecar.mjs & CI: create git-sign hardlink alongside sidecar * fix: read data from stdin when git verify omits data file * style: cargo fmt * fix(ci): stage sidecar binaries before clippy and test Tauri's build script validates externalBin paths exist. Without staging the sidecar binaries first, both cargo clippy (check job) and cargo test (test job) fail because the binaries directory is empty. The stage-sidecar.mjs script now auto-builds bw-agent if the binary is not found locally. * refactor: drop standalone bw-agent.exe sidecar, keep only git-sign The bw-agent.exe sidecar was redundant — bw-agent-git-sign.exe is already a full copy of the CLI binary with argv[0] detection routing to the git-sign code path. Git only needs gpg.ssh.program to point to a single executable, so the extra sidecar served no purpose. Changes: - tauri.conf.json: remove binaries/bw-agent from externalBin - stage-sidecar.mjs: copy directly as bw-agent-git-sign-<triple> - commands.rs: simplify ensure_git_sign_binary() — just locate the sidecar, no runtime hardlink creation needed - release.yml: copy as git-sign name directly, no hardlink step * fix(ui): show git sign operation in logs instead of ssh When git signs a commit via bw-agent-git-sign, the process chain contains the git-sign binary, not an SSH connection. Detect this pattern and display operation as 'git sign' instead of 'ssh'. * fix(ui): show git subcommand and cwd for signing log entries Instead of hardcoded target 'commit', extract the actual git subcommand (commit/tag/merge) from the parent process and show the working directory as the target. --------- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Reamd7
added a commit
that referenced
this pull request
Apr 22, 2026
…7-#9, #11-#13, #15, #16) (#4) * fix: v0.2.0 stability fixes - tray lock, approval timeout, token refresh, panic recovery - Wire tray Lock menu to vault lock logic (was disabled placeholder) - Add 30s timeout to SSH approval requests (prevents indefinite agent hang) - Implement token refresh before sync_vault in Reunlock, periodic sync, and manual sync paths - Replace 3x expect(lock poisoned) with graceful mutex recovery * fix: robustness improvements - silent failures, panic guards, configurable timeouts - Log dropped approval responses instead of silently discarding - Log DB migration failures instead of silently ignoring - Wrap access_log.record in spawn_blocking to prevent tokio thread starvation - Add Keys length assertion to prevent slice panics on malformed data - Consolidate sequential mutex locks in auth.rs ensure_unlocked - Add warning logs for all event emission failures (8 locations) - Add debug logs for decryption failures in key listing - Extract approval timeout and login retry count to Config - Reduce state lock hold time in ssh_agent.rs by snapshotting state - Graceful fallback for region::lock failure instead of unwrap panic - Log Unix socket cleanup failure - Extract SYNC_INTERVAL_TICKS constant replacing magic number * docs: update roadmap with v0.2.0 and v0.2.1 completion status * fix: add 32-bit Windows PEB offset support, mark roadmap items #8 #9 done - Replace hardcoded 64-bit PEB offsets with runtime pointer-size detection - #9 SSH op parsing already covers git sign, ls-remote, plain SSH beyond the 3 map entries * fix: add panic handler for crash logging, mark roadmap #11 #12 - Install std::panic::set_hook that writes crash.log with timestamp and panic message - #11 git config parsing evaluated as acceptable for current use case - #12 crash dump now writes to LOCALAPPDATA/bw-agent/crash.log * fix: expand process lists, use globset for pattern matching, update roadmap - Add tmux/docker/vscode/node/python/cargo etc to process black/whitelists - Replace hand-written glob with globset crate for standard ** and [a-z] support - Roadmap: #15 #16 fixed, #11 accepted, #17 already absent * chore: update Cargo.lock for globset dependency * fix: remove String::display() call on Unix-only code path
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
bw-agent git-signas a drop-in replacement forssh-keygen -Y, supporting all 5 subcommands: sign, verify, find-principals, match-principals, check-novalidategpg.ssh.program,gpg.format, andcommit.gpgsignvia one-click button, with per-item validation (program path, format, signing enabled)bw-agentCLI as Tauri sidecar (externalBin) with CI staging step, including abw-agent-git-signhardlink that uses argv[0] detection (busybox pattern) since git'sgpg.ssh.programonly accepts a single executable pathImplementation Details
CLI (
crates/bw-agent/src/git_sign.rs, 623 lines)ssh_key::SshSig+ SSH agent (ssh_agent_lib)run_from_args()for argv[0] detection path, clap subcommand for explicitgit-signpathPackaging
tauri.conf.json:externalBinincludes bothbw-agentandbw-agent-git-signscripts/stage-sidecar.mjs: copies CLI binary with target-triple suffix + creates hardlink.github/workflows/release.yml: builds CLI and stages both binaries beforetauri-actionSettings UI
signChecks()component for yellow (not configured) and green (configured) statesensure_git_sign_binary()creates hardlink at runtime if missingTesting
scripts/test-git-sign-cli.ps1git commit -S+git verify-commitconfirmed good signature