Skip to content

fix(herdr): make PR merge shortcut worktree-safe - #64

Merged
furedea merged 3 commits into
mainfrom
fix/confirm-pr-auto-merge
Aug 29, 2026
Merged

furedea merged 3 commits into
mainfrom
fix/confirm-pr-auto-merge

Conversation

@furedea

@furedea furedea commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the inline auto-merge command with a Home Manager-managed helper
  • confirm immediate squash merge with Enter or Ctrl+M and cancel with Esc or Ctrl+C
  • use branch deletion only when the base branch is not checked out in another worktree
  • centralize shfmt switch-case indentation in EditorConfig

Verification

  • pre-commit formatting and lint hooks passed
  • executable Bats specifications cover confirmation, errors, and worktree behavior

Copilot AI lite review requested due to automatic review settings August 29, 2026 15:31

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@furedea
furedea merged commit 0572a31 into main Aug 29, 2026
11 checks passed
@furedea
furedea deleted the fix/confirm-pr-auto-merge branch August 29, 2026 15:54
furedea added a commit that referenced this pull request Nov 1, 2026
## Summary

Herdr のマージ popup(`prefix+ctrl+p`)から,不要になった `BASH_XTRACEFD=9` の設定と末尾の
`9>/dev/null` を削除します.

## 原因

- この設定は PR #64 の時点で入ったもので,当時 helper はシェルスクリプトでした.
- 現在の helper は `nix/home/default.nix` の `herdrMergeCommand`
で,`herdr/merge_pull_request.py` を exec します.
- Python の `subprocess` は子プロセスに対して fd 9 を閉じますが,環境変数 `BASH_XTRACEFD=9`
は引き継ぎます.
- 実行される `gh` は Nix の makeWrapper が作る bash スクリプトなので,bash が
`BASH_XTRACEFD: 9: invalid value for trace file descriptor` を `gh`
の呼び出しごとに出力していました(popup では 2 回).マージ自体は成功していました.

## 変更内容

- `herdr/config.toml`: `BASH_XTRACEFD=9 \` と `9>/dev/null`
を削除.`GH_BIN`,`GIT_BIN`,helper のパス,cwd 引数は変更していません.
- `tests/herdr/test_popup_command.py`: popup コマンドが `BASH_XTRACEFD` と
`9>` を含まないことを仕様化するテストを追加(修正前は失敗,修正後は成功を確認).

## 検証

- `uv run pytest tests/herdr`: 45 passed
- lefthook の pre-commit,commit-msg,pre-push が成功

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
furedea added a commit that referenced this pull request Nov 3, 2026
…383)

agent-browser(llm-agents 0.41.0)と agent-desktop(v1.1.0 の公式バイナリ)を Home
Manager で入れ,両 CLI が同梱する skill をビルド時に生成して agent-harness に渡す.あわせて
agent-config input を #63,#64,#65 を含む main に更新する.マージ後に switch
とアクセシビリティ許可の手動確認が必要.

Closes #377
計画:
#377 (comment)

## 変更前後

| 項目 | 変更前 | 変更後 |
| --- | --- | --- |
| `agent-browser` | 未導入 | llm-agents の 0.41.0 を `home.packages` に追加 |
| `AGENT_BROWSER_EXECUTABLE_PATH` | 未設定 | `zsh/.zshenv` で
`/Applications/Google Chrome.app/Contents/MacOS/Google Chrome`(Homebrew
cask) |
| `agent-desktop` | 未導入 | `nix/packages/agent_desktop.nix`(v1.1.0,hash
固定,`versionCheckHook`,Apache-2.0,binaryNativeCode) |
| skill | `herdr`,`nix-dotfiles` | `agent-browser`(`skills get
core`),`agent-desktop`(`skills get desktop` の `data.content`)を追加 |
| agent-config | 2f29423 | 3f2d578(承認ルールとサンドボックス除外を含む) |

## 確認結果

- [x] `nix flake check`: all checks passed
- [x] `nix build .#[email protected]
.#darwinConfigurations.mbp.system .#darwinConfigurations.mba.system`: 成功
- [x] 新しいチェック `agent-desktop-release`: ビルド時に `versionCheckHook` が
`agent-desktop --version` から 1.1.0 を確認
- [x] 新しいチェック `automation-cli-skills`: 生成された 2 つの skill の `name`
と本文を確認(ビルドのサンドボックス内で両 CLI ともネットワークや権限なしで出力できた)
- [x] `home-configuration` の契約追加: 両パッケージの導入,skill 名,Chrome パスと
`google-chrome` cask の対応
- [x] アーカイブの sha256 が upstream の `checksums.txt` と一致
- [x] shared verify(bats 9 件),lefthook
- [ ] CI

## マージ後の手動手順

1. `darwin-rebuild switch`(または Home Manager の switch)を実行し,新しいシェルを開く
2. agent-browser の初回確認: `agent-browser open https://example.com` →
`agent-browser snapshot -i`
3. agent-desktop を使うときだけ Ghostty にアクセシビリティ許可を付け,`agent-desktop snapshot
--app Finder -i` で確認し,終わったら許可を外す

<details>
<summary>判断事項・前提</summary>

- `agent-browser skills get core` の frontmatter は `name: core` なので,ビルド時に
2 行目だけ `name: agent-browser` に書き換え,結果を `grep` で確認している.upstream
の形式が変わるとビルドが失敗して気付ける
- agent-browser skill へのローカル注記(ファイル出力は素の `screenshot` / `screenshot
--full` 以外 ask,許可リスト外のオプションは ask)は,既存の skill 生成に追記の仕組みがないため入れていない.必要なら別途
- agent-desktop は macOS 用ガイド(`skills get platform`)を別 skill にせず,core
skill の手順どおり実行時に読み込ませる
- `AGENT_BROWSER_EXECUTABLE_PATH` は既存の `EDITOR` と同じく `zsh/.zshenv`
で設定した.zsh 以外から起動した場合は効かない
- agent-desktop の更新は手動(Renovate 対応なし)
- アーカイブに含まれる `agent-desktop-macos-helper` も `bin` に置いている

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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