mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-30 12:59:32 +00:00
Replace hand-constructed openrouter.json path with getSpawnCloudConfigPath("openrouter")
for single-source-of-truth path resolution. Remove unused _cloudName parameter since
the function delegates ALL cloud credentials unconditionally.
Agent: ux-engineer
Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fd36ff0e3d
commit
405dbc6ba6
3 changed files with 9 additions and 10 deletions
|
|
@ -14,7 +14,7 @@ import { offerGithubAuth, setupAutoUpdate, wrapSshCall } from "./agent-setup.js"
|
|||
import { tryTarballInstall } from "./agent-tarball.js";
|
||||
import { generateEnvConfig } from "./agents.js";
|
||||
import { getOrPromptApiKey } from "./oauth.js";
|
||||
import { getSpawnCloudConfigPath, getSpawnPreferencesPath, getUserHome } from "./paths.js";
|
||||
import { getSpawnCloudConfigPath, getSpawnPreferencesPath } from "./paths.js";
|
||||
import { asyncTryCatch, asyncTryCatchIf, isOperationalError, tryCatch } from "./result.js";
|
||||
import { isWindows } from "./shell.js";
|
||||
import { injectSpawnSkill } from "./spawn-skill.js";
|
||||
|
|
@ -137,7 +137,7 @@ export async function installSpawnCli(runner: CloudRunner): Promise<void> {
|
|||
}
|
||||
|
||||
/** Copy local cloud credentials to the remote VM for recursive spawning. */
|
||||
export async function delegateCloudCredentials(runner: CloudRunner, _cloudName: string): Promise<void> {
|
||||
export async function delegateCloudCredentials(runner: CloudRunner): Promise<void> {
|
||||
logStep("Delegating cloud credentials to VM...");
|
||||
|
||||
const filesToDelegate: {
|
||||
|
|
@ -147,7 +147,6 @@ export async function delegateCloudCredentials(runner: CloudRunner, _cloudName:
|
|||
|
||||
// Delegate ALL cloud credentials so the child VM can spawn on any cloud,
|
||||
// not just the one the parent is running on.
|
||||
const configDir = `${getUserHome()}/.config/spawn`;
|
||||
const cloudNames = [
|
||||
"hetzner",
|
||||
"digitalocean",
|
||||
|
|
@ -166,7 +165,7 @@ export async function delegateCloudCredentials(runner: CloudRunner, _cloudName:
|
|||
}
|
||||
|
||||
// OpenRouter credentials (always needed for child spawns)
|
||||
const orConfigPath = `${configDir}/openrouter.json`;
|
||||
const orConfigPath = getSpawnCloudConfigPath("openrouter");
|
||||
if (existsSync(orConfigPath)) {
|
||||
filesToDelegate.push({
|
||||
localPath: orConfigPath,
|
||||
|
|
@ -577,7 +576,7 @@ async function postInstall(
|
|||
(!enabledSteps || enabledSteps.has("spawn"))
|
||||
) {
|
||||
await installSpawnCli(cloud.runner);
|
||||
await delegateCloudCredentials(cloud.runner, cloud.cloudName);
|
||||
await delegateCloudCredentials(cloud.runner);
|
||||
await injectSpawnSkill(cloud.runner, agentName);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue