feat: make freshclaude capability-driven#312
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 698876cc2f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| createSentRef.current = true | ||
| dispatch(registerPendingCreate({ | ||
| requestId: paneContent.createRequestId, | ||
| expectsHistoryHydration: Boolean(paneContent.resumeSessionId), | ||
| })) | ||
| ws.send({ | ||
| type: 'sdk.create', | ||
| requestId: paneContent.createRequestId, | ||
| model: paneContent.model ?? defaultModel, | ||
| permissionMode: paneContent.permissionMode ?? defaultPermissionMode, | ||
| effort: paneContent.effort ?? defaultEffort, | ||
| ...(paneContent.initialCwd ? { cwd: paneContent.initialCwd } : {}), | ||
| ...(paneContent.resumeSessionId ? { resumeSessionId: paneContent.resumeSessionId } : {}), | ||
| ...(paneContent.plugins ? { plugins: paneContent.plugins } : {}), | ||
| }) | ||
| let cancelled = false |
There was a problem hiding this comment.
Reset create latch when pre-create validation is canceled
This effect marks createSentRef as true before the async capability fetch/validation finishes, but the cleanup path only flips cancelled and never clears the latch. If dependencies change while validation is in flight (for example settings hydration updates providerSettings, or the user edits model/effort while status is still creating), the rerun exits early on createSentRef.current and sdk.create is never sent, leaving the pane stuck in creating.
Useful? React with 👍 / 👎.
| [model, resolvedModelOptions], | ||
| ) | ||
| const resolvedEffortOptions = effortOptions ?? [] | ||
| const showCapabilityControls = capabilitiesStatus !== 'failed' |
There was a problem hiding this comment.
Keep model/effort controls available after capability probe failure
When capability loading fails, this flag hides both model and effort controls. Combined with the new create-time validation (which blocks creation when an effort/exact selection cannot be validated), users with a saved effort override can be unable to recover locally: they can retry probing, but cannot clear the effort/model selection to allow session creation without capabilities.
Useful? React with 👍 / 👎.
Summary
sdk.createso capability refreshes do not break restoring sessionsTesting
npm testnpm run test:vitest -- test/e2e/agent-chat-restore-flow.test.tsx test/unit/client/components/agent-chat/AgentChatView.reload.test.tsx --maxWorkers 1npm run test:vitest -- --config vitest.server.config.ts test/server/agent-run.test.ts --maxWorkers 1