You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(wsl): keep a user's GLIBC_TUNABLES and delegate the launch-env wrapper - #34248
#34187 made Orca's server in WSL start with a memory-allocator setting that saves about 50 MB. If you had already set that same setting yourself, Orca replaced your value. Now your own value always wins. There's also a small fix so the launch code keeps working if its connection object is ever written as a class.
What Changed
Two follow-ups to the #34187 review, both low severity.
A user's own GLIBC_TUNABLES wins.
Launch env entries can now be marked keep-existing, rendered as NAME="${NAME:-value}". The value applies only when the launching shell has none.
The malloc tunables entry uses it. A value forwarded through WSLENV now stays in effect for orcad, and orcad's startup claim already leaves non-matching values in place, so its children keep it too.
Defaults that can't be written safely inside ${NAME:-…} are refused at build time.
withOwnBuildLaunchEnv delegates instead of spreading. It now returns Object.create(conn, { orcadLaunchEnv }), so a class-based transport keeps its prototype methods. Today's WSL transport is a plain object, so behavior doesn't change.
Why
Before: the launch always set GLIBC_TUNABLES=glibc.malloc.mmap_threshold=16384, overriding a user's value for orcad. orcad's claim then removed it from orcad's env (it no longer matched the marker), so orcad's direct children also lost the user's setting.
After: orcad runs with the user's setting and leaves it in place.
Why a shell default: only the launching shell knows whether a value is already set; the desktop doesn't. A shell default needs no extra round trip.
pnpm tc and pnpm run check:code-quality:changed pass.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
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
User-risk: none new. It only stops overriding a value the user set.
Flag-off: inert outside WSL. SSH launches pass no host env, and keep-existing is used only by the WSL malloc entry.
SSH and wire: unchanged.
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)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Walkthrough
Host malloc tunables now use keep-existing mode for GLIBC_TUNABLES. Launch command construction preserves a nonempty shell value, uses a validated default when the value is unset or empty, and rejects invalid defaults. The own-build launch environment wrapper now inherits from the original transport. Tests cover both behaviors.
Priority: Normal
Merge Risk: Low · up to e5a1f
The launch behavior has no established defect, but the unit test can fail on Windows machines without a POSIX shell. Guard the shell-dependent test before merging unless that test environment is guaranteed to provide one.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly identifies both primary changes: preserving a user's GLIBC_TUNABLES value in WSL and delegating the launch-environment wrapper.
Description check
The description is complete and focused. It explains the user impact, implementation, rationale, linked issue, testing, scope, compatibility notes, and checklist status. Automated testing is documente…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is complete and focused. It explains the user impact, implementation, rationale, linked issue, testing, scope, compatibility notes, and checklist status. Automated testing is documented, while manual testing and the full lint/typecheck/build checklist remain unchecked.
Full details: Docstring Coverage
Explanation
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 6 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
set -u
nl -ba config/scripts/run-node-server-tests.mjs | sed -n '1,180p'
Repository: stablyai/orca
Length of output: 6620
Script executed:
set -u
nl -ba config/scripts/node-server-test-paths.mjs | sed -n '1,240p'
Repository: stablyai/orca
Length of output: 3214
Guard the shell-execution assertions on non-Linux hosts.
The new test calls execFileSync('sh', ...) without a guard. On a Windows host without sh on PATH, the test can fail before its assertions complete. Keep the rendering and rejection assertions outside the guard.
This is a local Windows test failure, not a failure of the current Windows CI path. The pull-request unit-test job runs on Ubuntu, and the Windows node-server job does not select this file.
…apper
The orcad launch now sets GLIBC_TUNABLES only when the launching shell has
none, so a value forwarded through WSLENV wins and the claim leaves it in
place. withOwnBuildLaunchEnv delegates to the transport instead of copying
its own properties, so a class-based transport keeps its methods.
withOwnBuildLaunchEnv now returns the transport's own type, so the test
calls the class method directly. The comment no longer claims #private
class fields survive delegation.
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
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.
ELI5
#34187 made Orca's server in WSL start with a memory-allocator setting that saves about 50 MB. If you had already set that same setting yourself, Orca replaced your value. Now your own value always wins. There's also a small fix so the launch code keeps working if its connection object is ever written as a class.
What Changed
Two follow-ups to the #34187 review, both low severity.
GLIBC_TUNABLESwins.keep-existing, rendered asNAME="${NAME:-value}". The value applies only when the launching shell has none.${NAME:-…}are refused at build time.withOwnBuildLaunchEnvdelegates instead of spreading. It now returnsObject.create(conn, { orcadLaunchEnv }), so a class-based transport keeps its prototype methods. Today's WSL transport is a plain object, so behavior doesn't change.Why
GLIBC_TUNABLES=glibc.malloc.mmap_threshold=16384, overriding a user's value for orcad. orcad's claim then removed it from orcad's env (it no longer matched the marker), so orcad's direct children also lost the user's setting.Why a shell default: only the launching shell knows whether a value is already set; the desktop doesn't. A shell default needs no extra round trip.
Linked Issue
Follow-up to #34187.
Visual Proof
N/A: no UI change.
Testing
orcad-remote-launch-setsid.test.tschecks:shrun showing the default applies when unset and keeps a preset value;wsl-orcad-own-build-launch-env.test.ts: a class-based transport's prototype methods survive the wrapper.Existing suites pass under
pnpm test: host-malloc-tunables, daemon spawn, PTY env inheritance, WSL deploy, launch.pnpm tcandpnpm run check:code-quality:changedpass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
keep-existingis used only by the WSL malloc entry.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)