fix(spawn): manual first message rides SpawnSpec.InitialPrompt — retire the queued-message transcript gate (#96) #97
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab!97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/96"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
An interactive codex spawn never connects: codex-cli 0.133.0's TUI births its rollout transcript at first-turn start, not session init. The issue-#41 client-side queued first message auto-sent only once the transcript was located — so the message that would create the transcript waited for the transcript. Deadlock by construction, and the parked text lived only in browser memory (lost on reload). claude-code was unaffected only because its transcript exists from process start, letting transcript availability double as a TUI-readiness proxy.
Fix (maintainer-approved direction from the issue)
POST /api/v1/repos/{id}/instancesgains optionalfirst_message: shape-only validation per the ADR-0027 precedent (whitespace-only → none; 16 KiB argv cap → 400, reusingafkPromptMaxBytes; otherwise verbatim), threadedinstanceCreateRequest→StartParams.FirstMessage→LaunchSpec.SeedPrompt— the AFK-proven spawn-argv trailing positional, present before the process starts. No post-spawn keystroke, no cold-start race; the first message starts the first turn, which births the rollout, and the chat connects on the next poll. Injected flags (--settings) still land before the trailing prompt.SeedPromptcarries no run-kind semantics;Kindalone decides AFK vs manual (comments updated).web/src/lib/queuedMessage.ts), its transcript-availability gate, the auto-send effect, the "Sends when … is ready" pending bubble, and the draft-seed plumbing are deleted. Repo-wide grep for queue identifiers is zero-hit — no path waits on a transcript to deliver the operator's first message.state === ''(pre-first-poll) and ended runs.codex execwrites at once; live evidence from the #87 spike, with a when-this-breaks recipe); the ADR-0036 Tier-2 transcript spike now asks when is the transcript born; ADR-0025's queued-first-message decision carries a dated retirement amendment in the house square-bracket style.Acceptance criteria → evidence
TestAPI_InstanceStartFirstMessage(verbatimInitialPromptvia recorded SpawnSpecs) +TestStart_firstMessageIsTrailingSpawnPositional(trailing positional,--settingsbefore it, zero keystroke batches).NewRun.test.tsxasserts exactly one POST carryingfirst_message.RunChat.test.tsx(active-idle shows the copy, composer present, no reply POST;state ''keeps the locating placeholder; an ended run never shows it).spawn-argvobligation untouched; whitespace-only normalizes to""(test); empty box sends nofirst_messagekey (test).go test ./...green except the pre-existing sandbox-environmentalinternal/tmuxxintegration failures (fail identically on clean main — no runnable tmux here);go build ./...andgo build -tags ui ./cmd/...green;golangci-lint run(2.12.2, CI's pin) 0 issues; gofmt clean; web: 557/557 vitest, eslint clean, prettier clean,vite buildgreen.Notes for review
/(New-run) and/runs/:idfor an idle codex instance.Closes #96
🤖 Generated with Claude Code
https://claude.ai/code/session_01Poub8fVRSFNrYq1PgMAtWt