Skip to content

fix(onboarding): recover compatible models in guided setup#2250

Open
bmahabirbu wants to merge 1 commit into
openkaiden:mainfrom
bmahabirbu:fix/2241-guided-setup-flow
Open

fix(onboarding): recover compatible models in guided setup#2250
bmahabirbu wants to merge 1 commit into
openkaiden:mainfrom
bmahabirbu:fix/2241-guided-setup-flow

Conversation

@bmahabirbu

@bmahabirbu bmahabirbu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #2241.

Summary

  • move guided setup recovery to the model step so users can stay in onboarding when an agent has no compatible models
  • keep Claude and Claude Vertex setup inline in guided setup while leaving local runtime recovery for OpenCode and OpenClaw
  • bind onboarding state through the guided-setup step chain and add focused tests for the new recovery behavior
Screencast.From.2026-06-22.21-02-30.mp4

Test plan

  • pnpm vitest run packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts packages/renderer/src/lib/guided-setup/ModelStep.spec.ts packages/renderer/src/lib/guided-setup/GuidedSetup.spec.ts packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • ReadLints on the edited guided-setup files
  • manual onboarding smoke test in the app

Made with Cursor

@bmahabirbu bmahabirbu requested a review from a team as a code owner June 23, 2026 01:08
@bmahabirbu bmahabirbu requested review from benoitf and gastoner and removed request for a team June 23, 2026 01:08
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a refreshInferenceSources utility combining fetchProviders and fetchInferenceConnectionSummaries. Claude panels (ClaudePanel, ClaudeVertexPanel) gain registerBeforeAdvance and advanceOnSuccess props. GuidedSetup switches to bind:onboarding. CodingAgentStep centralizes agent filtering and conditionally passes onboarding to panels. ModelStep adds inline connection recovery when no compatible models exist.

Changes

Guided-setup onboarding refactor

Layer / File(s) Summary
refreshInferenceSources utility
packages/renderer/src/lib/guided-setup/refresh-inference-sources.ts, packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
New module sequentially awaits fetchProviders() then fetchInferenceConnectionSummaries(); OpenRuntimePanel probe retry switches from fetchProviders to refreshInferenceSources.
ClaudePanel and ClaudeVertexPanel prop extensions
packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte, packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
Both panels add optional registerBeforeAdvance and advanceOnSuccess props (default true); beforeAdvance registration is now guarded by registerBeforeAdvance, and validate() returns advanceOnSuccess on success; post-connection refresh switches to refreshInferenceSources.
GuidedSetup and CodingAgentStep: bindable onboarding wiring
packages/renderer/src/lib/guided-setup/GuidedSetup.svelte, packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
GuidedSetup switches onboarding to bind:onboarding; CodingAgentStep uses $bindable(), centralizes agent filtering via getFilteredDefinitions, and conditionally passes onboarding with registerBeforeAdvance={false} to panels that have providerSelector.
ModelStep: compatible-connection recovery
packages/renderer/src/lib/guided-setup/ModelStep.svelte
Adds fallbackErrorMessage, derived flags (hasCompatibleModels, canRecoverInline, usesInlineConnectionValidation), and requireCompatibleModel to block advance when no compatible model exists; renders inline connection setup panel when available; heading uses selectedAgentLabel.
Tests
packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts, packages/renderer/src/lib/guided-setup/ModelStep.spec.ts, packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts, packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
All test suites add vi.mock for inference-connection-summaries; new tests cover Claude tile leaving beforeAdvance undefined, registerBeforeAdvance: false, advanceOnSuccess: false, and the full compatible connection recovery flow with auto-model selection after creating a Claude connection.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • openkaiden/kaiden#1899: The refreshInferenceSources utility and all test mocks for fetchInferenceConnectionSummaries directly depend on the inference-connection-summaries backend store introduced in this PR.
  • openkaiden/kaiden#1663: Both PRs modify ModelStep.svelte and its tests; the retrieved PR introduces the model step and ModelSelectionTable, which this PR extends with recovery logic and inline connection setup.
  • openkaiden/kaiden#1537: Both PRs modify ClaudeVertexPanel.svelte; the retrieved PR introduces the Vertex onboarding panel that this PR extends with registerBeforeAdvance/advanceOnSuccess and refreshInferenceSources.

