fix(mobile): persist selected execution mode across prompts#2558
Open
dmarticus wants to merge 1 commit into
Open
fix(mobile): persist selected execution mode across prompts#2558dmarticus wants to merge 1 commit into
dmarticus wants to merge 1 commit into
Conversation
When creating a task, the new-task screen passed the user's chosen execution
mode as `initialPermissionMode` to the first cloud run but never seeded
`taskStore.composerConfigByTaskId[task.id]`. As a result, the task detail
screen read `composerConfig` as `undefined` and fell back to
`DEFAULT_EXECUTION_MODE` ("plan"). Since each agent turn completes its run,
every follow-up prompt went through the resume-after-terminal path and started
a fresh run with `initialPermissionMode: "plan"`, reverting the session to plan
mode regardless of the user's initial choice.
Seed the per-task composer config with the selected mode/model/reasoning at
task creation so the detail screen reflects them and every subsequent run
reuses the selected mode for the duration of the session.
Generated-By: PostHog Code
Task-Id: 6d87d732-7ac9-4633-89e2-d2be6efdcd67
Contributor
|
Reviews (1): Last reviewed commit: "fix(mobile): persist selected execution ..." | Re-trigger Greptile |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the mobile app, the execution mode reverts to plan after every subsequent prompt, even when the user changes it (e.g. to "accept edits") at task creation. The selected mode should persist for the duration of the session.
Root cause
The new-task screen (
apps/mobile/src/app/task/index.tsx) let the user pick a mode and passed it asinitialPermissionModeto the first cloud run — but never wrote that choice intotaskStore.composerConfigByTaskId[task.id].So on the task detail screen,
composerConfigfor that task wasundefinedandcomposerModefell back toDEFAULT_EXECUTION_MODE = "plan". Since each agent turn completes its run on the cloud, every follow-up prompt goes through the resume-after-terminal path, which starts a fresh run withinitialPermissionMode: composerMode— i.e."plan". That's why it reverted on every subsequent prompt.(The agent retains the mode correctly within a single run — the reversion was purely the mobile client sending
"plan"to each new run.)Fix
When a task is created, seed the per-task composer config with the mode/model/reasoning the user selected:
Now the detail screen reflects the chosen mode, and every subsequent resume run reuses it for the duration of the session. This also keeps model and reasoning selections consistent across follow-ups, which had the same gap.
Changing the mode mid-session via the detail-screen pill already persisted correctly (
handleModeChangecallssetComposerConfig), so that path is unaffected.Notes
"plan", which is the intended fallback.🤖 Generated with Claude Code