Skip to content

fix(orcad): run the remote daemon at the login umask so worktrees it creates are not owner-only - #31135

Merged
nwparker merged 4 commits into
mainfrom
bug-remote-orcad-runs-with-umask-077-so-worktree
Oct 20, 2026
Merged

nwparker merged 4 commits into
mainfrom
bug-remote-orcad-runs-with-umask-077-so-worktree

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​38
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​27 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13

ELI5

When Orca starts its server on an SSH machine, it told the server "make every file you create private to you". That was meant for one small file holding a login token. But the server passes that rule on to everything it runs, including git. So worktrees Orca created came out readable only by you. A Docker container running as a different user, for example, could not read them. Now only the token file and its neighbours stay private. The server, and everything it runs, creates files the way your normal shell would.

What Changed

Before: the launch command on the SSH host ran umask 077 and then started orcad from that same shell. orcad kept umask 077 for its whole life, and so did everything it spawned: git worktree add, the terminal daemon, terminal shells and agents. Every file and directory in a worktree Orca created was 0600/0700, while a hand-made clone on the same host was 0644/0755. Hosts whose /etc/bashrc resets the umask hid this in terminals. On hosts that don't (Debian/Ubuntu), terminal shells were 077 too.

After: orcadLaunchCommand (src/main/managed-server/install/orcad-remote-launch.ts) saves the login umask first, then tightens to 077 exactly as before. Only the daemon process gets the login umask back:

  • SSH (nohup) launch: the daemon starts inside { umask "$orcad_login_umask" && … exec nohup …; } > readiness 2>> log &. The shell opens the readiness and log redirects before the group runs, so they are still created under 077. Only the program the group starts gets the login umask.
  • WSL (setsid) launch: the child script writes the PID file first, then runs umask "$2" before starting the daemon.

The readiness file (which holds the pairing token), the log, the PID file, the slot directory and ~/.orca-remote keep their owner-only modes.

