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 |
| const freshTask = await this.ports.api.getTask(taskId); | ||
| const previousRun = freshTask.latestRun; | ||
| const composerConfig = this.ports.preferences.getComposerConfig(taskId); | ||
| const adapter = composerConfig?.adapter ?? previousRun?.adapter; |
There was a problem hiding this comment.
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.
| const adapter = composerConfig?.adapter ?? previousRun?.adapter; | |
| const adapter = | |
| composerConfig?.adapter ?? previousRun?.adapter ?? "claude"; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/sessions/cloudTaskSessionService.ts
Line: 402
Comment:
**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";
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| ? reasoningEffort | ||
| : adapterChanged | ||
| ? undefined | ||
| : (previousRun?.reasoningEffort ?? undefined), |
There was a problem hiding this comment.
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.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/sessions/cloudTaskSessionService.ts
Line: 425-428
Comment:
**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.
How can I resolve this? If you propose a fix, please make it concise.e917fbd to
0f867aa
Compare
44c9001 to
515fcec
Compare
0f867aa to
c01f356
Compare
Generated-By: PostHog Code Task-Id: 11daf8d3-7830-436a-ab8f-99123586070d
Generated-By: PostHog Code Task-Id: 11daf8d3-7830-436a-ab8f-99123586070d
Generated-By: PostHog Code Task-Id: 11daf8d3-7830-436a-ab8f-99123586070d
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
Generated-By: PostHog Code Task-Id: c1bbe3cf-742b-4b24-bf96-d11a18b4cf22
515fcec to
132174b
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
Problem
Mobile task creation hardcoded Claude, and its new-task and conversation screens had drifted from desktop. Runtime choices could also be lost or mapped to Claude-specific configuration when retrying or resuming Codex tasks.
Changes
I added Claude and Codex controls across task creation, retry, and resume using the shared model and reasoning policies. Adapter-specific execution modes, defaults, and cloud reasoning keys now come from core. Native rendering remains in mobile.
How did you test this?
Automatic notifications
Created with PostHog Code