Repository navigation
fix: give the sandbox a private XDG_RUNTIME_DIR instead of the runner's - #1697
Merged
Merged
Conversation
The runner's /run/user/1001 is a 0700 directory the sandbox user cannot open, so tools that create runtime objects there (the .NET SDK's first-run mutex) failed. The sandbox now gets a 0700 directory it owns. Closes #1696
This was referenced Nov 17, 2026
max-sixty
pushed a commit
that referenced
this pull request
Nov 17, 2026
… a green suite (#1703) Inside a `tend-triage` session, 37 tests in `shared/steps` fail on a clean checkout. The triage matrix job sets `TEND_ISSUE_NUMBER`, the sandbox inherits it, and [`subject_number()`](https://github.com/max-sixty/tend/blob/main/generator/src/tend/runtime/shared/_common.py) reads it before the event payload. So every test that builds an event and checks which thread a step acts on gets the session's issue number instead, e.g. `assert 1696 is None` and `assert 1696 == 851`. This PR adds an autouse fixture to the root `conftest.py` that removes the variable before each test. The tests that exercise the matrix path set it themselves with `monkeypatch.setenv`, so they keep their coverage. CI never sets the variable, so it stays green either way. The cost is in triage sessions, which run these suites while repairing an issue. AGENTS.md tells them that a failure beyond the two network-bound `test_refresh_consumers.py` tests is real, so every triage run that touches the runtime either chases 37 false failures or has to work out for itself that they're spurious. Triage run 43829170062 (#1696 → #1697) did the second: it reran without its change, saw the same 37, and moved on. Verification: with `TEND_ISSUE_NUMBER=1696` set, `pytest shared/steps proxy` gives 37 failed / 289 passed before the change and 326 passed after. The full suite with the variable set fails only the two network tests (those need DNS, which the sandbox doesn't have). The pre-commit hooks pass on `conftest.py`. <details><summary>Failing tests before the change, with the variable set</summary> | File | Failures | |---|---| | `shared/steps/test_common.py` | 7 | | `shared/steps/test_issue.py` | 12 | | `shared/steps/test_mark_notification_read.py` | 15 | | `shared/steps/test_token_usage.py` | 3 | </details> Co-authored-by: tend-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 18, 2026
Bumps generator version to 0.3.27 and syncs lockfile. 8 commits since 0.3.26: nightly restarts stalled CI causes and weekly restarts other unfinished issues (#1688), review-runs drains outage trackers the bot closed (#1700), nightly files unfixed reachable defects as issues (#1699), the sandbox gets its own XDG_RUNTIME_DIR (#1697), comment and test fixes (#1701, #1702, #1703), and the 0.3.26 regeneration (#1695).
max-sixty
pushed a commit
to max-sixty/worktrunk
that referenced
this pull request
Nov 18, 2026
Updates the generated Tend workflows from 0.3.26 to 0.3.27. The workflow diff only bumps the version pins on `max-sixty/tend/claude` and `setup-runtime`; the changes below ship in those actions and their bundled skills ([compare](max-sixty/tend@0.3.26...0.3.27)). What changes for this repo: - **Stalled issues get picked up again.** Nightly now runs the open-work checks that used to live in review-runs. It restarts any open `tend-ci-cause` issue with no other assignee, no queued or running Tend run, and no open PR that would close it. Weekly reads the other open issues where the bot commented last and decides which ones need follow-up (max-sixty/tend#1688). - **Nightly files the bugs it doesn't fix.** A reachable defect the sweep finds but can't fix becomes an issue, or a comment on an existing one, instead of a line in the step summary (max-sixty/tend#1699). - **Outage trackers closed by other sessions still get drained.** Review-runs now marks the trackers it drains, so it still reads the run rows of a `tend-outage` tracker that a nightly or triage session closed (max-sixty/tend#1700). - **The sandbox gets its own `XDG_RUNTIME_DIR`.** It used to inherit the runner's directory, which the sandbox user can't open (max-sixty/tend#1697). Co-authored-by: worktrunk-bot <[email protected]>
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.
The sandbox inherited the runner's
XDG_RUNTIME_DIR=/run/user/1001. That directory is0700and owned byrunner, so the agent (tend-sandbox, uid 1002) can't open it. The .NET SDK's first run creates a named mutex there, so on a fresh home everydotnet new/build/runfailed withAccess to the path '/run/user/1001' is denied. The agent environment now setsXDG_RUNTIME_DIR=/home/tend-sandbox/xdg-runtime.prepare_agent_homecreates that directory as the sandbox user with mode0700, the only mode .NET accepts.launch_agent.pydoesn't override the name, so the value reaches the session unchanged.Verification, run in a tend session with .NET on PATH and a fresh home:
dotnet new consolefails with the inherited value and restores successfully withXDG_RUNTIME_DIRpointing at amkdir -m 700directory under/home/tend-sandbox. The home's default ACL still gives the new directoryst_mode0700, since the mask drops to---. The unit test checks the assignment.proxy/test-setup-sandbox.shnow checks the agent env file, the directory's mode and owner, and the value inside the launched Claude unit.Closes #1696 — automated triage