Skip to content

Fix provider model testing and add MCP coming soon placeholder#2570

Merged
senamakel merged 9 commits into
tinyhumansai:mainfrom
senamakel:codex/production-changes
May 24, 2026
Merged

Fix provider model testing and add MCP coming soon placeholder#2570
senamakel merged 9 commits into
tinyhumansai:mainfrom
senamakel:codex/production-changes

Conversation

@senamakel
Copy link
Copy Markdown
Member

@senamakel senamakel commented May 24, 2026

Summary

  • Added a coming-soon placeholder for the Skills page MCP Servers tab so the tab stays visible without exposing unfinished management UI.
  • Simplified the custom cloud-provider editor to use name-derived slugs plus OpenAI-compatible URL/API key fields instead of asking users for a raw provider slug.
  • Added model-test UX in AI routing and a dedicated openhuman.inference_test_provider_model RPC for one-off provider/model probes.
  • Fixed LM Studio inference/test handling so reasoning-only responses surface correctly and slow model-test calls use an extended RPC timeout.

Problem

  • The Skills page still exposed an unfinished MCP Servers management surface.
  • The custom provider modal asked users for an internal provider slug, which does not map cleanly to how OpenAI-compatible providers are configured.
  • Model-test flows were incomplete: there was no in-modal test action, LM Studio requests could return blank because reasoning-only payloads were dropped, and the test RPC shape/timeout handling was inconsistent across layers.

Solution

  • Replaced the Skills MCP tab body with a dedicated coming-soon panel and added a page-level regression test.
  • Reworked the custom provider editor to derive the internal slug from the entered provider name, validate collisions, and keep the user-facing fields to name, URL, and API key.
  • Added a Test action in custom routing, backed by a new inference RPC that exercises an explicit provider/model binding without persisting routing changes.
  • Fixed inference-layer response handling by returning a typed { reply } payload from the RPC, routing LM Studio through the local-runtime path, falling back to reasoning_content when content is empty, and removing the overly aggressive max_tokens: 128 cap from provider tests.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) per Testing Strategy
  • Diff coverage ≥ 80% — changed lines (Vitest + cargo-llvm-cov merged via diff-cover) meet the gate enforced by .github/workflows/coverage.yml. Run pnpm test:coverage and pnpm test:rust locally; PRs below 80% on changed lines will not merge.
  • Coverage matrix updated — added/removed/renamed feature rows in docs/TEST-COVERAGE-MATRIX.md reflect this change (N/A: behavior-only/UI/runtime fixes, no matrix rows added or renamed)
  • All affected feature IDs from the matrix are listed in the PR description under ## Related (N/A: no feature ID additions/removals were required for this change)
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • Manual smoke checklist updated if this touches release-cut surfaces (docs/RELEASE-MANUAL-SMOKE.md) (N/A: no release-cut smoke checklist changes required)
  • Linked issue closed via Closes #NNN in the ## Related section (N/A: no issue number was provided for this branch)

Impact

  • Desktop app: Skills and AI settings flows change visibly.
  • Core inference: provider-model test RPC and LM Studio response handling are now aligned with the inference-layer contract.
  • Compatibility: OpenAI-compatible providers and LM Studio model tests should behave more predictably, especially when the upstream returns reasoning-only text.

Related

  • Closes: N/A
  • Follow-up PR(s)/TODOs:
    • Consider removing or hiding the unused MCP management implementation until the feature is reintroduced.
    • Consider broadening reasoning-content fallback coverage across any remaining OpenAI-compatible local-runtime adapters.

AI Authored PR Metadata (required for Codex/Linear PRs)

Keep this section for AI-authored PRs. For human-only PRs, mark each field N/A.

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: codex/production-changes
  • Commit SHA: 73b3008ae

Validation Run

  • pnpm --filter openhuman-app format:check
  • pnpm typecheck
  • Focused tests:
    • pnpm debug unit src/services/api/__tests__/aiSettingsApi.test.ts
    • pnpm debug unit src/components/settings/panels/__tests__/AIPanel.test.tsx
    • pnpm debug unit src/pages/__tests__/Skills.mcp-coming-soon.test.tsx
  • Rust fmt/check (if changed):
    • cargo fmt --manifest-path ../Cargo.toml --all --check (via pre-push)
    • GGML_NATIVE=OFF cargo check --manifest-path Cargo.toml
  • Tauri fmt/check (if changed):
    • cargo fmt --manifest-path app/src-tauri/Cargo.toml --all --check (via pre-push)
    • cargo check --manifest-path app/src-tauri/Cargo.toml (via pre-push / pnpm rust:check)

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: MCP tab now shows a coming-soon state; provider test flow is now user-visible and returns typed reply payloads; custom provider editor no longer asks for a manual slug.
  • User-visible effect: users can test provider/model pairs inline, LM Studio responses show up instead of blank output, and the MCP tab no longer exposes unfinished controls.

