Repository navigation
refactor(legacy-relay): one ask-wait clamp and no needless exports - #29835
Conversation
optionalAskTimeout computed exactly what cappedWait does (an undefined timeout stays undefined; anything else clamps to 0..ORCHESTRATION_ASK_MAX_TIMEOUT_MS), so the ask call uses cappedWait. Three functions used only inside their own file lose their export, and the per-host switch's doc names the orchestration commands it has gated since #29571. Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
Deletes a timeout helper that was an exact copy of another one, hides three functions that nothing outside their own file uses, and corrects a setting's description. Nothing changes for users.
What Changed
legacy-relay-cli-call-limits.tshad two clamps for a relay-era CLI wait:cappedWaitandoptionalAskTimeout. Forundefined, both returnundefined. For any number, both returnmin(max(0, t), ORCHESTRATION_ASK_MAX_TIMEOUT_MS)(clampOrchestrationAskTimeoutMsonly differs when givenundefined, and that case never reached it). The ask call now usescappedWait, andoptionalAskTimeoutis removed.exportbecause no other file imports them:createUnservedSshPaneTransport,listDesktopBrowserBridgeCandidatesandisBrowserWorkspaceOwnedByEnvironment.allowRemoteCliControlswitch (src/shared/ssh-types.ts) said it only gates the desktop browser bridge. Since fix(ssh): relay-era terminals' orca orchestration commands work again, behind the per-host switch (STA-10765) #29571 it also gates relay-era terminals' orchestration commands, and the comment now says so. This is a comment change only; the switch's value and its consent stamp are untouched.Why
This is part of a cleanup pass over today's SSH merges. Two copies of the same clamp let the next edit change one and not the other.
Security-adjacent files: the relay-era CLI bridge (#29571/#29596) and the per-host switch. The caller-scope check (
legacy-relay-cli-caller.ts) is untouched, and so is the concurrency cap. The ask timeout bound is the same number for every input. Existing tests that cover these, all passing unchanged:legacy-relay-cli-call-limits.test.tscovers the clamp (MAX_SAFE_INTEGER becomes 1,800,000, -5 becomes 0, undefined stays undefined), and thelegacy-relay-cli-*andlegacy-relay-target-bridgesuites cover the rest.Linked Issue
N/A (maintainer cleanup).
Visual Proof
N/A: no UI or behaviour change.
Testing
pnpm test --maxWorkers=1 src/main/ssh src/main/ipc src/main/browser src/renderer/src/hooks src/renderer/src/components/terminal-pane/pty-connection/unserved*: all passed (1192 files).pnpm tc, plus every step of the static-analysis job run locally: passed.Codex review (
gpt-6.1-sol, high): no findings.Nothing was verified live; this is a pure refactor.
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
Notes
No wire change. Older relays send the same flags and get the same bounds.
Checklist
N/Afor visuals with reason