Commit 7eedcdc
authored
fix: use absolute paths in --allowedTools for sensitive file editing (Refs: beans-huwr) (#166)
## Summary
- Agent sessions in act mode were still getting permission prompts when
editing `.claude/rules/*` and `CLAUDE.md` files, despite the fix in #164
- **Root cause:** `--allowedTools` patterns used relative globs (e.g.
`Edit(.claude/**)`) but Claude Code's Edit/Write tools operate on
absolute file paths, so the patterns never matched
- Fix: construct patterns using `session.WorkDir` (e.g.
`Edit(/path/to/workdir/.claude/**)`) and pass each with its own
`--allowedTools` flag
## Test plan
- [ ] `mise build` and spawn an agent in act mode via Beans UI
- [ ] Have it edit a `.claude/rules/*.md` file — should succeed without
permission prompts
- [ ] Verify `mise test` passes1 parent 8999234 commit 7eedcdc
3 files changed
Lines changed: 42 additions & 32 deletions
File tree
- .beans
- internal/agent
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
827 | 834 | | |
828 | 835 | | |
829 | 836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
| 773 | + | |
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
807 | 799 | | |
808 | | - | |
809 | 800 | | |
810 | | - | |
811 | | - | |
812 | | - | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
813 | 804 | | |
814 | 805 | | |
815 | 806 | | |
| |||
0 commit comments