Suggested reviewers

  • MarsKubeX
  • benoitf
  • gastoner
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: recovering compatible models in guided setup, matching the core objective of moving model recovery to the model step.
Linked Issues check ✅ Passed The PR fulfills issue #2241 requirements: it implements agent selection (CodingAgentStep), compatible model selection (ModelStep), and recovery when no compatible models exist via inline connection setup.
Out of Scope Changes check ✅ Passed All changes are scoped to guided setup refactoring and onboarding recovery flow; no unrelated modifications detected in the changeset.
Description check ✅ Passed The PR description clearly relates to the changeset, explaining the motivation (fixing #2241), summarizing key changes (moving recovery to model step, binding onboarding state), and listing test coverage and verification steps.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte (1)

39-42: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

advanceOnSuccess is bypassed when a connection already exists.

validate() now returns advanceOnSuccess on the create-connection success path, but the alreadyConnected branch still returns true. That makes advanceOnSuccess={false} ineffective for existing connections.

Suggested change
 async function validate(): Promise<boolean> {
   if (alreadyConnected) {
-    return true;
+    return advanceOnSuccess;
   }

Also applies to: 95-95

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte` around
lines 39 - 42, The validate() function in ClaudePanel.svelte returns true
directly when alreadyConnected is true, which bypasses the advanceOnSuccess
parameter that should control the behavior in all cases. Modify the
alreadyConnected branch to return advanceOnSuccess instead of true, so that the
advanceOnSuccess setting is respected consistently whether the connection
already exists or is being newly created.
packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte (1)

61-64: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

advanceOnSuccess is ignored in the alreadyConnected fast path.

The new success-control prop is applied after connection creation, but not when alreadyConnected is true, so validation can still advance unexpectedly.

Suggested change
 async function validate(): Promise<boolean> {
   if (alreadyConnected) {
-    return true;
+    return advanceOnSuccess;
   }

Also applies to: 143-143

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte`
around lines 61 - 64, The validate() function in ClaudeVertexPanel.svelte
returns true immediately when alreadyConnected is true, bypassing the
advanceOnSuccess prop handling that should apply to all successful validations.
Modify the early return path in the alreadyConnected condition to ensure the
advanceOnSuccess prop is applied before returning true, so the success-control
behavior is consistent across both the alreadyConnected fast path and the
regular connection flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/renderer/src/lib/guided-setup/ModelStep.spec.ts`:
- Around line 103-118: The code currently creates only a single summary by
accessing inferenceConnections[0], which collapses all configured connections
for a provider into one entry. Replace the single representative assignment with
a loop that iterates through each element in the inferenceConnections array. For
each connection in the array, create a separate summary object with the same
structure currently shown, using that specific connection's properties instead
of always using the first connection. This ensures each configured inference
connection gets its own summary entry rather than hiding multiple connections
behind a single representative.

In `@packages/renderer/src/lib/guided-setup/ModelStep.svelte`:
- Around line 79-87: The effect hook's early return condition on line 80 skips
setting the requireCompatibleModel guard when usesInlineConnectionValidation is
true, which allows advancing without a selected effectiveModel. Modify the
condition to only skip the guard setup when effectiveModel already exists,
removing the usesInlineConnectionValidation check from the early return logic.
This ensures the requireCompatibleModel gate remains active to prevent advancing
from the "No compatible models" state even when inline connection validation has
passed, until an actual effectiveModel is selected. Apply the same logic fix to
the related code at lines 132-133.
- Around line 64-72: The $effect block in ModelStep.svelte returns early when
effectiveModel is falsy without clearing the previous onboarding.model value,
leaving stale data that gets persisted later when agents are switched or
compatibility is lost. Modify the early return condition to explicitly clear
onboarding.model (set it to null or undefined) before returning, ensuring no
stale model data remains when effectiveModel is absent.

In `@packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte`:
- Around line 8-10: Replace the relative import paths with the configured `/@/`
alias for the three imports that reference modules outside the panels directory.
Specifically, convert the imports for AgentDefinition from '../agent-registry',
OnboardingState from '../guided-setup-steps', and the refreshInferenceSources
function from '../refresh-inference-sources' to use paths prefixed with `/@/`
instead, following the coding guideline that imports outside the current module
group should use the alias style.

In `@packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte`:
- Around line 13-15: Replace the relative imports in ClaudeVertexPanel.svelte
that use `../` paths with the `/@/` alias convention. The three imports for
AgentDefinition, OnboardingState, and refreshInferenceSources all climb to
parent directories and should be converted to use the repository's alias path
pattern instead of relative paths, as per the coding guidelines for non-sibling
imports.

In `@packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte`:
- Around line 8-9: Replace the relative imports that point outside the current
directory with their corresponding `/@/` aliases. Specifically, convert the
import of AgentDefinition from '../agent-registry' and the import of
refreshInferenceSources from '../refresh-inference-sources' to use the `/@/`
alias convention instead of relative paths. This follows the repo's coding
guidelines where relative imports should be reserved only for sibling modules
within the same directory.

---

Outside diff comments:
In `@packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte`:
- Around line 39-42: The validate() function in ClaudePanel.svelte returns true
directly when alreadyConnected is true, which bypasses the advanceOnSuccess
parameter that should control the behavior in all cases. Modify the
alreadyConnected branch to return advanceOnSuccess instead of true, so that the
advanceOnSuccess setting is respected consistently whether the connection
already exists or is being newly created.

In `@packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte`:
- Around line 61-64: The validate() function in ClaudeVertexPanel.svelte returns
true immediately when alreadyConnected is true, bypassing the advanceOnSuccess
prop handling that should apply to all successful validations. Modify the early
return path in the alreadyConnected condition to ensure the advanceOnSuccess
prop is applied before returning true, so the success-control behavior is
consistent across both the alreadyConnected fast path and the regular connection
flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 06e34def-7337-4dca-8f36-b4a32050e260

📥 Commits

Reviewing files that changed from the base of the PR and between 677e04b and 5c07b0f.

📒 Files selected for processing (11)
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/refresh-inference-sources.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (9)
  • GitHub Check: Linux
  • GitHub Check: Windows
  • GitHub Check: smoke-e2e-tests (dev) / ubuntu-24.04 (ollama)
  • GitHub Check: smoke-e2e-tests (prod) / ubuntu-24.04 (ollama)
  • GitHub Check: unit tests / ubuntu-24.04
  • GitHub Check: unit tests / macos-15
  • GitHub Check: macOS
  • GitHub Check: unit tests / windows-2022
  • GitHub Check: linter, formatters
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use /@/ path aliases instead of relative paths for imports outside the current directory's module group; use relative imports only for sibling modules within the same directory

Files:

  • packages/renderer/src/lib/guided-setup/refresh-inference-sources.ts
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
packages/{main,renderer,preload}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Container operations must include engineId parameter to identify the container engine

Files:

  • packages/renderer/src/lib/guided-setup/refresh-inference-sources.ts
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
**/*.spec.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.spec.{ts,tsx,js,jsx}: Use test() instead of it() for test cases in Vitest unit tests
Use vi.mock(import('...')) for auto-mocking modules in unit tests; avoid manual mock factories when possible
Use vi.resetAllMocks() in beforeEach hooks instead of vi.clearAllMocks() for resetting mocks between tests
When an auto-mocked function or class method needs a real implementation, use vi.mocked(...) with the prototype pattern for class methods: vi.mocked(MyClass.prototype.myMethod).mockImplementation(...)

Files:

  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
🧠 Learnings (10)
📚 Learning: 2026-04-15T08:04:32.031Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1336
File: packages/renderer/src/lib/guided-setup/GuidedSetup.svelte:9-11
Timestamp: 2026-04-15T08:04:32.031Z
Learning: For Svelte components in this repo, if a callback prop is typed as `() => void`, TypeScript idiomatically allows passing async functions (e.g., `() => Promise<void>`), because `() => void` indicates the caller ignores the return value rather than requiring `undefined`. Do not recommend changing these prop types to `() => void | Promise<void>` solely to “fix” async compatibility—unless there is an actual need for the caller to observe the returned value.

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
📚 Learning: 2026-04-20T14:29:13.040Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1396
File: packages/renderer/src/lib/guided-setup/AgentTileCard.svelte:30-32
Timestamp: 2026-04-20T14:29:13.040Z
Learning: In this repository’s guided-setup Svelte components, allow the hard-coded Tailwind success/badge indicator classes `text-green-400` and `bg-green-400/10` (e.g., for the “Recommended” badge in `AgentTileCard.svelte` and the probe-detected success state in `CodingAgentStep.svelte`). Do not treat these specific green classes as a “color-registry/semantic token” violation as long as no semantic color-registry tokens for badge-style success states exist; reassess and update once the color registry is extended to include theme-safe success/badge tokens.

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
📚 Learning: 2026-04-23T11:33:35.749Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1431
File: packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte:43-52
Timestamp: 2026-04-23T11:33:35.749Z
Learning: In the guided-setup UI for openkaiden/kaiden, treat `CliAgent` as the source-of-truth union type for agent names supported by the `kdn` CLI (e.g., the values accepted by `kdn init --agent`). The UI registry `agentDefinitions` (in `agent-registry.ts`) must be a subset that satisfies/conforms to `CliAgent` and must not define or derive `CliAgent`. Do not suggest deriving `CliAgent` from the UI registry (that would invert the intended dependency direction). In places like `CodingAgentStep.svelte`, an `as CliAgent` cast is acceptable only when it’s safe by construction—i.e., when the source value such as `agentDefinitions[].cliName` is already typed as `CliAgent`.

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/refresh-inference-sources.ts
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
📚 Learning: 2026-04-28T13:34:51.610Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1431
File: packages/renderer/src/lib/guided-setup/panels/OpenCodePanel.svelte:14-20
Timestamp: 2026-04-28T13:34:51.610Z
Learning: In this repo’s Svelte renderer (packages/renderer/src/**/*.svelte), `podman-desktop/ui-svelte`’s `Link` component does not accept an `href` prop. For opening external URLs, use the established pattern `on:click={() => window.openExternal(url)}` (optionally typed as `on:click={(): Promise<void> => window.openExternal(url)}`), consistent with existing components like `ProviderLinks.svelte`, `WelcomePage.svelte`, and `OpenCodePanel.svelte`. Do not treat `window.openExternal()` usage in renderer Svelte components as bypassing a security restriction, and do not recommend replacing it with `Link`/`href`-based navigation. (There is also no `setupSecurityRestrictionsOnLinks` utility in the renderer.)

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
📚 Learning: 2026-04-29T11:54:22.423Z
Learnt from: vancura
Repo: openkaiden/kaiden PR: 1494
File: packages/renderer/src/Loader.svelte:13-13
Timestamp: 2026-04-29T11:54:22.423Z
Learning: In this codebase’s renderer, timer variables in Svelte files (e.g., in `packages/renderer/src/Loader.svelte`) that store `setTimeout` handles are intentionally typed as `NodeJS.Timeout` (and not `ReturnType<typeof setTimeout>`). When reviewing, do not flag or recommend changing this to `ReturnType<typeof setTimeout>` for portability—treat `NodeJS.Timeout` as the established convention for renderer timer variables.

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
📚 Learning: 2026-05-04T17:39:49.418Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1603
File: packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte:61-70
Timestamp: 2026-05-04T17:39:49.418Z
Learning: When reviewing renderer Svelte code that calls the IPC `createSecret` handler via `window.createSecret`, don’t suggest switching to checks like `err.code` or a typed/custom error class until the backend IPC layer exposes structured error information. Today the IPC handler only throws a plain `Error` with a human-readable message string, so the only viable way to distinguish cases like “secret already exists” is to perform message substring matching (e.g., `err.message.includes('already exists')`) and handle that branch explicitly.

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
📚 Learning: 2026-05-12T17:14:02.153Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1850
File: packages/renderer/src/lib/agent-workspaces/AgentWorkspaceList.svelte:66-70
Timestamp: 2026-05-12T17:14:02.153Z
Learning: When reviewing code that uses `AgentWorkspaceSummaryUI.runtime`, treat it as a required, non-null `string` per the `openkaiden/kdn-api` 0.12.0 schema. Therefore, code like `a.runtime.localeCompare(b.runtime)` is safe and should not trigger warnings about possible `undefined`/`null` values or suggestions to use nullish coalescing/optional chaining for `runtime` (unless the current local types still mark `runtime` as optional, indicating a schema/version mismatch).

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/refresh-inference-sources.ts
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
📚 Learning: 2026-06-10T15:22:39.639Z
Learnt from: bmahabirbu
Repo: openkaiden/kaiden PR: 2115
File: packages/renderer/src/lib/models/SemanticRouterCreate.svelte:134-137
Timestamp: 2026-06-10T15:22:39.639Z
Learning: In multi-step wizard UIs, it’s acceptable for “Next step” buttons to be temporarily non-interactive during incremental work delivered across multiple PRs. When reviewing Svelte files under `packages/renderer/src/lib/**`, do not flag these UX issues if the button lacks an onClick handler *and* there is an explicit TODO comment indicating deferred wiring, and the PR author confirms (in the PR description) that this is an intentional staged implementation. If no TODO/deferred-wiring marker (or no author confirmation) is present, treat missing handlers as a potential UX issue.

Applied to files:

  • packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte
  • packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte
  • packages/renderer/src/lib/guided-setup/ModelStep.svelte
  • packages/renderer/src/lib/guided-setup/GuidedSetup.svelte
📚 Learning: 2026-04-15T08:51:08.199Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1336
File: packages/renderer/src/lib/guided-setup/GuidedSetup.spec.ts:64-69
Timestamp: 2026-04-15T08:51:08.199Z
Learning: For Svelte component test files under `packages/renderer/src/**` with names ending in `.spec.ts` that use `render` from `testing-library/svelte`, call `vi.useFakeTimers({ shouldAdvanceTime: true })` inside a `beforeEach`. Keep it in `beforeEach` for these tests to avoid flakiness from Svelte’s internal tick scheduling; do not remove or flag it based on the presence/absence of explicit timer manipulation in individual tests.

Applied to files:

  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
📚 Learning: 2026-06-16T06:15:26.225Z
Learnt from: gastoner
Repo: openkaiden/kaiden PR: 2145
File: packages/renderer/src/lib/mcp/MCPServerRemoteListActions.spec.ts:46-49
Timestamp: 2026-06-16T06:15:26.225Z
Learning: For renderer unit tests in this repo (files included in `packages/renderer/vite.config.js` via `setupFiles`), do not manually mock `window` API methods in `beforeEach` or within the spec. The test setup (`packages/renderer/vite.tests.setup.js`) reads `packages/preload/exposedInMainWorld.d.ts` and defines each declared `Window` method on `window` as a `vi.fn()` using `Object.defineProperty`, so `window.*` methods (e.g., `startMcpServer`, `stopMcpServer`, `showMessageBox`) are already present as mocks. Only add an explicit mock if the method is not declared in `exposedInMainWorld.d.ts` (in which case update the `.d.ts` so the shared setup can generate the mock).

Applied to files:

  • packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts
  • packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts
  • packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
🔇 Additional comments (9)
packages/renderer/src/lib/guided-setup/GuidedSetup.svelte (1)

145-149: LGTM!

packages/renderer/src/lib/guided-setup/CodingAgentStep.svelte (1)

10-22: LGTM!

Also applies to: 32-40, 55-59, 75-79

packages/renderer/src/lib/guided-setup/ModelStep.svelte (1)

3-3: LGTM!

Also applies to: 16-16, 25-25, 43-43, 56-63, 89-131, 134-144

packages/renderer/src/lib/guided-setup/refresh-inference-sources.ts (1)

1-7: LGTM!

packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte (1)

31-39: LGTM!

packages/renderer/src/lib/guided-setup/CodingAgentStep.spec.ts (1)

25-46: LGTM!

Also applies to: 170-170, 226-240

packages/renderer/src/lib/guided-setup/panels/ClaudePanel.spec.ts (1)

26-47: LGTM!

Also applies to: 129-134, 159-159, 186-207

packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.spec.ts (1)

27-48: LGTM!

Also applies to: 154-159, 209-209, 236-265

packages/renderer/src/lib/guided-setup/ModelStep.spec.ts (1)

25-55: LGTM!

Also applies to: 121-157, 174-178, 192-212, 229-237, 303-359

Comment thread packages/renderer/src/lib/guided-setup/ModelStep.spec.ts
Comment thread packages/renderer/src/lib/guided-setup/ModelStep.svelte
Comment on lines +79 to 87
$effect(() => {
if (effectiveModel || usesInlineConnectionValidation) return;
onboarding.beforeAdvance = requireCompatibleModel;
return (): void => {
if (onboarding.beforeAdvance === requireCompatibleModel) {
onboarding.beforeAdvance = undefined;
}
};
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep the no-model gate active after inline panel validation.

When usesInlineConnectionValidation is true, line 80 skips requireCompatibleModel, so the inline panel becomes the only beforeAdvance guard. But ClaudePanel.svelte returns true immediately for alreadyConnected, before applying advanceOnSuccess, which can advance from the “No compatible models” state with no selectable effectiveModel. Ensure the final continue result is still false while !effectiveModel, even when the inline panel has validated or found an existing connection.

Also applies to: 132-133

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/renderer/src/lib/guided-setup/ModelStep.svelte` around lines 79 -
87, The effect hook's early return condition on line 80 skips setting the
requireCompatibleModel guard when usesInlineConnectionValidation is true, which
allows advancing without a selected effectiveModel. Modify the condition to only
skip the guard setup when effectiveModel already exists, removing the
usesInlineConnectionValidation check from the early return logic. This ensures
the requireCompatibleModel gate remains active to prevent advancing from the "No
compatible models" state even when inline connection validation has passed,
until an actual effectiveModel is selected. Apply the same logic fix to the
related code at lines 132-133.

Comment thread packages/renderer/src/lib/guided-setup/panels/ClaudePanel.svelte Outdated
Comment thread packages/renderer/src/lib/guided-setup/panels/ClaudeVertexPanel.svelte Outdated
Comment thread packages/renderer/src/lib/guided-setup/panels/OpenRuntimePanel.svelte Outdated
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../renderer/src/lib/ui/ScrollableCardSelector.svelte 54.54% 5 Missing ⚠️
...nderer/src/lib/guided-setup/CodingAgentStep.svelte 92.85% 1 Missing ⚠️
...s/renderer/src/lib/guided-setup/GuidedSetup.svelte 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Move compatible connection setup to the model step so onboarding
can recover when an agent has no usable models without sending
users away from the flow. Follow up with the guided-setup and
warning fixes needed to keep the recovery flow safe. Fixes
openkaiden#2241.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Brian <bmahabir@bu.edu>
@bmahabirbu bmahabirbu force-pushed the fix/2241-guided-setup-flow branch from 5c07b0f to a2cb2f9 Compare June 23, 2026 01:49

@MarsKubeX MarsKubeX left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I find a bit confusing when you are in step 2 and does not have any compatible model and you are able to create a connection to get models: you click on "go to dashboard" when the action performed is "create a connection". IMO the create connection should have a dedicated button in step 2 to create connection and once created, listing models, all in step 2. So when the user clicks on go to dashboard he really goes to dashboard.
  • Also I have a question, should we keep the "API KEY" section in step 1? could it be better to only let the agents types and check them in the next step?

WDYT @jeffmaury?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update onboarding

2 participants