fix: apply default spawn name when user presses Enter without typing (#1605)

promptSpawnName() used `placeholder` (visual hint only) without `defaultValue`,
so pressing Enter returned an empty string instead of applying the placeholder.
Now generates a unique default like `spawn-a3f2` with a random suffix to avoid
Fly.io global name collisions.

Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-02-21 11:46:59 -08:00 committed by GitHub
parent d7ff0739a2
commit eff99caefe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.5.19",
"version": "0.5.20",
"type": "module",
"bin": {
"spawn": "cli.js"

View file

@ -459,9 +459,12 @@ async function selectCloud(manifest: Manifest, cloudList: string[], hintOverride
// Any string is allowed (spaces, uppercase, etc.) — the shell scripts
// derive a kebab-case slug for the actual cloud resource name.
async function promptSpawnName(): Promise<string | undefined> {
const suffix = Math.random().toString(36).slice(2, 6);
const defaultName = `spawn-${suffix}`;
const spawnName = await p.text({
message: "Name your spawn",
placeholder: "My Spawn",
placeholder: defaultName,
defaultValue: defaultName,
validate: (value) => {
if (!value) return undefined;
if (value.length > 128) {