feat(mobile): add Codex task parity - #3654
Conversation
|
React Doctor found 2 issues in 2 files · 2 warnings. 2 warnings
Reviewed by React Doctor for commit |
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
packages/core/src/sessions/cloudTaskSessionService.ts:402
**Legacy Resume Drops Task Controls**
When both the legacy run and its persisted composer config lack an adapter, this remains `undefined`. The mobile API client then omits the resolved model, reasoning, and permission mode with the adapter, so retry can restart an older Claude task using server defaults instead of its previous controls.
```suggestion
const adapter =
composerConfig?.adapter ?? previousRun?.adapter ?? "claude";
```
### Issue 2 of 2
packages/core/src/sessions/cloudTaskSessionService.ts:425-428
**Invalid Run Reasoning Reused**
When the composer reasoning is unsupported and the adapter has not changed, this fallback reuses `previousRun.reasoningEffort` without validating it. If that stored value is also unsupported by the resolved model, the API client rejects the payload and sandbox-inactive retry fails instead of resuming.
Reviews (1): Last reviewed commit: "feat(mobile): add Codex task controls" | Re-trigger Greptile |
e917fbd to
0f867aa
Compare
44c9001 to
515fcec
Compare
0f867aa to
c01f356
Compare
515fcec to
132174b
Compare
e809724 to
ff81e50
Compare
29a77af to
01d941c
Compare
ff81e50 to
c630011
Compare
d4a99d1 to
5e2a064
Compare
498fc78 to
752e25e
Compare
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Keep the workspace on React 19.2 while aligning mobile with the latest supported native runtime. Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
f8e62fb to
9d4a2e4
Compare
3993253 to
9284b42
Compare
|
😎 Merged successfully - details. |
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
| composerConfig?.mode ?? DEFAULT_CLAUDE_EXECUTION_MODE; | ||
| const composerModel = composerConfig?.model ?? DEFAULT_GATEWAY_MODEL; | ||
| (composerConfigMatchesAdapter ? composerConfig?.mode : undefined) ?? | ||
| getDefaultExecutionModeForAdapter(composerAdapter); |
There was a problem hiding this comment.
Low: Resume discards the previous permission mode
For an existing Codex task without a saved mobile composer selection, this falls back to auto instead of the latest run's initial_permission_mode. Both resume and retry subsequently send this value explicitly, so repository-controlled instructions can edit the workspace after the user retries a task that was originally Plan or Read only. Preserve and validate the previous run's mode when the adapter matches, falling back to the adapter default only when no valid prior mode exists.
PR overviewThis pull request adds Codex task parity to the mobile app, including support for resuming and retrying existing tasks with composer permission settings. One issue remains open in the resume and retry flow: tasks previously run in Plan or Read-only mode can fall back to Auto mode when no mobile selection is saved. This could allow repository-provided instructions to modify the workspace after a user retries the task, though exploitation requires that specific task state and user action. No issues have yet been addressed. Open issues (1)
Fixed/addressed: 0 · PR risk: 4/10 |

Problem
Mobile task creation hardcoded Claude, and retry/resume flows could lose or combine runtime choices from different adapters.
Depends on #3642
Refs PostHog/posthog#76229
Changes
Phase 3 product change: I added Claude and Codex controls across task creation, retry, and resume. Core owns adapter transitions and resume-option resolution, including legacy mobile state that predates persisted adapter selection.
How did you test this?
Automatic notifications
Created with PostHog Code