Skip to content

[codex] hide Ollama until manually added#170

Merged
Sun-sunshine06 merged 1 commit intoOpenCoworkAI:mainfrom
L4b0R:codex/fix-159-ollama-provider-row
Apr 22, 2026
Merged

[codex] hide Ollama until manually added#170
Sun-sunshine06 merged 1 commit intoOpenCoworkAI:mainfrom
L4b0R:codex/fix-159-ollama-provider-row

Conversation

@L4b0R
Copy link
Copy Markdown
Contributor

@L4b0R L4b0R commented Apr 22, 2026

Summary

Fixes #159 by making Ollama opt-in in Settings. Ollama (local) no longer appears as a default provider row on fresh configs; users can add it explicitly from the Add provider menu, and the keyless provider is persisted without writing an empty secret.

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Documentation
  • Build / CI / tooling
  • Breaking change

Linked issue

Closes #159

Root cause

toProviderRows() always injected keyless builtin providers into the rendered row set. Because Ollama is the only builtin with requiresApiKey: false, Settings showed it even when the user had never added or configured it.

What changed

  • Removed automatic keyless builtin injection from provider row generation.
  • Added regression coverage for hidden-until-persisted and visible-after-persisted Ollama behavior.
  • Allowed the Settings add-provider IPC path to persist keyless Ollama without creating an empty secret.
  • Added an explicit Ollama item to the Add provider menu, disabled after it is already present.
  • Added English and Chinese labels for the new menu entry and toast.
  • Added a changeset for the user-visible Settings behavior change.

Checklist

  • I read CLAUDE.md before starting
  • I read docs/VISION.md and docs/PRINCIPLES.md before starting (not present in this local checkout; docs/ only contains docs/research/)
  • Commits are signed with DCO (git commit -s)
  • Added/updated tests for the change
  • Added a changeset (pnpm changeset) because behavior changed
  • Updated docs if behavior changed (not needed; behavior is covered by Settings UI copy)

PRINCIPLES §5b checks

  • Compatibility: Existing persisted provider/secret rows still render; keyless Ollama remains allowed after explicit add.
  • Upgradeability: No schema changes; configs keep the same v3 shape.
  • No bloat: No dependency additions; only targeted IPC/UI/tests/i18n changes.
  • Elegance: The row list now reflects persisted state, while the add menu owns discovery.

Validation

  • corepack pnpm --filter @open-codesign/desktop exec vitest run src/main/provider-settings.test.ts src/main/onboarding-ipc.test.ts src/renderer/src/components/Settings.test.ts — 57 passed
  • corepack pnpm --filter @open-codesign/desktop typecheck — passed
  • corepack pnpm lint — passed
  • git diff --check — passed

I also attempted the full desktop test suite on Windows. It is currently blocked by environment/platform issues unrelated to this change: missing better-sqlite3 native binding after dependency install, POSIX /tmp path expectations on Windows, and symlink permission failures.

Screenshots / recordings (UI changes)

Not attached; this is a small Settings menu behavior change.

@github-actions github-actions Bot added docs Documentation area:desktop apps/desktop (Electron shell, renderer) labels Apr 22, 2026
@Sun-sunshine06 Sun-sunshine06 marked this pull request as ready for review April 22, 2026 14:37
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Findings

  • None.

Summary

  • Review mode: initial
  • No high-confidence issues found in added/modified lines of the latest diff.
  • Residual risk: renderer coverage for the new Add Provider -> Ollama interaction appears thin in this checkout (apps/desktop/src/renderer/src/components/Settings.test.ts currently exercises locale helper logic only), so UI wiring regressions (menu disabled-state/click flow/toast) may go uncaught.

Testing

  • Not run (automation)
  • Suggested tests: add a renderer-level test for Add Provider menu Ollama action (invokes settings.addProvider with empty apiKey, then refreshes rows), plus a disabled-state test when Ollama already exists.

open-codesign Bot

@Sun-sunshine06 Sun-sunshine06 merged commit b793a8f into OpenCoworkAI:main Apr 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop apps/desktop (Electron shell, renderer) docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improvement: Ollama 服务不应该默认固定显示,只在用户手动添加后才显示

2 participants