feat: add llmMetadata to inference connection factories - #2131
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (18)
📝 WalkthroughWalkthroughThis PR adds optional ChangesLLM Metadata Factory Registration and Propagation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 @.gitignore:
- Line 25: Update the .gitignore pattern from GH*md to include the missing dot
so it matches standard markdown filenames: change the pattern GH*md to GH*.md
(i.e., insert a dot before md) so entries like GH-2128.md are ignored as
intended.
🪄 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: f34ad6e2-36a1-4235-ba63-3720180e7b3d
📒 Files selected for processing (19)
.gitignoreextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.tsextensions/gemini/src/gemini.spec.tsextensions/gemini/src/gemini.tsextensions/mistral/src/manager/mistral-inference-manager.spec.tsextensions/mistral/src/manager/mistral-inference-manager.tsextensions/openai-compatible/src/openAI.spec.tsextensions/openai-compatible/src/openAI.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/vertex-ai/src/vertex-ai.tspackages/api/src/model-registry-info.tspackages/api/src/provider-info.tspackages/extension-api/src/extension-api.d.tspackages/main/src/plugin/inference-connection-summary-registry.spec.tspackages/main/src/plugin/inference-connection-summary-registry.tspackages/main/src/plugin/provider-registry.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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:
extensions/vertex-ai/src/vertex-ai.tsextensions/gemini/src/gemini.spec.tspackages/api/src/provider-info.tsextensions/mistral/src/manager/mistral-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/openai-compatible/src/openAI.spec.tsextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/openai-compatible/src/openAI.tspackages/api/src/model-registry-info.tsextensions/mistral/src/manager/mistral-inference-manager.spec.tsextensions/gemini/src/gemini.tspackages/main/src/plugin/inference-connection-summary-registry.spec.tspackages/main/src/plugin/inference-connection-summary-registry.tspackages/main/src/plugin/provider-registry.tspackages/extension-api/src/extension-api.d.ts
extensions/*/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Register inference, container, and Kubernetes providers through the
ProviderRegistryvia extension APIs
Files:
extensions/vertex-ai/src/vertex-ai.tsextensions/gemini/src/gemini.spec.tsextensions/mistral/src/manager/mistral-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/openai-compatible/src/openAI.spec.tsextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/openai-compatible/src/openAI.tsextensions/mistral/src/manager/mistral-inference-manager.spec.tsextensions/gemini/src/gemini.ts
**/*.spec.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.spec.{ts,tsx,js,jsx}: Usetest()instead ofit()for test cases in Vitest unit tests
Usevi.mock(import('...'))for auto-mocking modules in unit tests; avoid manual mock factories when possible
Usevi.resetAllMocks()inbeforeEachhooks instead ofvi.clearAllMocks()for resetting mocks between tests
When an auto-mocked function or class method needs a real implementation, usevi.mocked(...)with the prototype pattern for class methods:vi.mocked(MyClass.prototype.myMethod).mockImplementation(...)
Files:
extensions/gemini/src/gemini.spec.tsextensions/openai-compatible/src/openAI.spec.tsextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/mistral/src/manager/mistral-inference-manager.spec.tspackages/main/src/plugin/inference-connection-summary-registry.spec.ts
packages/main/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
packages/main/src/**/*.{ts,tsx}: UseipcHandle()to expose handlers in the main process with naming convention<registry-name>:<action>(e.g.,container-provider-registry:listContainers)
UseapiSender.send()to send events from main process to renderer for real-time updates
Long-running operations should useTaskManager.createTask()with title and action configuration
Files:
packages/main/src/plugin/inference-connection-summary-registry.spec.tspackages/main/src/plugin/inference-connection-summary-registry.tspackages/main/src/plugin/provider-registry.ts
packages/{main,renderer,preload}/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Container operations must include
engineIdparameter to identify the container engine
Files:
packages/main/src/plugin/inference-connection-summary-registry.spec.tspackages/main/src/plugin/inference-connection-summary-registry.tspackages/main/src/plugin/provider-registry.ts
🧠 Learnings (9)
📚 Learning: 2026-04-22T02:58:52.156Z
Learnt from: bmahabirbu
Repo: openkaiden/kaiden PR: 1379
File: packages/renderer/src/lib/models/columns/ModelSizeColumn.spec.ts:19-41
Timestamp: 2026-04-22T02:58:52.156Z
Learning: For spec files like packages/renderer/src/lib/models/columns/ModelSizeColumn.spec.ts, if the component intentionally renders a specific literal glyph (e.g., the em-dash character `—`) as part of the user-visible UI, assert that exact rendered text/character. Treat UI glyph changes as change-detection signals so the test fails when the placeholder glyph changes. Do not replace these assertions with `data-testid` or role-based queries if that would conflict with the project’s testing philosophy of verifying what the user sees.
Applied to files:
.gitignore
📚 Learning: 2026-05-05T03:37:56.898Z
Learnt from: bmahabirbu
Repo: openkaiden/kaiden PR: 1517
File: packages/main/src/plugin/kdn-cli/kdn-cli.ts:181-189
Timestamp: 2026-05-05T03:37:56.898Z
Learning: In packages/main/src/plugin/kdn-cli/kdn-cli.ts, when implementing `writeWorkspaceConfig`, only write plaintext env vars to `workspace.json` for non-secret runtime config flags (e.g., `UV_SYSTEM_CERTS`) that are required by command/package-spawned MCPs. If a spawned MCP requires a secret env var, do not write the raw secret value to `workspace.json`; instead route secret handling through `kdn secret create` and store only a secret reference (not the plaintext value) in `workspace.json`. Ensure future changes preserve this plaintext-vs-secret separation.
Applied to files:
.gitignore
📚 Learning: 2026-05-05T17:30:20.418Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/vertex-ai.ts:272-302
Timestamp: 2026-05-05T17:30:20.418Z
Learning: In the openkaiden/kaiden repo, for cloud inference provider extension code under `extensions/*/src/*.ts`, treat `ProviderConnectionStatus = 'unknown'` as a valid/expected value when registering provider connections (e.g., Gemini/Claude/Mistral/OpenAI-compatible/Vertex AI). `'unknown'` indicates the connection was set up but is not continuously monitored—so do not flag it as incorrect. Only Ollama is expected to use `'started'` because it actively polls a local server.
Applied to files:
extensions/vertex-ai/src/vertex-ai.tsextensions/gemini/src/gemini.spec.tsextensions/openai-compatible/src/openAI.spec.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/openai-compatible/src/openAI.tsextensions/gemini/src/gemini.ts
📚 Learning: 2026-05-05T17:44:50.991Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1671
File: extensions/vertex-ai/src/vertex-ai.ts:363-387
Timestamp: 2026-05-05T17:44:50.991Z
Learning: In this repo (openkaiden/kaiden), do not raise a code review issue when an extension’s `InferenceProviderConnectionFactory.create` factory method implementation omits (or does not use) the optional `logger` and/or `CancellationToken` parameters in its method signature/implementation. Current extensions (e.g., Vertex AI, Gemini, Claude, Mistral, OpenAI-compatible) follow this pattern, so reviewers should treat it as acceptable for `extensions/*` TypeScript source files.
Applied to files:
extensions/vertex-ai/src/vertex-ai.tsextensions/gemini/src/gemini.spec.tsextensions/mistral/src/manager/mistral-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/openai-compatible/src/openAI.spec.tsextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/openai-compatible/src/openAI.tsextensions/mistral/src/manager/mistral-inference-manager.spec.tsextensions/gemini/src/gemini.ts
📚 Learning: 2026-05-12T10:01:14.248Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 1810
File: extensions/kdn/src/kdn-extension.ts:43-46
Timestamp: 2026-05-12T10:01:14.248Z
Learning: In this repo’s extension code, when logging from binary discovery/resolution logic (e.g., choosing/validating custom paths, extension storage locations, or bundled resource paths), it’s intentional to include full filesystem paths in `console.log`/`console.warn` (such as in `extensions/**/src/*-extension.ts`). During review, do not flag these specific full-path messages as a privacy/security issue as long as they are clearly part of the binary resolution steps. If full-path logging appears outside binary discovery/resolution, review/flag it as usual.
Applied to files:
extensions/vertex-ai/src/vertex-ai.tsextensions/gemini/src/gemini.spec.tsextensions/mistral/src/manager/mistral-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/openai-compatible/src/openAI.spec.tsextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/openai-compatible/src/openAI.tsextensions/mistral/src/manager/mistral-inference-manager.spec.tsextensions/gemini/src/gemini.ts
📚 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:
extensions/vertex-ai/src/vertex-ai.tsextensions/gemini/src/gemini.spec.tspackages/api/src/provider-info.tsextensions/mistral/src/manager/mistral-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/openai-compatible/src/openAI.spec.tsextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.tsextensions/vertex-ai/src/vertex-ai.spec.tsextensions/openai-compatible/src/openAI.tspackages/api/src/model-registry-info.tsextensions/mistral/src/manager/mistral-inference-manager.spec.tsextensions/gemini/src/gemini.tspackages/main/src/plugin/inference-connection-summary-registry.spec.tspackages/main/src/plugin/inference-connection-summary-registry.tspackages/main/src/plugin/provider-registry.tspackages/extension-api/src/extension-api.d.ts
📚 Learning: 2026-06-08T14:22:17.045Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2093
File: extensions/claude/src/manager/claude-inference-manager.ts:109-111
Timestamp: 2026-06-08T14:22:17.045Z
Learning: In provider inference manager extensions (e.g., Mistral/Claude), the `configuration.getConfiguration(...)` argument is intentionally asymmetric:
- For `setConnectionConfiguration`, call `configuration.getConfiguration(undefined, connection)` and rely on the `connection` parameter to apply namespace scoping.
- For `clearConnectionConfiguration`, call `configuration.getConfiguration('<provider>.connection', connection)` (using the explicit provider namespace string) so the persisted keys are cleared correctly.
In future reviews, do not flag this `undefined` vs explicit namespace difference as a bug; it is required for correct write-vs-clear behavior.
Applied to files:
extensions/mistral/src/manager/mistral-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/cursor/src/manager/cursor-inference-manager.ts
📚 Learning: 2026-06-10T09:07:26.260Z
Learnt from: MarsKubeX
Repo: openkaiden/kaiden PR: 2093
File: extensions/claude/src/manager/claude-inference-manager.ts:174-179
Timestamp: 2026-06-10T09:07:26.260Z
Learning: When reviewing inference provider extensions in this repo, do not flag the `lifecycle.delete` handler registered inside `registerInferenceProviderConnection` for missing `try/catch/finally` around sequential cleanup calls (e.g., `clearConnectionConfiguration`, dispose, map-delete, `removeConnection`). This lack of wrapping is an intentional, established cross-extension convention; adding it to only one extension would create inconsistency.
Applied to files:
extensions/mistral/src/manager/mistral-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.tsextensions/claude/src/manager/claude-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.spec.tsextensions/cursor/src/manager/cursor-inference-manager.tsextensions/mistral/src/manager/mistral-inference-manager.spec.ts
📚 Learning: 2026-03-09T08:47:09.657Z
Learnt from: benoitf
Repo: kortex-hub/kortex PR: 1077
File: packages/main/src/plugin/skill/skill-manager.ts:80-109
Timestamp: 2026-03-09T08:47:09.657Z
Learning: In the kortex-hub/kortex repository, IPC handlers (via ipcHandle()) may be registered directly inside feature manager/service classes (e.g., SkillManager in packages/main/src/plugin/skill/skill-manager.ts) rather than exclusively in packages/main/src/plugin/index.ts. Treat this as an accepted design pattern for files under the plugin directory. Reviewers should not require centralization in index.ts; allow IPC registration proximity to the feature that owns the handler. When reviewing code, accept direct ipcHandle() registrations inside feature managers and ensure the pattern is consistently applied across similar feature-manager modules.
Applied to files:
packages/main/src/plugin/inference-connection-summary-registry.spec.tspackages/main/src/plugin/inference-connection-summary-registry.tspackages/main/src/plugin/provider-registry.ts
🔇 Additional comments (18)
packages/extension-api/src/extension-api.d.ts (1)
770-770: LGTM!packages/api/src/provider-info.ts (1)
174-175: LGTM!packages/api/src/model-registry-info.ts (1)
43-43: LGTM!extensions/claude/src/manager/claude-inference-manager.ts (1)
60-60: LGTM!extensions/claude/src/manager/claude-inference-manager.spec.ts (1)
126-126: LGTM!extensions/cursor/src/manager/cursor-inference-manager.ts (1)
61-61: LGTM!extensions/cursor/src/manager/cursor-inference-manager.spec.ts (1)
87-87: LGTM!extensions/gemini/src/gemini.ts (1)
64-67: LGTM!extensions/gemini/src/gemini.spec.ts (1)
157-160: LGTM!extensions/mistral/src/manager/mistral-inference-manager.ts (1)
55-58: LGTM!extensions/mistral/src/manager/mistral-inference-manager.spec.ts (1)
116-119: LGTM!extensions/openai-compatible/src/openAI.ts (1)
60-63: LGTM!extensions/openai-compatible/src/openAI.spec.ts (1)
130-133: LGTM!extensions/vertex-ai/src/vertex-ai.ts (1)
124-127: LGTM!extensions/vertex-ai/src/vertex-ai.spec.ts (1)
152-155: LGTM!packages/main/src/plugin/provider-registry.ts (1)
954-955: LGTM!Also applies to: 1030-1032
packages/main/src/plugin/inference-connection-summary-registry.ts (1)
95-96: LGTM!Also applies to: 111-112
packages/main/src/plugin/inference-connection-summary-registry.spec.ts (1)
146-223: LGTM!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes openkaiden#2128 Signed-off-by: Jeff MAURY <jmaury@redhat.com>
|
@coderabbitai resolve |
✅ Action performedComments resolved and changes approved. |
No UI changes
Fixes #2128