Parity Contract

  • Legacy behavior preserved: existing OpenAI-compatible provider routing remains in place; local-runtime test calls now use the same LM Studio/Ollama path the rest of the app uses.
  • Guard/fallback/dispatch parity checks: preserved explicit provider-string dispatch, added typed { reply } inference RPC response, and added LM Studio reasoning_content fallback instead of changing upstream payload assumptions.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: this PR
  • Resolution (closed/superseded/updated): N/A

Summary by CodeRabbit

  • New Features

    • Added a "Test" button to validate custom AI provider/model setups before saving
    • Enabled LM Studio local-runtime support in the desktop app AI settings
    • MCP Servers tab now shows a "Coming Soon" placeholder
  • Improvements

    • Cloud provider editor validates names and generates unique slugs to prevent collisions
    • LM Studio responses now fall back to reasoning content when primary content is empty
  • Tests

    • Expanded test coverage for provider testing, LM Studio flow, and MCP UI

Review Change Stack

@senamakel senamakel requested a review from a team May 24, 2026 16:25
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Warning

Review limit reached

@senamakel, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 5 reviews/hour. Refill in 27 minutes and 51 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 84ce2428-914f-425a-8386-75f195cd1789

📥 Commits

Reviewing files that changed from the base of the PR and between 0f3051c and 2f3456c.

📒 Files selected for processing (4)
  • app/src/components/settings/panels/AIPanel.tsx
  • app/src/components/settings/panels/__tests__/AIPanel.test.tsx
  • app/src/lib/i18n/chunks/en-1.ts
  • src/openhuman/inference/local/lm_studio.rs
📝 Walkthrough

Walkthrough

Adds end-to-end provider/model testing (backend RPC + frontend Test UI), refactors cloud provider slug generation/validation, integrates LM Studio reasoning_content fallback and local-runtime enable persistence, replaces MCP Servers tab with a "Coming Soon" panel, and adds tests and i18n entries.

Changes

Provider Model Testing Feature

Layer / File(s) Summary
Backend RPC result type and inference handler
src/openhuman/inference/ops.rs
InferenceTestProviderModelResult wraps reply; inference_test_provider_model branches on provider prefix (lmstudio:/ollama: vs cloud), parses optional @temperature, mutates Config, calls local_runtime or cloud simple_chat, and returns logged RpcOutcome.
Backend RPC schema and handler wiring
src/openhuman/inference/schemas.rs
Adds InferenceTestProviderModelParams, wires schema into controllers, and implements handle_inference_test_provider_model that deserializes params, calls RPC, and returns JSON outcome.
Frontend API contract for model testing
app/src/services/api/aiSettingsApi.ts
Exports ProviderModelTestResult and testProviderModel which is Tauri-only, dispatches openhuman.inference_test_provider_model with workload/provider/prompt and 120s timeout, and returns the RPC result.
Custom routing dialog Test UI and state
app/src/components/settings/panels/AIPanel.tsx
Adds appendTemperatureToProviderString, expands dialog state (busy/reply/error/startedAt), computes composed currentProviderString, implements handleTest() to call testProviderModel, renders conditional test result/status panel, and adds a Test footer button.
Frontend and RPC tests for model testing
app/src/components/settings/panels/__tests__/AIPanel.test.tsx, app/src/services/api/__tests__/aiSettingsApi.test.ts, src/openhuman/inference/ops_tests.rs
Extends mocks to include testProviderModel, verifies RPC dispatch in Tauri and desktop-only error path, asserts Test button calls with composed provider@temp and prompt, checks immediate "Testing model…" UI, reply rendering, and inline error handling.

Cloud Provider Editor Slug Refactor

Layer / File(s) Summary
Slug generation and validation
app/src/components/settings/panels/AIPanel.tsx
Adds slugifyCustomProviderName to normalize provider names (lowercase, non-alphanumerics→dashes, trim), derives slug from label changes, and computes slugError for reserved/collision cases.
Editor form UI and submission logic
app/src/components/settings/panels/AIPanel.tsx
Surfaces computed slug and slugError in the UI, blocks submit when slugError exists, and prefers initial?.authStyle or falls back to 'bearer'; submit button disabled includes slugError.
Cloud provider editor tests
app/src/components/settings/panels/__tests__/AIPanel.test.tsx
Updates tests to assert Name/OpenAI URL inputs, uses Team Gateway error flow for inline rejection assertions, verifies slug is derived from name, and ensures subsequent API calls use the computed slug.

