Repository navigation
fix(native-chat): send launch prompts and worker tasks through the retrying start - #33832
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2d6a1784-e2b2-454e-96dd-dd50637df1c9
Files selected for processing: 14-
src/main/agent-launch/agent-launch-executor-cancel.test.tssrc/main/agent-launch/agent-launch-executor.test.tssrc/main/agent-launch/agent-launch-executor.tssrc/main/agent-launch/agent-launch-prompt-delivery.tssrc/main/agent-launch/agent-launch-surface-factories.tssrc/main/native-chat/agent-session-wire/structured-agent-session-launch-send-after-create.test.tssrc/main/runtime/rpc/methods/agent-launch-at-rest.test.tssrc/main/runtime/rpc/methods/agent-launch-caller-selection.test.tssrc/main/runtime/rpc/methods/agent-launch-structured-prompt.test.tssrc/main/runtime/rpc/methods/agent-launch-structured-prompt.tssrc/main/runtime/rpc/methods/agent-launch-surfaces.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-retry.test.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-session.tssrc/main/runtime/rpc/methods/structured-agent-session-create.ts
Files with no reviewable changes: 4-
- src/main/native-chat/agent-session-wire/structured-agent-session-launch-send-after-create.test.ts
- src/main/agent-launch/agent-launch-executor-cancel.test.ts
- src/main/runtime/rpc/methods/agent-launch-structured-prompt.ts
- src/main/runtime/rpc/methods/agent-launch-structured-prompt.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
20cceae9-2c4a-4e02-adc9-978d42b700f7
Files selected for processing: 3-
src/main/agent-launch/agent-launch-prompt-delivery.tssrc/main/runtime/rpc/methods/agent-launch-at-rest.test.tssrc/main/runtime/rpc/methods/orchestration-structured-worker-retry.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
89f004f5-37e1-41a3-866b-9772dec9d1f5
Files selected for processing: 2-
src/main/runtime/rpc/methods/agent-launch-surfaces.tstests/e2e/agent-launch-cli.unit.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
|
A prompted launch could leave the saved message unsent after a transient agent-start failure, while a normal composer send retried. Background workers could fail before delivering their task. Submitted prompts now use the chat creation's existing first-message receipt and retrying start. Local workers are created at rest so their agent-sourced task starts the same retrying path. Bare and draft launch behavior is preserved. The full source review finished in four rounds with no open P0/P1. Fixed whitespace-only RPC prompts being dispatched as empty turns, bounded option filtering to the existing seed keys, preserved the encoded seed map with one codec pass, and corrected stale executor/replay fixtures. The test audit retained distinct retry, exhaustion, replay, publication uncertainty and worker-provenance contracts, and removed duplicate/implementation-specific checks. A fresh round-3 decider kept the lifecycle architecture and authorized only the encoding correction. The common-pattern comparison and performance/readiness reviews are complete. Deferred P2: an internal signal-bearing executor can commit if aborted during create preparation. No current production structured-launch caller supplies that signal, so the review did not broaden cancellation behavior. Generic explicit permission omission predates this change and is outside this PR. Validation: 92 named tests and commit hooks passed at premerge All real QA below ran at Real QA has completed both prompted worktree CLI launches, both older-client launches, both structured workers, and both retained-state upgrades. Each passed launch/worker case used one verified first-start provider termination and automatic recovery to a real reply. Worker evidence shows one agent-sourced accepted preamble and one successful turn; Codex emitted the same token in commentary and final answer within that turn. The targeted older-client Codex case also recovered to a real reply after a strict QA controller repair for the installed launcher wrapper. Earlier 429 trials and a no-fault compatibility trial remain recorded separately. No passed flow was repeated. Upgrade evidence retained main-created sessions/history/provider identities through a graceful stop into the exact unmodified branch, then two ordered sends/replies per agent across git and folder workspaces. Codex's main seed never received a successful reply because of 429; its original failed history was retained and resumed successfully. Independent evidence review confirmed that this covers the upgrade requirement, with that plan deviation recorded. For Brennan's review: full-window main/branch comparisons below. The historical client uses its actual pinned renderer, bridge and RPC client without the create-message capability; its host adapter is QA-only. Workers are intentionally background sessions, so screenshots show the supported worker-read output in an ordinary isolated app terminal. Retained-state upgrade, two replies each:
Judgment points: first-message construction and receipt, bounded seed selection, and worker creation at rest. QA notes: the targeted Codex run used the installed launcher’s Node wrapper and verified native child, with one pre-ready SIGTERM, a distinct retry provider and one accepted turn. A missing release-log acknowledgment is consistent with an exit race; direct signal and retry receipts establish the recovery. The private QA runtime matched its installed source byte for byte; both reported the same existing strict-signature verification error, with no signing or OS trust changes. |














When a chat started with a prompt fails to start once, the prompt is no longer lost: it now goes through the same start retry as a message typed into the composer.
What broke. Since #33045, a native chat whose first message comes from the desktop composer gets up to five start attempts. Chats created by a launch carrying a prompt did not. The chat was created with its agent starting at once, and the prompt was sent afterwards as a separate message, so a single transient failure while that first agent started (a crash during the handshake, a transient spawn error) wrote " couldn't start" and the prompt read "Your message was not sent." Affected, with the Chat UI on or
--surface chat:orca agent launch <agent> --prompt …andorca worktree create --agent <agent> --prompt …;What changes.
fastModeon a Codex launch) are dropped before the chat is created, so launches that work today are not refused.What a launch reply means now. A successful prompted launch means the chat and its prompt are saved; it no longer implies the agent has started. If the agent cannot start after five attempts, the failure shows on that prompt in the chat. Today a spawn failure before the agent was published failed the launch call itself; that failure now appears in the chat instead.
Differences from the common pattern.
Follow-up to #33045 and #33685. Tracked in STA-11117.
Author: @BrennanKB5