Repository navigation
test(managed-server): 6 KB wire-size budget for every POSIX host-op command - #30635
Merged
Merged
Conversation
Builds each exported POSIX host-op builder at realistic maximal arguments and asserts the raw command stays under 6 KB, under the 8,000-byte compression threshold. Ops already over budget are listed with ceilings that may only shrink until they move onto the host script (round 4 R4-10). Co-Authored-By: Claude <[email protected]>
…nux and macOS Measures what a gateway sees on the plain fallback (fence guard + uncompressed POSIX wrapper), takes the larger of Linux and macOS, launches the SSH way (nohup), and also discovers the top-level src/main/ssh builders. Exports three builders that are sent as their own exec request so they can be measured. Co-Authored-By: Claude <[email protected]>
…olders Co-Authored-By: Claude <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
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. Comment |
9 tasks done
nwparker
added a commit
that referenced
this pull request
Oct 19, 2026
…snapshot-room PRs crossed (#30680) * fix(managed-server): import newestStateMtimeCommand from its new module #30635 and #30618 merged in parallel: #30618 moved newestStateMtimeCommand to orcad-state-newest-mtime.ts while #30635's byte-budget test imported it from orcad-state-snapshot.ts, breaking typecheck on main. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(managed-server): measure the snapshot-space probe and record #30618's capture growth Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
DoozyX
added a commit
to DoozyX/orca
that referenced
this pull request
Oct 19, 2026
Upstream 9294b0a (262 commits) into fork e3a5943; 30 conflicted files. Includes upstream's post-pin stablyai#30680 test fix for the stablyai#30635/stablyai#30618 crossing, and splits two files the merge pushed over max-lines. Claude-Session: https://claude.ai/code/session_012SWXYezr9cxoRQJFc73DTB
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.
ELI5
Some corporate SSH gateways cut a command that is longer than about 10 KB. #30549 made long commands survive that by compressing them, with a plain retry when the host can't decompress. This test measures every command Orca sends to a Linux or macOS host, as it is actually sent, and fails if a new or grown command gets close to the danger zone. That keeps compression a safety net instead of what normally happens.
What Changed
New test:
src/main/managed-server/posix-host-op-byte-budget.test.ts.…Command(builder inmanaged-server/{host-state,install,lifecycle,activation}and in the top-levelsrc/main/sshfiles. The legacy relay is skipped because it retires on 2027-01-15. Builders that don't produce a POSIX host op are listed with a reason.wrapRemoteCommandForPosixShell(…, { compress: false })). Each builder runs on bothlinux-x64anddarwin-arm64with worst-case arguments: a long NFS home, a long account name, a 40-character build hash, the longest node runtime path and a held fence. The larger of the two sizes counts.orcadLaunchCommandis measured the way SSH launches (nohup, no env) and, separately, the WSL way.The ops already over budget are listed with their exact measured sizes as ceilings, and those ceilings may only shrink. A listed op also fails if it drops under the budget.
restoreOrcadStateSnapshotCommandcaptureOrcadStateSnapshotCommandprobeRemoteInstallCompleteCommandclearOrcadStateSnapshotMembersCommandtryStealInstallLockCommandorcadLaunchCommand(SSH, macOS)serializedStateMutationCommand(wrapping:)orcadLaunchCommand(WSLsetsid)Production change:
exportadded to three builders that are each sent as their own exec request, so they can be measured:posixReleaseFenceCommand,posixReleaseOwnedLockCommandandexecutablePermissionsCommand. There is no behaviour change.Why
Round 4 decision D-J: the 6 KB test-only budget lands now, and the snapshot ops then move onto the content-addressed host script that the pinned Node runs. Without this test, the command length grows with every feature and nothing notices until a user's gateway truncates it (#30491).
It measures what is sent, not the builder's raw output: the fence guard adds about 300 bytes, and the wrapper's escapes add up to 1.7x. Measuring the raw output had hidden four over-budget ops, including the macOS SSH launch.
Linked Issue
Round 4 SSH hardening, slice R4-10a (decision D-J), follow-up to #30491 / #30549. No new issue.
Visual Proof
N/A. This is test-only, plus three
exportkeywords.Testing
pnpm test src/main/managed-server/posix-host-op-byte-budget.test.ts: 59 cases pass.pnpm run typecheck:node, oxlint and oxfmt are clean.I ran the full "static analysis and typecheck" job steps locally.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
src/main/sshbuilders and three unexported standalone builders.execCommandadds (about 178 bytes) wasn't counted, and that thessh/transport subfolders weren't scanned. Both are fixed, and the ceilings were re-measured. Codex flagged the framing gap independently and found nothing on the final head.node <bundle> snapshot-restore) over a second content-addressed script. Rollback can then run the previous slot's bundle. The approach here is unchanged.Agent skill upstream boundary
Notes
orcad-remote-record-file.ts) puts its payload inline, so its size depends on the record. That is a follow-up.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)