Commit b793a8f
authored
[codex] hide Ollama until manually added (#170)
## 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
- [x] 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
- [x] I read [`CLAUDE.md`](../CLAUDE.md) before starting
- [ ] I read [`docs/VISION.md`](../docs/VISION.md) and
[`docs/PRINCIPLES.md`](../docs/PRINCIPLES.md) before starting (not
present in this local checkout; `docs/` only contains `docs/research/`)
- [x] Commits are signed with DCO (`git commit -s`)
- [x] Added/updated tests for the change
- [x] Added a changeset (`pnpm changeset`) because behavior changed
- [x] Updated docs if behavior changed (not needed; behavior is covered
by Settings UI copy)
## PRINCIPLES §5b checks
- [x] Compatibility: Existing persisted provider/secret rows still
render; keyless Ollama remains allowed after explicit add.
- [x] Upgradeability: No schema changes; configs keep the same v3 shape.
- [x] No bloat: No dependency additions; only targeted IPC/UI/tests/i18n
changes.
- [x] 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.
Signed-off-by: HUANG <15866338256@163.com>1 parent 7e75226 commit b793a8f
8 files changed
Lines changed: 132 additions & 19 deletions
File tree
- .changeset
- apps/desktop/src
- main
- renderer/src/components
- packages/i18n/src/locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
168 | 198 | | |
169 | 199 | | |
170 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
251 | 255 | | |
252 | 256 | | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
256 | | - | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
| |||
336 | 340 | | |
337 | 341 | | |
338 | 342 | | |
339 | | - | |
340 | 343 | | |
341 | 344 | | |
342 | 345 | | |
| |||
354 | 357 | | |
355 | 358 | | |
356 | 359 | | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
361 | 366 | | |
362 | 367 | | |
363 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
2 | 7 | | |
3 | 8 | | |
4 | 9 | | |
| |||
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
120 | 158 | | |
121 | 159 | | |
122 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 103 | | |
115 | 104 | | |
116 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1018 | 1039 | | |
1019 | 1040 | | |
1020 | 1041 | | |
| |||
1512 | 1533 | | |
1513 | 1534 | | |
1514 | 1535 | | |
| 1536 | + | |
1515 | 1537 | | |
1516 | 1538 | | |
1517 | 1539 | | |
| |||
1520 | 1542 | | |
1521 | 1543 | | |
1522 | 1544 | | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
1523 | 1549 | | |
1524 | 1550 | | |
1525 | 1551 | | |
| |||
2137 | 2163 | | |
2138 | 2164 | | |
2139 | 2165 | | |
| 2166 | + | |
2140 | 2167 | | |
2141 | 2168 | | |
| 2169 | + | |
2142 | 2170 | | |
2143 | 2171 | | |
2144 | 2172 | | |
| |||
2147 | 2175 | | |
2148 | 2176 | | |
2149 | 2177 | | |
| 2178 | + | |
2150 | 2179 | | |
2151 | 2180 | | |
| 2181 | + | |
2152 | 2182 | | |
2153 | 2183 | | |
2154 | 2184 | | |
| |||
2198 | 2228 | | |
2199 | 2229 | | |
2200 | 2230 | | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
2201 | 2238 | | |
2202 | 2239 | | |
2203 | 2240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
| |||
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
| |||
293 | 296 | | |
294 | 297 | | |
295 | 298 | | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| |||
0 commit comments