Repository navigation
Conversation
📝 WalkthroughWalkthroughMobile worktree creation no longer resolves or sends client-side startup commands. A shared helper derives 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
210ea26 to
33daf73
Compare
…gent The New Workspace flow built a bare launch command client-side and sent it as `startupCommand`, so the host ran it verbatim and never applied the default launch args. The first Claude session therefore started in manual mode, while opening another Claude via the "+" tab (which sends the agent id and lets the host resolve args) started with `--dangerously-skip-permissions`. Send `startupAgent` from every client-built create path (blank, reuse-branch, and new-branch) so the host resolves the launch command, args, env, and host-shell quoting through the same path the "+" new-tab and CLI use. The work-item path already delegated via `startupDraft`. Custom `agentDefaultArgs` are now honored on all paths. Adds a shared `agentLaunchCreateFields` helper and removes the now-unused client-side command map, which had also drifted from the canonical launch commands for continue, hermes, command-code, kiro, and mistral-vibe. Claude-Session: https://claude.ai/code/session_014iufZnQwPD2obYuvdahjaE
33daf73 to
92a5084
Compare
|
Thanks so much @kaynansc — great catch — the mobile new-session was launching the agent in a different permission mode than the + tab. Verified (fail-on-main/pass-on-branch) and merged. 🙏 |
…gent (stablyai#8469) The New Workspace flow built a bare launch command client-side and sent it as `startupCommand`, so the host ran it verbatim and never applied the default launch args. The first Claude session therefore started in manual mode, while opening another Claude via the "+" tab (which sends the agent id and lets the host resolve args) started with `--dangerously-skip-permissions`. Send `startupAgent` from every client-built create path (blank, reuse-branch, and new-branch) so the host resolves the launch command, args, env, and host-shell quoting through the same path the "+" new-tab and CLI use. The work-item path already delegated via `startupDraft`. Custom `agentDefaultArgs` are now honored on all paths. Adds a shared `agentLaunchCreateFields` helper and removes the now-unused client-side command map, which had also drifted from the canonical launch commands for continue, hermes, command-code, kiro, and mistral-vibe. Claude-Session: https://claude.ai/code/session_014iufZnQwPD2obYuvdahjaE Co-authored-by: kaynan <[email protected]>
Summary
Fixes mobile "New Workspace" sessions launching a picked agent in the wrong permission mode versus opening the same agent from the tab bar's +.
ELI5
On phones, starting Claude from the "new session" screen made it ask for permission on every action, while starting the same Claude from the + button didn't. Now both start it the same way.
Root cause & fix
The mobile New Workspace modal built a bare launch command (e.g.
claude) client-side from a staticMOBILE_TUI_AGENT_LAUNCH_COMMANDSmap and passed it asstartupCommand, which the host runs verbatim — skipping default launch args (notably--dangerously-skip-permissions) and host-shell quoting. The + new-tab path instead sends only the agent id and lets the host resolve args. The fix makes every client create path sendstartupAgentvia a sharedagentLaunchCreateFields(agentId)helper (returning{ startupAgent, createdWithAgent }), so the host resolves launch command, args, env, and quoting through the same path as + and the CLI. The dead map and modalagentCmdOverridestype are removed.Evidence
Validated & rebased onto latest main during a bug-bash triage on 2026-07-23. Rebase was clean onto
origin/main.blank-workspace-create.test.ts,workspace-create-params.test.ts,source-workspace-create.test.ts(run via vitest frommobile/).oxlinton the 6 changed source files — clean, no warnings/errors.MOBILE_TUI_AGENT_LAUNCH_COMMANDS;agentCmdOverridesonly referenced in unrelated code;isMobileTuiAgentstill exported for other modules.Trade-offs
None — pure fix.
Regression risk
Zero-regression rationale: only the client create paths change what they send (
startupAgentinstead of a pre-builtstartupCommand), converging on the already-correct host resolution used by + and the CLI. The host schema already acceptedstartupAgent; non-affected paths are unchanged. Proven by the passing branch tests and the reverted-fix failures. No dangling references were found.Credit to original author @kaynansc. Validated, rebased, and (where applicable) hardened via automated bug-bash review; original fix design preserved.