LM Studio Integration and Reasoning Content

Layer / File(s) Summary
LM Studio reasoning content fallback
src/openhuman/inference/local/lm_studio.rs, src/openhuman/inference/local/service/lm_studio.rs
Adds reasoning_content to LmStudioChatResponseMessage, implements effective_content() that strips <think> tags and falls back to reasoning content when content is empty; service reply extraction uses effective_content().
LM Studio enable flow in local-runtime setup
app/src/components/settings/panels/AIPanel.tsx
Adds LM Studio-specific branch that persists via openhumanUpdateLocalAiSettings with provider: 'lm_studio' and enables/runtime confirmation flags.
LM Studio integration tests
app/src/components/settings/panels/__tests__/AIPanel.test.tsx, src/openhuman/inference/local/lm_studio.rs, src/openhuman/inference/local/service/public_infer_tests.rs
Tests LM Studio enable flow persistence, effective_content() fallback to reasoning_content, and chat_with_history returning reasoning-only responses.

MCP Coming Soon Placeholder & i18n

Layer / File(s) Summary
MCP coming soon component and routing
app/src/pages/Skills.tsx
Removes McpServersTab import, adds McpComingSoonPanel component rendering a dashed centered card with icon/heading/description and a "Coming Soon" badge, and swaps activeTab === 'mcp' to render the placeholder.
MCP coming soon test
app/src/pages/__tests__/Skills.mcp-coming-soon.test.tsx
Adds test that mocks dependencies, navigates to MCP tab, and asserts headings, description, and "Coming Soon" label appear.
i18n additions for Coming Soon
app/src/lib/i18n/chunks/*, app/src/lib/i18n/en.ts
Adds common.comingSoon and skills.mcpComingSoon.title/description entries across language chunks and English map to support the UI.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • tinyhumansai/openhuman#2165: Provider string composition with @<temperature> parsing used in this PR's model testing flow.
  • tinyhumansai/openhuman#2152: Related changes to CustomRoutingDialog and aiSettingsApi (slug-based model picking vs provider+temperature testing).

Suggested labels

working

Suggested reviewers

  • graycyrus

Poem

🐰 I hopped to test the model, prompt in paw,

I slugified names, and guarded every flaw.
LM Studio whispers reasoning bright,
MCP waits, a badge in sight.
A tiny rabbit cheers — all systems light!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main changes: adding MCP coming-soon placeholder and implementing provider model testing functionality.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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

@coderabbitai coderabbitai Bot added the feature Net-new user-facing capability or product behavior. label May 24, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

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

⚠️ Outside diff range comments (2)
app/src/components/settings/panels/AIPanel.tsx (2)

2700-2758: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Rollback local_ai as well when the local-runtime probe fails.

The LM Studio/Ollama branch persists openhumanUpdateLocalAiSettings(...) before the /models verification runs, but the failure path only restores cloud_providers. If the probe rejects, the chip stays off while config.local_ai is still enabled and pointed at the dead endpoint.

A simple fix is to move the openhumanUpdateLocalAiSettings(...) call until after listProviderModels(slug) succeeds, or snapshot and restore the previous local settings in the catch path.

🤖 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 `@app/src/components/settings/panels/AIPanel.tsx` around lines 2700 - 2758, The
local-runtime branches call openhumanUpdateLocalAiSettings(...) before probing
with listProviderModels(slug), so on probe failure config.local_ai stays
enabled; either move the openhumanUpdateLocalAiSettings(...) invocation to after
a successful listProviderModels(slug) probe (i.e., perform the upsert/flush/list
sequence first, then set local_ai for slug === 'ollama' or 'lmstudio'), or
capture the previous local settings into a snapshot variable before updating
and, in the catch block (where you already
flushCloudProviders(priorWireProviders) and clearCloudProviderKey(slug)),
restore that snapshot via openhumanUpdateLocalAiSettings(...) to roll back
local_ai; reference functions/values: openhumanUpdateLocalAiSettings,
listProviderModels, flushCloudProviders, clearCloudProviderKey,
priorWireProviders, upserted, slug, isLocalRuntime.

1942-2051: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Internationalize the new AI settings copy.

The new test-panel/editor strings here are user-visible (Temperature override, Test, Model response, Name, OpenAI URL, slug errors, placeholders, etc.), but they’re hard-coded instead of going through useT(). That breaks the repo’s app-wide i18n contract.

As per coding guidelines: "Every user-visible string in app/src/** (headings, labels, button text, placeholders, status chips, toasts, dialog copy, aria-label, etc.) must go through useT() from app/src/lib/i18n/I18nContext. Hard-coded literals in JSX or props are not allowed. Add the new key to app/src/lib/i18n/en.ts in the same PR."

Also applies to: 2812-2889

🤖 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 `@app/src/components/settings/panels/AIPanel.tsx` around lines 1942 - 2051,
Several user-visible literals in the AI settings panel (e.g., "Temperature
override", slider/number aria-labels, "Lower = more deterministic. Leave
unchecked to use the provider default.", "Test", "Testing…", "Model response",
"Test failed", "Testing model…", "Provider:", "Prompt: Hello world", "Waiting
for response from the selected model…", etc.) must be internationalized: import
and use useT() from app/src/lib/i18n/I18nContext in AIPanel.tsx and replace each
hard-coded string used in JSX, aria-labels and button text with
t('your.key.here') calls (update references around temperature, handleTest,
testBusy, testReply, testError, currentProviderString), then add matching keys
and English values to app/src/lib/i18n/en.ts in this PR; ensure placeholders,
aria-labels and status messages are covered and preserve existing formatting
like interpolation or number formatting where needed.
🤖 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 `@app/src/components/settings/panels/AIPanel.tsx`:
- Around line 1748-1752: The useEffect currently performing synchronous state
resets (setTestReply, setTestError, setTestStartedAt) when [source, model,
temperature] change violates the react-hooks/set-state-in-effect rule; remove
these setState calls from the useEffect and instead reset test state inside the
event handlers or setters that update source, model, or temperature (or compute
test state derived from the current selection), e.g., update the functions that
change source, updateModel, and updateTemperature (or the onChange handlers for
those inputs) to call the three reset setters so the resets occur as part of the
initiating action rather than inside useEffect.

In `@app/src/pages/Skills.tsx`:
- Around line 286-310: McpComingSoonPanel currently hard-codes user-facing
strings; replace them with localized keys by adding entries to
app/src/lib/i18n/en.ts (e.g. skills.mcp.title, skills.mcp.description,
skills.mcp.badge) and then update McpComingSoonPanel to import and call useT()
and replace the literal JSX strings with t('skills.mcp.title'),
t('skills.mcp.description'), and t('skills.mcp.badge'); ensure the new keys
exist in en.ts and the component imports useT from the i18n module so runtime
lookup works.

In `@app/src/services/api/aiSettingsApi.ts`:
- Around line 388-393: The current code silently treats a missing RPC payload as
success by returning { reply: '' }; instead, validate the RPC response from
callCoreRpc (the result returned for method
'openhuman.inference_test_provider_model') and if res or res.result is missing
or malformed, throw or return an explicit error (include context like provider,
workload, and method name) rather than returning an empty reply; update the
block around callCoreRpc/ProviderModelTestResult/PROVIDER_MODEL_TEST_TIMEOUT_MS
to check res and res.result and surface a contract failure (throw an Error or
return a rejected Promise) so callers can handle the RPC contract violation.

In `@src/openhuman/inference/local/lm_studio.rs`:
- Around line 195-208: The effective_content() helper currently returns content
or reasoning_content without removing LM Studio "think" blocks, so it can leak
<think>...</think> payloads; update effective_content() to apply the same
think-tag stripping used by the OpenAI-compatible extraction path before
trimming/emptiness checks and before returning a String (i.e., when mapping both
self.content and self.reasoning_content, run a function that removes
surrounding/inner <think>...</think> tags and then trim, filter empty, and
fallback as before); reference the effective_content() method and the fields
content and reasoning_content when making the change so the logic mirrors the
shared think-tag stripping behavior.

---

Outside diff comments:
In `@app/src/components/settings/panels/AIPanel.tsx`:
- Around line 2700-2758: The local-runtime branches call
openhumanUpdateLocalAiSettings(...) before probing with
listProviderModels(slug), so on probe failure config.local_ai stays enabled;
either move the openhumanUpdateLocalAiSettings(...) invocation to after a
successful listProviderModels(slug) probe (i.e., perform the upsert/flush/list
sequence first, then set local_ai for slug === 'ollama' or 'lmstudio'), or
capture the previous local settings into a snapshot variable before updating
and, in the catch block (where you already
flushCloudProviders(priorWireProviders) and clearCloudProviderKey(slug)),
restore that snapshot via openhumanUpdateLocalAiSettings(...) to roll back
local_ai; reference functions/values: openhumanUpdateLocalAiSettings,
listProviderModels, flushCloudProviders, clearCloudProviderKey,
priorWireProviders, upserted, slug, isLocalRuntime.
- Around line 1942-2051: Several user-visible literals in the AI settings panel
(e.g., "Temperature override", slider/number aria-labels, "Lower = more
deterministic. Leave unchecked to use the provider default.", "Test",
"Testing…", "Model response", "Test failed", "Testing model…", "Provider:",
"Prompt: Hello world", "Waiting for response from the selected model…", etc.)
must be internationalized: import and use useT() from
app/src/lib/i18n/I18nContext in AIPanel.tsx and replace each hard-coded string
used in JSX, aria-labels and button text with t('your.key.here') calls (update
references around temperature, handleTest, testBusy, testReply, testError,
currentProviderString), then add matching keys and English values to
app/src/lib/i18n/en.ts in this PR; ensure placeholders, aria-labels and status
messages are covered and preserve existing formatting like interpolation or
number formatting where needed.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67cc4a25-b806-423d-adf0-2fb4c1d5ea3a

📥 Commits

Reviewing files that changed from the base of the PR and between e9ca97c and 73b3008.

📒 Files selected for processing (12)
  • app/src/components/settings/panels/AIPanel.tsx
  • app/src/components/settings/panels/__tests__/AIPanel.test.tsx
  • app/src/pages/Skills.tsx
  • app/src/pages/__tests__/Skills.mcp-coming-soon.test.tsx
  • app/src/services/api/__tests__/aiSettingsApi.test.ts
  • app/src/services/api/aiSettingsApi.ts
  • src/openhuman/inference/local/lm_studio.rs
  • src/openhuman/inference/local/service/lm_studio.rs
  • src/openhuman/inference/local/service/public_infer_tests.rs
  • src/openhuman/inference/ops.rs
  • src/openhuman/inference/ops_tests.rs
  • src/openhuman/inference/schemas.rs

Comment thread app/src/components/settings/panels/AIPanel.tsx Outdated
Comment thread app/src/pages/Skills.tsx
Comment thread app/src/services/api/aiSettingsApi.ts Outdated
@coderabbitai coderabbitai Bot added the working A PR that is being worked on by the team. label May 24, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (1)
app/src/services/api/aiSettingsApi.ts (1)

380-399: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add namespaced debug logs around provider-model test RPC flow.

This changed external-call path should log entry/error/success (without prompt content) using a namespaced debug() logger for diagnostics parity with app standards.

🧭 Proposed patch
+import debug from 'debug';
 import { callCoreRpc, getCoreHttpBaseUrl } from '../../services/coreRpcClient';
@@
+const log = debug('openhuman:services:ai-settings-api');
+
 export async function testProviderModel(
   workload: WorkloadId,
   provider: string,
   prompt = 'Hello world'
 ): Promise<ProviderModelTestResult> {
   if (!isTauri()) {
+    log('[testProviderModel] unavailable-non-tauri', { workload, provider });
     throw new Error('Model testing is only available in the desktop app.');
   }
+  log('[testProviderModel] start', { workload, provider });
   const res = await callCoreRpc<{ result: ProviderModelTestResult }>({
     method: 'openhuman.inference_test_provider_model',
     params: { workload, provider, prompt },
     timeoutMs: PROVIDER_MODEL_TEST_TIMEOUT_MS,
   });
   if (!res?.result) {
+    log('[testProviderModel] missing-result', { workload, provider });
     throw new Error(
       `Model test RPC returned no result for ${workload} via ${provider} (openhuman.inference_test_provider_model).`
     );
   }
+  log('[testProviderModel] success', {
+    workload,
+    provider,
+    replyLength: res.result.reply.length,
+  });
   return res.result;
 }

As per coding guidelines "Debug logging in the app should be namespaced using debug() from a named logger instance and include dev-only detail. Follow the same patterns as Rust logging: entry/exit, branches, external calls, state changes. Never log secrets or full PII."

🤖 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 `@app/src/services/api/aiSettingsApi.ts` around lines 380 - 399, Wrap the
testProviderModel flow with namespaced debug logs: create/use a module logger
(e.g. debug('aiSettingsApi:testProviderModel')) and add an entry log at the
start of testProviderModel that records workload and provider (do not log
prompt), a debug log immediately before the callCoreRpc external call, a debug
log on successful return recording provider/workload and that result was
received, and a debug/error log in the branch where !res?.result or on thrown
exceptions that includes the caught error details (but never include prompt or
PII). Ensure you call debug() (not console.log) and keep messages concise and
namespaced to match app logging conventions.
🤖 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 `@app/src/components/settings/panels/AIPanel.tsx`:
- Around line 1748-1752: resetTestState clears visible test fields but does not
invalidate an in-flight testProviderModel(...) request, so stale replies/errors
can be applied to a new selection; add a simple versioning/cancellation
mechanism: introduce a numeric testRequestId (ref or state) used by the async
test call (in the function that calls testProviderModel) and increment it inside
resetTestState and any input-change handlers (provider/model/temperature), then
before setting setTestReply/setTestError/setTestStartedAt verify the requestId
matches the current value so stale completions are ignored; apply the same
pattern to other handlers mentioned (lines around 1850-1857, 1876-1879,
1912-1915, 1923-1926, 1943-1946, 1961-1964, 1984-1987, 1999-2002) or
alternatively disable controls while testBusy is true.

In `@src/openhuman/inference/local/lm_studio.rs`:
- Around line 195-208: The effective_content() flow needs safe diagnostics: add
tracing::debug (or the project's logger) calls that log entry to
effective_content(), which branch was taken ("content" vs "reasoning_content")
and the output length (not the raw content), and a final exit log with the
returned string length; implement this around the existing content ->
strip_think_tags -> trim pipeline and the fallback reasoning_content pipeline
(reference effective_content(), content, reasoning_content, and
strip_think_tags) so you compute and log value.len() after trimming but never
log the value itself.

---

Outside diff comments:
In `@app/src/services/api/aiSettingsApi.ts`:
- Around line 380-399: Wrap the testProviderModel flow with namespaced debug
logs: create/use a module logger (e.g. debug('aiSettingsApi:testProviderModel'))
and add an entry log at the start of testProviderModel that records workload and
provider (do not log prompt), a debug log immediately before the callCoreRpc
external call, a debug log on successful return recording provider/workload and
that result was received, and a debug/error log in the branch where !res?.result
or on thrown exceptions that includes the caught error details (but never
include prompt or PII). Ensure you call debug() (not console.log) and keep
messages concise and namespaced to match app logging conventions.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9c18a90b-8352-4122-ac77-cf14808c303c

📥 Commits

Reviewing files that changed from the base of the PR and between 73b3008 and 0f3051c.

📒 Files selected for processing (17)
  • app/src/components/settings/panels/AIPanel.tsx
  • app/src/lib/i18n/chunks/ar-1.ts
  • app/src/lib/i18n/chunks/bn-1.ts
  • app/src/lib/i18n/chunks/de-1.ts
  • app/src/lib/i18n/chunks/es-1.ts
  • app/src/lib/i18n/chunks/fr-1.ts
  • app/src/lib/i18n/chunks/hi-1.ts
  • app/src/lib/i18n/chunks/id-1.ts
  • app/src/lib/i18n/chunks/it-1.ts
  • app/src/lib/i18n/chunks/ko-1.ts
  • app/src/lib/i18n/chunks/pt-1.ts
  • app/src/lib/i18n/chunks/ru-1.ts
  • app/src/lib/i18n/chunks/zh-CN-1.ts
  • app/src/lib/i18n/en.ts
  • app/src/pages/Skills.tsx
  • app/src/services/api/aiSettingsApi.ts
  • src/openhuman/inference/local/lm_studio.rs
✅ Files skipped from review due to trivial changes (7)
  • app/src/lib/i18n/chunks/ko-1.ts
  • app/src/lib/i18n/chunks/ar-1.ts
  • app/src/lib/i18n/chunks/bn-1.ts
  • app/src/lib/i18n/chunks/de-1.ts
  • app/src/lib/i18n/chunks/id-1.ts
  • app/src/lib/i18n/en.ts
  • app/src/lib/i18n/chunks/pt-1.ts

Comment thread app/src/components/settings/panels/AIPanel.tsx
Comment thread src/openhuman/inference/local/lm_studio.rs Outdated
@senamakel senamakel merged commit 59c1687 into tinyhumansai:main May 24, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Net-new user-facing capability or product behavior. working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant