pr-merge.sh (and its regression test) hardcoded /home/hermes/agent-work as the AGENT_WORK_ROOT fallback — one operator's home dir baked into a framework tool. Any other user (e.g. jarvis) hits:
on every merge, and --skip-queue-guard does not avoid it (the failing mkdir is in the API/tea-error path, not the queue guard). Hit live while merging #552.
Fix
Default to ${AGENT_WORK_ROOT:-${HOME:-/tmp}/mosaic/agent-work}:
Per-user isolated — resolves to /home/<user>/mosaic/agent-work, no cross-user collision or permission errors.
Separation of concerns — ~/.config/mosaic stays framework config (overwritten on upgrade); ~/mosaic holds runtime work artifacts.
Unset-HOME safety — falls back to /tmp for systemd/CI contexts where $HOME may be empty (an empty HOME would otherwise yield /mosaic/agent-work → root).
An explicit AGENT_WORK_ROOT still overrides everything.
5 occurrences across 2 files (pr-merge.sh ×4, test-pr-merge-gitea-empty-uid.sh ×1). All operator-agnostic.
Validation
bash -n clean on both files.
Regression test test-pr-merge-gitea-empty-uid.sh passes.
Verified all three resolution paths: HOME set → $HOME/mosaic/agent-work; HOME unset → /tmp/mosaic/agent-work; AGENT_WORK_ROOT set → honored.
## Problem
`pr-merge.sh` (and its regression test) hardcoded `/home/hermes/agent-work` as the `AGENT_WORK_ROOT` fallback — one operator's home dir baked into a framework tool. Any other user (e.g. `jarvis`) hits:
```
mkdir: cannot create directory '/home/hermes': Permission denied
```
on every merge, and `--skip-queue-guard` does **not** avoid it (the failing `mkdir` is in the API/tea-error path, not the queue guard). Hit live while merging #552.
## Fix
Default to `${AGENT_WORK_ROOT:-${HOME:-/tmp}/mosaic/agent-work}`:
- **Per-user isolated** — resolves to `/home/<user>/mosaic/agent-work`, no cross-user collision or permission errors.
- **Separation of concerns** — `~/.config/mosaic` stays framework config (overwritten on upgrade); `~/mosaic` holds runtime work artifacts.
- **Unset-HOME safety** — falls back to `/tmp` for systemd/CI contexts where `$HOME` may be empty (an empty HOME would otherwise yield `/mosaic/agent-work` → root).
- An explicit `AGENT_WORK_ROOT` still overrides everything.
5 occurrences across 2 files (`pr-merge.sh` ×4, `test-pr-merge-gitea-empty-uid.sh` ×1). All operator-agnostic.
## Validation
- `bash -n` clean on both files.
- Regression test `test-pr-merge-gitea-empty-uid.sh` passes.
- Verified all three resolution paths: HOME set → `$HOME/mosaic/agent-work`; HOME unset → `/tmp/mosaic/agent-work`; `AGENT_WORK_ROOT` set → honored.
pr-merge.sh and its regression test hardcoded /home/hermes/agent-work as
the AGENT_WORK_ROOT fallback, baking in one operator's home dir. Any other
user (e.g. jarvis) hit 'mkdir: cannot create directory /home/hermes:
Permission denied' on merge, and --skip-queue-guard did not avoid it (the
mkdir is in the API/tea-error path, not the guard).
Default to ${HOME:-/tmp}/mosaic/agent-work instead: per-user isolated,
kept separate from the framework's ~/.config/mosaic config tree, with a
/tmp last-ditch fallback for unset-HOME contexts (systemd/CI). An explicit
AGENT_WORK_ROOT still overrides. 5 occurrences across 2 files.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
pr-merge.sh(and its regression test) hardcoded/home/hermes/agent-workas theAGENT_WORK_ROOTfallback — one operator's home dir baked into a framework tool. Any other user (e.g.jarvis) hits:on every merge, and
--skip-queue-guarddoes not avoid it (the failingmkdiris in the API/tea-error path, not the queue guard). Hit live while merging #552.Fix
Default to
${AGENT_WORK_ROOT:-${HOME:-/tmp}/mosaic/agent-work}:/home/<user>/mosaic/agent-work, no cross-user collision or permission errors.~/.config/mosaicstays framework config (overwritten on upgrade);~/mosaicholds runtime work artifacts./tmpfor systemd/CI contexts where$HOMEmay be empty (an empty HOME would otherwise yield/mosaic/agent-work→ root).AGENT_WORK_ROOTstill overrides everything.5 occurrences across 2 files (
pr-merge.sh×4,test-pr-merge-gitea-empty-uid.sh×1). All operator-agnostic.Validation
bash -nclean on both files.test-pr-merge-gitea-empty-uid.shpasses.$HOME/mosaic/agent-work; HOME unset →/tmp/mosaic/agent-work;AGENT_WORK_ROOTset → honored.pr-merge.sh and its regression test hardcoded /home/hermes/agent-work as the AGENT_WORK_ROOT fallback, baking in one operator's home dir. Any other user (e.g. jarvis) hit 'mkdir: cannot create directory /home/hermes: Permission denied' on merge, and --skip-queue-guard did not avoid it (the mkdir is in the API/tea-error path, not the guard). Default to ${HOME:-/tmp}/mosaic/agent-work instead: per-user isolated, kept separate from the framework's ~/.config/mosaic config tree, with a /tmp last-ditch fallback for unset-HOME contexts (systemd/CI). An explicit AGENT_WORK_ROOT still overrides. 5 occurrences across 2 files. Co-Authored-By: Claude Opus 4.8 <[email protected]>