mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-20 09:31:15 +00:00
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:
parent
d7ff0739a2
commit
eff99caefe
2 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.5.19",
|
||||
"version": "0.5.20",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue