Skip to content

fix(server,frontend): make Advanced Settings own analyzer endpoint and phase models - #3192

Open
dudarenok-maker wants to merge 7 commits into
mainfrom
fix/server-analyzer-model-overrides
Open

fix(server,frontend): make Advanced Settings own analyzer endpoint and phase models#3192
dudarenok-maker wants to merge 7 commits into
mainfrom
fix/server-analyzer-model-overrides

Conversation

@dudarenok-maker

Copy link
Copy Markdown
Owner

Summary

  • Five Advanced Settings analyzer knobs (Ollama URL/model, phase-0/phase-1 model, phase-1 lag) were stored and shown but never read; the server now resolves them through the config resolver (env → Advanced override → default).
  • Values saved in the old Account fields migrate into Advanced overrides on upgrade; the settings save rejects those fields with 400; Account shows them read-only with a link to Advanced Settings.
  • The analysing view's phase swap is now a per-run pick sent with that run's request; it no longer writes settings, and the false "applies from the next chapter" message is gone.

Merge-order note: server/src/config/registry-knob-read.guard.test.ts (added by #3139) does not exist yet on origin/maingit ls-tree origin/main returns nothing for that path. #3139 has not merged, so there is no KNOWN_UNREAD allowlist entry to reconcile against right now. Whichever of the two PRs merges second must remove analyzer.ollama.url, analyzer.ollama.model, analyzer.phase0.model, analyzer.phase1.model, analyzer.phase1.minLagChapters from that guard's KNOWN_UNREAD list, since this branch makes all five keys read. If this PR merges first, #3139 needs the follow-up; if #3139 merges first, this PR does.

Found in passing: none beyond what #3152 and #3167 already reported (the typecheck/cycle fallout and stale comment, both fixed by #3167 and reconfirmed here).

Test plan

  • Unit tests replaced/added for resolution, migration, settings GET/PUT, Account form, per-run request, swap control
  • Mutation checks observed: (a) reverting getResolvedOllamaUrl to read the retired Account ollamaUrl field is caught by tsc (TS2339: Property 'ollamaUrl' does not exist) since the field is gone from the settings type; (b) removing the never-clobber guard in the legacy-field migration turns red 1 vitest assertion (does not clobber an override that already exists for one of the four target keys); (c) re-adding ollamaUrl to the Account save payload is caught by tsc (TS2353: Object literal may only specify known properties) since UserSettingsPatch no longer has it; (d) dropping the per-run phaseModel priority from selectAnalyzerForPhase turns red 1 vitest assertion (phaseModel beats opts.model and a saved Advanced Settings override); (e) re-adding a putUserSettings call to the phase-model swap control turns red 2 vitest assertions asserting it is never called. All five reverted cleanly (git status --porcelain empty after each).
  • e2e/analyzer-settings-ownership.spec.ts — 3 passed (warmup + both scenarios), PLAYWRIGHT_PORT=5324
  • npm run typecheck, npm run check:cycles, npm run config:check, npm run lint, targeted vitest suites — all clean: root src/components src/views src/store (194 files / 3196 tests passed), server src/analyzer src/workspace src/config src/routes/user-settings.test.ts (140 files / 2257 tests passed), check:cycles reports 16 circular dependencies, all allowlisted
  • Mandatory pr-review-gate pass (operator)

Closes #3141

🤖 Generated with Claude Code

dudarenok-maker and others added 7 commits September 11, 2026 07:39
Refs #3141

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Refs #3141

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…lout from #3141

- Add analyzerPhasePicks: {} to the two pre-existing UiState test literals
  in theme-toggle.test.tsx / use-theme.test.tsx now that step 5 made it a
  required field.
- Change account.backups.test.tsx's SERVER_FIXTURE.analyzerPhase1MinLagChapters
  from null to 10 (DEFAULT_PHASE1_MIN_LAG_CHAPTERS) now that the openapi.yaml
  step-2 change dropped nullable from that response field.
- Re-export AnalyseResponse from src/lib/api.ts so
  analysing.phase-model-picks.test.tsx's type-only import resolves.
- Allowlist the config/resolver.ts <-> workspace/user-settings.ts import
  cycle in server/madge-cycles-allowlist.json. user-settings.ts already
  carries a header comment (added with step 1's configValue import)
  documenting this as a deliberate, function-body-only cycle. Breaking it
  for real would mean moving getResolvedOllamaUrl/getResolvedOllamaModel out
  of user-settings.ts to stop it depending on the resolver directly, which
  touches 7+ call-site files outside this rework's scope.
- Update the stale analysing.tsx comment claiming per-phase picks persist to
  UserSettings; step 5 made them a per-run-only pick.

npm run typecheck and npm run check:cycles are both clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

Five analyzer-model Advanced Settings overrides are ignored — Account-tab fields win silently

1 participant