hosted: execute registered external CLIs in hosted mode - #455
Merged
Conversation
The hosted runner needs the numeric result to return through runHostedCli, and process.exitCode is not observable in the hosted test harness. No behavior change on the local path.
Externals are local binaries, not adapters: registry lookup, PATH check, spawn. Nothing is sent to Cloud. Previously webcmd gh pr list returned plugin-install guidance in hosted mode, which fixes nothing. Resolved after the manifest so a hosted site wins over an external of the same name, matching local precedence, and before the root-options parse so --version still forwards to the external.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. This review is advisory and does not block merging. |
This reverts commit b1b19b1.
…cli-passthrough # Conflicts: # src/hosted/main-lifecycle.test.ts # src/hosted/runner.ts # src/main.ts
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.
Summary
gh,docker,vercel,wrangler,obsidian,ntn,tg,discord,lark-cli, plus anything the user registered locally) are not adapters — they are local binaries that Webcmd wraps for passthrough. In local mode they work; in hosted modewebcmd gh pr listfell through to the unknown-site branch and returnedmissingPluginGuidance('gh'), which fixes nothing.HostedRunnerOptions.externalsand routes external names through it inside the!siteExistsblock, after the manifest is fetched (so a hosted site of the same name always wins) and beforeparseUnknownSiteRootOptions(sowebcmd gh --versionstill forwards--versiontoghinstead of printing the webcmd version).ExternalExitSignal(not aCliError— a successfulghrun must not render an error envelope), caught before thesignal?.aborted → InterruptedErrorremap so a completed run under an aborted signal isn't misreported.executeExternalClito return the exit code instead of assigningprocess.exitCode, so the hosted test harness can observe it. Local caller updated to assign the returned value; no behavior change on the local path.Test plan
Notes
🤖 Generated with Claude Code