Skip to content

feat(session): support HUNK_RUNTIME_DIR override - #1192

Open
nickryand wants to merge 1 commit into
modem-dev:mainfrom
nickryand:push-utozsqzypmqu
Open

nickryand wants to merge 1 commit into
modem-dev:mainfrom
nickryand:push-utozsqzypmqu

Conversation

@nickryand

Copy link
Copy Markdown

Summary

Allow users to choose where Hunk stores session runtime state and credentials with HUNK_RUNTIME_DIR. Hunk uses XDG_RUNTIME_DIR when the override is unset, then falls back to its existing default. This allows for the customization of the hunk runtime directory without affecting any other tools that use XDG_RUNTIME_DIR.

This belongs in core because it configures shared session-broker runtime behavior, not an optional extension workflow. No other behavior is intentionally changed.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@nickryand is attempting to deploy a commit to the Modem Team on Vercel.

A member of the Team first needs to authorize it.

@squad-joey squad-joey left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two test issues need attention at b4c3e224:

  1. The added test breaks typecheck. tsc --noEmit passes on base d8cd77bb, but head reports TS2339 at credentials.test.ts:53: HUNK_RUNTIME_DIR doesn't exist on the inferred return type of isolatedEnv(). Give the helper or its result an explicit NodeJS.ProcessEnv type.
  2. The credential fixtures inherit the new override. isolatedEnv() spreads process.env and sets only XDG_RUNTIME_DIR. With HUNK_RUNTIME_DIR already set, credentials are now created in that inherited directory rather than the temporary fixture. Using a synthetic ambient directory, the same credential test command passes all 4 tests on base but produces 2 passes / 3 failures on head: missing expected XDG files and a symlink-rejection test that unexpectedly resolves. Please clear the inherited override in the helper; the new precedence test can then set its own override explicitly.

A local, test-only experiment adding the return type and HUNK_RUNTIME_DIR: undefined to the helper made typecheck and all 5 credential tests pass with that synthetic ambient override. I restored the reviewed checkout afterward. This doesn't establish isolation for every other test helper that copies the environment.

The runtime selection itself behaved as intended in my checks: head uses the nonblank Hunk override ahead of XDG, while base ignores it; blank values fall back. Separately launched source daemons and authenticated session list clients agreed on the selected credential store.

Validation scope
  • Exact base d8cd77bbfc053bedbeeb049207effcd4ba86039c → head b4c3e224ace4f3fc40eace7b6d13e93fc47eac83; Linux x86_64, Bun 1.4.2, Node 24.14.1, frozen dependencies without lifecycle scripts.
  • Independent matrix: 14 cases per revision, covering default/XDG/override precedence, empty/blank/trimmed values, paths with spaces and relative paths, invalid directory, symlinked namespace, unsafe credential mode, and two actual daemon/CLI agreement cases. Only synthetic credential stores were used.
  • Unmodified focused credential/launcher/config/daemon tests: base 36 pass, head 37 pass, with no ambient override. Head's dedicated real-Node broker suite: 4 pass.
  • No full-suite, PTY interaction, installed-binary, macOS or Windows verification. The unmodified head's typecheck remains failing as described above.

This comment was generated by Pi using GPT-6.1 Sol

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants