Skip to content

fix(settings): test the LLM address and model on screen, not only the saved ones - #539

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-nlyjqn
Oct 18, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-nlyjqn

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Description

Before: Test in Settings → LLM provider always tested the saved settings. A new address or model typed but not saved was never tried, so the test reported the old server's error (for example "can't reach the LLM server at http://10.0.20.11:1434/v1: Connection reset by peer").

After: Test tries the address, model and key on screen, saved or not. The saved key goes only to the saved address, so a new address is tested with the key typed for it, never the stored one.

How: POST /api/v1/settings/llm/test takes an optional LlmTry body (base_url, model, api_key); with no body it tests what is saved, as before (the health page and the setup wizard still call it that way). llm.trying() lays typed values over the saved ones and drops the saved key and key variable when the address changes. Settings sends the form's values.

Motivation and Context

Adeel's connection test failed against his local model server because the button read the saved values instead of what was typed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added or updated tests: test_llm_test_tries_what_is_typed, test_llm_trying_keeps_the_saved_key_at_the_saved_address, and a Settings jest case.
  • I have updated docs/configuration.md.
  • n/a: the title says it all, no CHANGELOG note.

Done questions (AGENTS.md)

  • Goal: the test now checks what the user typed; merge on green.
  • Agents: the same body works over the API.
  • Zero setup: nothing new to install or configure.
  • Fewest clicks: no save needed before testing.
  • n/a Configurable: no new setting.
  • n/a Light: no new dependency.
  • Private and secure: the saved key is never sent to a new address; admin-only route as before; no new surface (an admin could already save any address and test it).
  • n/a Cost: one five-token call per test, as before.
  • User decides: nothing is saved by testing.
  • n/a Upgrades: no stored-data change.
  • Honest: docs describe only what is merged.
  • Tests, docs and generated files (make openapi) updated.
  • Open: no new dependency.
  • Reported in the project thread with local CI results (backend, Next.js, pre-commit, title all pass).
  • Reuse: follows the existing pattern of /settings/files/test, which already takes unsaved values.

Generated by Claude Code

… saved ones

The Test button in Settings → LLM provider tested the saved settings, so a
new address or model typed but not saved was never tried. The test route
now takes base_url, model and api_key; the saved key goes only to the saved
address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHjm8NXrMmJrZH8D71s4MN
Ported from #400 so this PR's clicks survey passes while that lands: the
survey hung after its first chat answer when the garbage collector closed
an abandoned streamed answer mid-query on the thread holding the one
embedded connection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BHjm8NXrMmJrZH8D71s4MN

Copy link
Copy Markdown
Owner Author

Clicks and keystrokes per feature failed on 644d9ef: the computer survey hung after chat-ask and every later page timed out, while the phone survey on the same commit passed. That is the server-wide hang #400 diagnosed (an abandoned streamed answer closed mid-query on the thread holding the one embedded connection), not this PR's change. I ported #400's fix, fix(store): a thread holding the embedded connection can query again, in 7daff6e. It no-ops once #400 lands.


Generated by Claude Code

@adeelahmad
adeelahmad merged commit 1e0aa49 into main Oct 18, 2026
11 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-nlyjqn branch October 18, 2026 02:15
adeelahmad pushed a commit that referenced this pull request Oct 18, 2026
Main carries its own fix for the frozen server (#539): a thread inside
a query is given its connection again. Kept for the embedded engine,
which has the one connection; against a server the inner query takes
another connection from the pool, because the SDK sends on a server
connection under a lock the same thread cannot take twice, so sharing
it would hang there too. The duplicate test goes; a server-side test
joins main's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
adeelahmad added a commit that referenced this pull request Oct 18, 2026
An automation's If can look back over the stream with `seen`, and a running
automation's If, its graph's condition, filter and switch nodes and a
trigger's `where` get the run's clock, time zone and one State per run, so
`changed` works. Also fixes the server freeze behind the failing Clicks
check: a query made inside another on the same thread shares the embedded
engine's connection (as #539) and takes another connection against a
server, whose SDK lock the same thread cannot take twice.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AjJqXgjj1cNdKGRQbX5frb
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.

2 participants