Byte budget: the launch command is one of the host commands already over the 6 KB exec budget (gateways cut exec requests near 10 KB, #30491), and its ceiling may only shrink. To pay for the two umask steps, the readiness, log and stop-request files are now named relative to the cd into the slot that already comes before every use. The PID file stays absolute, because the SSH launch backgrounds the whole chain, cd included, and writes the PID from outside it. The entry path stays absolute because the liveness check matches it in ps output. Net: the SSH launch ceiling drops from 8,122 to 7,130 bytes, and the WSL launch now fits under the budget, so it leaves the over-budget list.

Secret files audit. Once orcad stops inheriting 077, any secret it writes outside its data root without an explicit mode would come out readable by others. (The data root, ~/.orca, is forced to 0700 at startup, so files inside it are protected either way.) The audit found two:

  • ~/.gemini/oauth_creds.json. When usage tracking refreshes Gemini's OAuth tokens, it rewrote this file through a temp file and a rename, with no mode set. The rename replaces Gemini's own 0600 file, so the new file took the process umask: 0600 on SSH hosts only because of the old 077, and 0644 at a 022 login umask. It now goes through the existing writeCredentialFileAtomic, which stages the file at 0600 (owner-only ACL on Windows) and fsyncs it before the rename (src/main/rate-limits/gemini-oauth-sources.ts).

  • Agent config files that Orca rewrites to install its hooks, such as ~/.claude/settings.json, which can hold API keys. writeHooksJson writes a temp file and renames it into place. It kept the existing file's mode only when a caller asked, and most callers didn't, so an owner-only config came back at the process umask. It now keeps the existing mode by default, at one choke point, instead of each caller opting in (src/main/agent-hooks/installer-utils.ts).

Everything else orcad writes outside the data root already sets its own mode. That covers Codex auth.json, the agent-hook endpoint file, the daemon socket directory, the SSH control socket directory, staged startup commands, and the Antigravity token.

Why

  • Precedent: VS Code's server, Zed's remote server, t3code and herdr all run their daemon at the login umask and protect only their secrets, with explicit 0600/0700 modes. None of them sets a restrictive process umask. herdr carries the caller's umask through launchd on purpose, so its terminal panes inherit it.
  • orcad doesn't need the inherited 077:
    • Its private state is already protected without it: orcad refuses to start unless its data root is 0700, and the launch tightens ~/.orca-remote to 0700.
    • Tokens, keys and sockets are written with explicit modes (writeSecureFile, the daemon's private file modes).
    • orcad already runs under the user's own umask when started with orca serve.
  • Alternatives considered:
    • Restore the umask at every spawn point (git, PTYs, agents): touches every spawn point and adds a shell to each one.
    • Keep the shell at the login umask and create the readiness, log and PID files in a (umask 077; …) subshell: depends on listing every file the launch creates, so a file added later and missed would come out readable. This change keeps everything the launch shell creates private by default, and only the daemon drops back.
  • Version compatibility: this is a change to the launch command only, so it works with every orcad build already installed on hosts, with no new option and nothing the client and host have to agree on.

Follow-up (not in this PR): the root reason the shell needs 077 at all is that orcad prints the pairing token on stdout, into a file the shell creates. If orcad wrote that payload itself with 0600 (behind a version check), the launch command could drop the umask entirely.

Live check: the generated launch commands ran for real on a Linux machine, in Docker containers, and on macOS (see Testing). A real orcad deploy is checked by the SSH hostile-hosts lane in CI, which deploys the real orcad build to Debian 10, AlmaLinux 8, Alpine and CentOS 7 containers over SSH. I did not deploy a real orcad to a shared machine by hand.

Taken over from @AmethystLiang at the user's request. Her commit, with her authorship, is unchanged, and the follow-ups are on top.

Linked Issue

Fixes #31125

Visual Proof

N/A. This changes file permissions on the SSH host, with no UI change; the tests below show it.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • orcad-remote-launch-file-modes.test.ts, new case: runs the real generated launch command under umask 022. It checks that a file and a directory the daemon creates are 0644/0755, while the readiness, PID and log files stay 0600. It failed before this change (the daemon's file was 0600).

  • orcad-remote-launch-setsid.test.ts, new Linux-only case: checks the same for the WSL launch.

  • Container runs of the generated commands: both launch modes, in Debian (dash and bash) and Alpine (busybox ash/setsid), at login umasks 022, 002, 027 and 077. In every run:

    • the daemon ran at the login umask, and its files got the matching modes;
    • the readiness, PID and log files were 0600, and the slot and ~/.orca-remote were 0700;
    • the PID the launch printed and recorded was the running daemon.
  • Hostile-host Docker matrix (ssh-hostile-host-managed-orcad.ts): for every Linux cell that activates, it checks that the real deployed orcad's /proc/<pid>/status umask matches the SSH login's umask and that its readiness file is 0600. On main, this check fails, because orcad runs at 0077.

  • installer-utils.test.ts, new case: rewriting a 0600 hook config leaves it 0600. It failed before the fix (the file came out 0644).

  • gemini-oauth-sources.test.ts, new: at umask 022, a refresh over an existing 0600 credential file leaves it at 0600. It failed before the fix (the file came out 0644). The two Gemini fetcher tests now mock the credential writer, so they can never write the real ~/.gemini.

  • Real-shell matrix of the generated commands (on a Linux machine, in Docker): both launch modes on Debian 10 (dash, plus bash as the login shell), CentOS 7 (bash 4.2) and Alpine (busybox ash and setsid, plus zsh and bash as the login shell), at login umasks 022, 002, 027 and 077; also macOS /bin/sh (bash 3.2) and zsh for the SSH launch.

    • With this change, the daemon and a child it spawned ran at the login umask, and their files and directories got the matching modes.
    • The readiness, PID and log files were 0600, and the slot and ~/.orca-remote were 0700.
    • The PID the launch printed and recorded was the running daemon.
    • The same matrix on main shows the daemon at 0077 in every row.
  • Suites: the managed-server install suites, the byte-budget test and the SSH session-record test pass (42 files, 599 tests). pnpm tc:node and pnpm run check:code-quality:changed pass.

  • Known unrelated local failure: src/main/orcad/orcad-forked-child-paths.test.ts fails on macOS because of the /var → /private/var temp path. It imports nothing this PR changes.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: the readiness file still never exists in a readable state. It is created under 077 and then chmod 600, before orcad writes the token. The private directories are unchanged.
  • SSH / WSL: both POSIX launch modes are covered. Windows hosts use a separate launcher and are unaffected.
  • Existing hosts: the fix takes effect on the next orcad launch. The terminal daemon outlives orcad restarts by design, so terminals spawned by one started under the old build keep 077 until that daemon is replaced. git and everything else orcad runs itself are fixed right away.
  • PID file: on the SSH launch, the PID file is written by the foreground shell, outside the backgrounded list. Before, that shell never ran umask 077, so the file was owner-only only if a background chmod 600 happened to run after the write. The two umask steps now run in the foreground shell (; instead of &&), so the file is created 0600. A delayed write proves it.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The remote launch command now uses readiness, log, and stop paths relative to the install directory while retaining an absolute PID path. It captures the login umask, keeps private launch files under umask 077, and restores the login umask for detached daemon startup. Tests verify daemon-created modes, private file modes, launch ordering, live daemon permissions, and credential-file permissions. Gemini credential persistence now uses writeCredentialFileAtomic. Hook rewrites preserve existing modes by default. The byte-budget ceiling is updated.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to df130

New Windows Hermes configuration files can lose their requested restrictive permissions; correct this localized regression before relying on that permission contract.

Pre-merge checks: Passed 6 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 6 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: running the remote daemon with the login umask while keeping private files restricted.
Linked Issues check Passed The description links the change to issue #31125 with a valid Fixes #31125 reference, and the issue objective matches the implementation.
Out of Scope Changes check Passed The changes to Gemini credential persistence and hook-file mode preservation support the same file-permission and umask safety objectives. No unrelated feature changes are evident.
Linked Issues check Passed Issue #31125 requires remote Linux launch processes to use the login umask for user-facing files and to keep launch-private files owner-only. orcadLaunchCommand captures the login umask, applies `07…
Out of Scope Changes check Passed The changes stay within issue #31125. Production changes update POSIX remote launch behavior and protect private files that the more permissive daemon can rewrite. The launch regression tests, hostile…
Description check Passed The description follows the required template and clearly explains the change, user impact, rationale, linked issue (#31125), testing, platform coverage, security considerations, and known unrelated f…
Full details: Linked Issues check

Explanation

Issue #31125 requires remote Linux launch processes to use the login umask for user-facing files and to keep launch-private files owner-only. orcadLaunchCommand captures the login umask, applies 077 while it creates private launch files, and restores the captured value only for the daemon in both nohup and setsid paths. The added tests cover daemon-created modes and private readiness, PID, and log modes. The credential and hook writes also preserve owner-only modes under the new daemon umask.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #31125. Production changes update POSIX remote launch behavior and protect private files that the more permissive daemon can rewrite. The launch regression tests, hostile-host check, and byte-budget update validate this behavior. The Gemini credential and agent-hook changes support the issue requirement that Orca private files remain owner-only. Windows launch behavior remains unaffected.

Full details: Description check

Explanation

The description follows the required template and clearly explains the change, user impact, rationale, linked issue (#31125), testing, platform coverage, security considerations, and known unrelated failure. Visual proof is correctly marked N/A. The manual-testing and full-command checklist boxes are unchecked, but the description provides substantial automated and real-shell validation and states which checks passed.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…cad runs at the login umask

The Gemini usage fetcher rewrote ~/.gemini/oauth_creds.json through a temp file and rename with
no mode, so the replacement took the process umask. Under the old inherited umask 077 that
happened to be 0600 on SSH hosts; at the login umask it would be 0644. Write it through
writeCredentialFileAtomic (0600 staging file, owner-only ACL on Windows).

The hostile-host matrix now checks that the deployed orcad runs at the SSH login's umask and that
its readiness file stays 0600.
… launch PID file owner-only

writeHooksJson now keeps an existing config's mode unless a caller opts out. Rewriting
~/.claude/settings.json (which can hold API keys) and the other agent configs through a temp file
used to take the process umask; inside orcad that was 077, and at the login umask it would widen an
owner-only file to 0644.

The launch runs `umask 077` in the foreground shell rather than inside the backgrounded nohup
list, so the PID file the foreground writes is created 0600 instead of relying on a racing chmod.

The Gemini credential test now pins umask 022 rather than inheriting the runner's.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c31e0304-f1f0-4e1a-ad41-7e27bbd9cbad
📥 Commits

Reviewing files that changed from the base of the PR and between fc22c40 and 88442f3.

📒 Files selected for processing: 5
  • src/main/rate-limits/gemini-oauth-sources.test.ts
  • src/main/rate-limits/gemini-oauth-sources.ts
  • src/main/rate-limits/gemini-usage-fetcher.fallback.test.ts
  • src/main/rate-limits/gemini-usage-fetcher.test.ts
  • src/main/ssh/hostile-host-test-support/ssh-hostile-host-managed-orcad.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

… Windows config

A preserved Windows mode can be read-only, which would leave an undeletable temp file behind when
the rename fails. POSIX keeps the preserved mode.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 Major · Fail closed when Windows ACL enforcement is unavailable. · gemini-oauth-sources.ts:81-85

src/main/rate-limits/gemini-oauth-sources.ts:81-85
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Fail closed when Windows ACL enforcement is unavailable.

writeCredentialFileAtomic ignores the result of writeRestrictedWindowsFile before renaming the temporary file. When the Windows security addon is unavailable, or when the filesystem drops the ACL, the helper returns false after creating an unrestricted temporary file. saveGeminiCredentials can then publish that file with an inherited DACL.

Pass a Windows-ACL requirement for this credential save and abort before renameSync when the restriction result is false. Keep the existing fallback behavior for other credential writers.

Suggested fix
 export function writeCredentialFileAtomic(
   path: string,
   data: Buffer,
-  shouldPublish?: () => boolean
+  shouldPublish?: () => boolean,
+  requireWindowsAcl = false
 ): boolean {
@@
     if (process.platform === 'win32') {
       // Why born restricted: a sibling would otherwise inherit the directory's DACL and replace
       // the previous credential's owner-only ACL.
-      writeRestrictedWindowsFile(tempPath, data)
+      const restricted = writeRestrictedWindowsFile(tempPath, data)
+      if (requireWindowsAcl && !restricted) {
+        throw new Error('Unable to enforce owner-only Windows ACL for credential file')
+      }
       fsyncFileSync(tempPath)
       return publishStagedCredential(tempPath, path, shouldPublish)
 export async function saveGeminiCredentials(creds: GeminiCredentials): Promise<void> {
-  writeCredentialFileAtomic(OAUTH_CREDS_PATH, Buffer.from(JSON.stringify(creds, null, 2), 'utf-8'))
+  writeCredentialFileAtomic(
+    OAUTH_CREDS_PATH,
+    Buffer.from(JSON.stringify(creds, null, 2), 'utf-8'),
+    undefined,
+    true
+  )
 }

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a534dbdc-a1d7-42c5-9ad6-a639659ef4ee
📥 Commits

Reviewing files that changed from the base of the PR and between 88442f3 and 0df553c.

📒 Files selected for processing: 5
  • src/main/agent-hooks/installer-utils.test.ts
  • src/main/agent-hooks/installer-utils.ts
  • src/main/managed-server/install/orcad-remote-launch.ts
  • src/main/managed-server/posix-host-op-byte-budget.test.ts
  • src/main/rate-limits/gemini-oauth-sources.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@nwparker

Copy link
Copy Markdown
Contributor

I've taken this PR over at the user's request. Thanks @AmethystLiang for the fix and the analysis. Your commit and its authorship are unchanged, and my commits are on top. I didn't rebase or force-push, because the branch already merges cleanly.

What I added

Once orcad stops inheriting 077, I audited every secret it writes outside its 0700 data root. Two needed an explicit mode:

  • ~/.gemini/oauth_creds.json: Gemini usage tracking refreshes the tokens and rewrites this file through a temp file and a rename. The result was 0600 only because of the old 077. It now uses writeCredentialFileAtomic, which creates the file 0600.
  • Agent hook configs, for example ~/.claude/settings.json: these are rewritten through writeHooksJson. It now keeps the existing file's mode by default, rather than only when a caller asked for it.

I also moved umask 077 into the foreground shell of the SSH launch. That makes the PID file owner-only when it is created, so it no longer depends on a racing chmod.

Tests

  • New regression tests for the two secret files.
  • The hostile-host Docker matrix now checks that the real orcad's /proc umask matches the SSH login's umask and that its readiness file is 0600.

Verified

  • The generated commands ran for real in Debian 10 (dash and bash), CentOS 7 (bash 4.2) and Alpine (busybox ash and busybox setsid, with zsh and bash as login shells), plus macOS sh and zsh. Both launch modes, at login umasks 022, 002, 027 and 077.
  • Codex and an independent Opus review are clean.

Proposed follow-up, not in this PR

  • Have orcad write the readiness payload itself with 0600, negotiated by version, so the launch shell needs no umask 077 at all.
  • Add a lint or choke point for credential writes outside the data root.
  • Recycle or flag a terminal daemon still running from an old 077 launch.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56033e5d-074a-4afa-a19a-a15d11962f20
📥 Commits

Reviewing files that changed from the base of the PR and between 0df553c and df13008.

📒 Files selected for processing: 1
  • src/main/agent-hooks/installer-utils.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Comment on lines +336 to +337
const tmpMode = process.platform === 'win32' ? undefined : existingMode
writeFileSync(tmpPath, serialized, { encoding: 'utf-8', mode: tmpMode, flag: 'wx' })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 5 '\bwriteHooksJson\s*\(|\bdefaultMode\s*:' src tests

Repository: stablyai/orca

Length of output: 42910


🏁 Script executed:

set -euo pipefail
nl -ba src/main/agent-hooks/installer-utils.ts | sed -n '270,370p'
printf '\n--- defaultMode caller ---\n'
nl -ba src/main/hermes/hermes-home-filesystem.ts | sed -n '35,58p'
printf '\n--- relevant tests and declarations ---\n'
rg -n -C 8 -F -- 'defaultMode' src/main/agent-hooks src/main/hermes
rg -n -C 8 -F -- 'writeHooksJson' src/main/agent-hooks/installer-utils.test.ts

Repository: stablyai/orca

Length of output: 18554


🏁 Script executed:

set -euo pipefail
printf '%s\n' '--- Hermes writeConfigFile callers ---'
rg -n -C 8 -F -- 'writeConfigFile(' src tests || test "$?" -eq 1
printf '%s\n' '--- Hermes platform guards ---'
rg -n -C 6 -e 'process\.platform' -e 'isWindows' src/main/hermes src/main | head -240
printf '%s\n' '--- changed lines against supplied base ---'
git diff --no-ext-diff --unified=12 a18b44bfc0bfccaede1d9208dc77a97816b55fe9 df13008f9bf2b1a3d5cad76cb4388b5b2ff3ba9c -- src/main/agent-hooks/installer-utils.ts

Repository: stablyai/orca

Length of output: 28283


Preserve defaultMode for new Windows files.

When writePath does not exist, existingMode contains options.defaultMode. The Windows branch replaces it with undefined, and the Windows path skips chmodSync. The new file can therefore use the platform default instead of the requested mode.

Skip the inherited mode for an existing Windows file, but retain defaultMode for a new file.

Suggested fix
--- "a/src/main/agent-hooks/installer-utils.ts"
+++ "b/src/main/agent-hooks/installer-utils.ts"
@@ -333,7 +333,10 @@
 
   try {
     // Why not on Windows: a read-only config's mode would make the temp file undeletable on failure.
-    const tmpMode = process.platform === 'win32' ? undefined : existingMode
+    const tmpMode =
+      process.platform === 'win32' && options?.preserveMode !== false && existsSync(writePath)
+        ? undefined
+        : existingMode
     writeFileSync(tmpPath, serialized, { encoding: 'utf-8', mode: tmpMode, flag: 'wx' })
     if (existingMode !== undefined && process.platform !== 'win32') {
       // Preserve requested permissions even with a stricter process umask.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const tmpMode = process.platform === 'win32' ? undefined : existingMode
writeFileSync(tmpPath, serialized, { encoding: 'utf-8', mode: tmpMode, flag: 'wx' })
const tmpMode =
process.platform === 'win32' && options?.preserveMode !== false && existsSync(writePath)
? undefined
: existingMode
writeFileSync(tmpPath, serialized, { encoding: 'utf-8', mode: tmpMode, flag: 'wx' })

@nwparker
nwparker merged commit 0a5a7b1 into main Oct 20, 2026
69 checks passed
nwparker added a commit that referenced this pull request Oct 20, 2026
…nd WSL hosts (#31235)

* fix(orcad): replace a stale terminal daemon once it drains on Linux and WSL hosts

A daemon forked by an older orcad (before #31135, at umask 077) kept
serving new terminals after an upgrade if it was busy at startup, because
the runtime stale-bundle recycle was macOS-only. orcad now opts in on every
platform; the replacement still waits for exactly zero live sessions and
treats an unverifiable count as keep.

* test(daemon): pin the restart recycle test to linux; tighten wording
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.

[Bug]: Remote orcad runs with umask 077, so worktrees it creates are owner-only

2 participants