Skip to content

fix(skills): hard-code /tmp instead of $TMPDIR in worktree recipes - #559

Merged
max-sixty merged 1 commit into
mainfrom
hourly/review-26021501392
May 18, 2026
Merged

max-sixty merged 1 commit into
mainfrom
hourly/review-26021501392

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

The nightly, running-in-ci, and review-runs skills tell the bot to do work in a worktree under $TMPDIR. GitHub Actions runners leave $TMPDIR unset, so the recipe expands "$TMPDIR/tend-update-workflows" to "/tend-update-workflows", which git worktree add rejects with fatal: could not create leading directories of '/tend-update-workflows/.git': Permission denied. Hard-code /tmp instead, with a one-line explanation in each skill so a future maintainer doesn't reintroduce $TMPDIR.

Why

cargo-affected-bot hit this twice on consecutive nights running the bundled nightly skill:

  • run 26020369573 (2026-05-18) — git worktree add "$TMPDIR/tend-update-workflows" failed; the subsequent cd failed; uvx tend@latest init ran in the main checkout and wrote workflow changes that the bot then had to git checkout -- .github/workflows to revert.
  • run 25984436621 (2026-05-17) — same shape, recovered by export TMPDIR=/tmp and rerunning the recipe.

Both runs eventually produced the correct PR, but each one burned bash cycles and tokens on the recovery dance, and the first one polluted the main checkout in passing. The fallback "succeeded" only because nothing was committed before the revert — a slightly different recipe ordering would have shipped a broken workflows update.

The same $TMPDIR pattern in running-in-ci and review-runs is unexercised so far this month but would fail identically the first time a bot tries to update a .claude/skills/ file under those recipes.

$TMPDIR was introduced as "the tempdir env var" in #216, #219, and #328, apparently from local shells where it was set. GHA's ubuntu-latest does not set it.

Evidence gist: https://gist.github.com/da54a63f2b2042b0c3db2fd971a90a87

What changes

  • plugins/tend-ci-runner/skills/nightly/SKILL.md — workflow-regen recipe writes to /tmp/tend-update-workflows, /tmp/tend-old-ver, /tmp/tend-update-body.md. Updated prose links the worktree to /tmp and notes why $TMPDIR is not used.
  • plugins/tend-ci-runner/skills/running-in-ci/SKILL.md — skill-PR recipe writes to /tmp/skill-fix. Same prose update.
  • plugins/tend-ci-runner/skills/review-runs/SKILL.md — skill-edit recipe writes to /tmp/review-runs-fix. Same prose update.

Only the three skill recipes change. No script or workflow changes.

Test plan

  • CI on this PR passes (pre-commit, actionlint).
  • Next nightly run on a consumer regenerates workflows from /tmp/tend-update-workflows without the Permission denied stumble or the git checkout -- .github/workflows recovery step.

GitHub Actions runners leave $TMPDIR unset, so the nightly, running-in-ci,
and review-runs worktree recipes expand "$TMPDIR/foo" to "/foo" and fail
at `git worktree add` with `Permission denied`. Hard-code /tmp and explain
the trap inline so a future maintainer doesn't reintroduce $TMPDIR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label May 18, 2026
@max-sixty
max-sixty merged commit 8c3fef7 into main May 18, 2026
4 checks passed
@max-sixty
max-sixty deleted the hourly/review-26021501392 branch May 18, 2026 14:20
@max-sixty max-sixty mentioned this pull request May 19, 2026
3 tasks
max-sixty added a commit that referenced this pull request May 19, 2026
## Summary

Release 0.0.25. 8 PRs since 0.0.24:

- #566 review: push fixes to bot PRs by default, even when the fix needs
a judgment call
- #563 skills(running-tend): drop stale session-log count
- #562 skills: drop dollar-amount cost asides corrupted by arg
substitution
- #526 fix(list-recent-runs): anchor completion window to the intended
cron tick
- #559 fix(skills): hard-code /tmp instead of $TMPDIR in worktree
recipes
- #560 fix(enrich-tend-outage-issues): batch into one comment per issue
- #557 config: switch review-reviewers back to claude, demote
codex-auth-refresh to reference
- #556 config: switch tend's own harness back to claude

#566 is the reason for cutting now: it flips the bot-PR review default
from "push only mechanical fixes" to "push the fix whenever the review
can articulate it, defer only when no defensible default exists." The
behavior is release-gated, so it only reaches tend's own dogfooded
workflows (and adopters like PRQL) once 0.0.25 is published and the
nightly regen repins the action ref.

No new breaking changes since 0.0.24.

## Test plan

- [ ] CI green (test, test-worker, lint)
- [ ] After merge: tag `0.0.25`, PyPI publish (`pypi-release.yaml` on
the tag push), `uvx tend@0.0.25 --help` works
- [ ] Regenerate tend's own workflows to `@0.0.25` (separate `chore:
regenerate` PR, after the tag exists)

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants