feat!: remove tokenDir — one env mechanism, user-owned - #153
Merged
Conversation
The root-dropped /etc/agent-box/<user>.env unit-level EnvironmentFile is fully superseded by the user-owned ~/.config/agent-box/env, which the spawn wrapper re-reads at every session (re)start and which is writable through the settings page and `agent-box-session env set`. Carrying both meant two mechanisms with different application semantics (unit bounce vs next spawn), a root-owned state dir for the portability work to reimplement, and an empty-dir guard in the rename migration that anything touching /etc/agent-box could break. Removes the tokenDir and manageTokenDir options, the tmpfiles rules, the per-user EnvironmentFile entry, and the /etc/claude-box leg of the issue-70 rename migration that fed it. environmentFiles (global and per-user) stay for Nix-managed secret paths. BREAKING: existing /etc/agent-box/<user>.env files stop being loaded (no deployed boxes rely on this; re-add tokens with `agent-box-session env set KEY value` as the user). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KcxC9a8wWApTSdAxKfpkGs
The subtest still asserted /etc/claude-box moves into /etc/agent-box — the leg the previous commit removed. Assert the new contract instead: the old token dir stays behind untouched and nothing recreates /etc/agent-box, while the no-clobber web-state half is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KcxC9a8wWApTSdAxKfpkGs
lionello
approved these changes
Jul 29, 2026
Review feedback on #153: no deployed boxes predate the rename, so the issue-70 one-shot migration (and its sessions-test subtest) goes away entirely, and code comments stop referring to the removed tokenDir — that history lives in the PR/issue text instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KcxC9a8wWApTSdAxKfpkGs
Owner
Author
|
Addressed all three review comments in 3d5b98d: dropped the "former tokenDir" history from both code comments, and removed the issue-70 claude-box rename migration entirely (activation script + its sessions-test subtest) — another -87 lines. History stays here in the PR. |
This was referenced Jul 29, 2026
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.
Removes the root-dropped
tokenDir(/etc/agent-box/<user>.envunit-levelEnvironmentFile) now that the user-owned~/.config/agent-box/envcovers the same need end-to-end: written via the settings page oragent-box-session env set(#144), re-read by the spawn wrapper at every session (re)start — so tokens apply at next spawn with no unit bounce.Why drop it rather than keep both:
/etc/agent-box(the failure mode feat(sessions): kickoff prompts, resume-on-respawn, and full CLI parity #144's CI just hit).Removed:
tokenDir,manageTokenDir, the tmpfiles rules, the per-userEnvironmentFileentry, and the/etc/claude-boxleg of the issue-70 migration that fed it. Kept:environmentFiles(global + per-user) for Nix-managed secret paths (agenix/sops-nix). Docs +hosts/bare-metal.nixupdated to the new flow.BREAKING / no migration by design (no deployed boxes rely on the old path): any existing
/etc/agent-box/<user>.envstops being loaded after the next rebuild. Re-add with:If this box's own
GH_TOKENwas provisioned via tokenDir, re-add it the same way after self-updating.🤖 Generated with Claude Code
https://claude.ai/code/session_01KcxC9a8wWApTSdAxKfpkGs