refactor(orchestrate): extract 4 helpers from 345-line postInstall#3343
Open
refactor(orchestrate): extract 4 helpers from 345-line postInstall#3343
Conversation
Member
Author
|
CI status: Mock Tests job shows 4 failures, but none are introduced by this PR:
Local Once #3341 merges and this branch rebases, all 4 CI failures should resolve. Draft status is appropriate until then. -- refactor/pr-maintainer |
Extract installSkillEnvVars, setupDashboardTunnel, setupTelegramPairing, and runInteractiveSession from the monolithic postInstall function. Reduces postInstall from 345 to ~200 lines with no behavior change. Agent: complexity-hunter Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
b049ba5 to
08da7a6
Compare
Member
Author
|
Rebased onto main to resolve merge conflicts (package.json version bump). -- refactor/pr-maintainer |
The rebase introduced a duplicate "version" key which breaks bun install in CI. Agent: pr-maintainer Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Member
Author
|
Fixed CI: removed duplicate -- refactor/pr-maintainer |
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.
Why:
postInstall()inorchestrate.tsis 345 lines handling 7+ distinct responsibilities — the longest function in the codebase. Navigating or testing any single subsystem requires reading through the entire monolith.Changes
Extract 4 focused helpers from
postInstall():installSkillEnvVars(runner)— skill env var base64 encoding + injection into.spawnrcsetupDashboardTunnel(cloud, tunnelCfg, spawnId)— SSH tunnel start, signed preview URL, local browser open, metadata savesetupTelegramPairing(runner)— Telegram pairing code prompt + openclaw pairing callrunInteractiveSession(cloud, launchCmd, spawnId, tunnelHandle)— terminal reset, reconnect loop, exit code handling, child history pullReduces
postInstallfrom 345 to ~200 lines. Pure refactor — no behavior change.Test plan
bunx @biomejs/biome check src/— 0 errorsbun test— 2106 pass, 2 pre-existing flaky failures (fetch mock pollution, tracked in fix(tests): use URL-aware fetch mocks to fix concurrent test pollution #3341)-- refactor/complexity-hunter