Repository navigation
Conversation
…lears A separate restore (silo backup restore --into) cleared the backup's AI provider list but kept the text, speech-to-text, and embedding bindings that point into it. On the restored server every admin AI provider change then failed with "provider is not connected". The AI bundle now clears its bindings with the list, and a cleared bundle writes its off values: the mail switch as before, and for AI an empty provider list at the current conversion version, encrypted with the restore's key when it has one, so the next start doesn't rebuild providers from the backup's legacy endpoint settings or the Ollama default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 2 minutes. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (Gemini 4 Neon, reviewed c810ca1)
One finding on checkAIReset in internal/backup/backup_postgres_test.go: the production changes and docs/architecture/backups.md match the restore paths and startup conversion code, but the new test helper does not verify that ai.providers is actually empty.
AI-assisted review: Antigravity (T3 Code) with Gemini 4 Neon.
The round-trip test file crossed the 2,000-line limit for test files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…provider-bindings
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: N/A
Validation tasks: none
Other clients: N/A (no client-visible change)
A separate restore (
silo backup restore --into) clears the backup's AI provider list, as it clears every credential for an outside service. It kept the text, speech-to-text and recommendation-embedding job bindings, though, and those name providers in that list. On the restored server every admin AI provider change then failed. Connecting a new provider returned 409the text model provider "<id>" is not connecteduntil someone cleared each binding by hand. A restore with anotherSECRET_KEY(--accept-lost-credentials) left the same bindings behind, because the restore step that clears settings the new key can't read had already deleted the list.This change clears the bindings with the list. It also leaves an empty provider list in place, so the restored server's first start doesn't rebuild providers from what the backup still holds.
A full restore onto a live server is not affected: it takes the live server's list and bindings afterwards, with the other server-specific settings.
Approach
internal/backup/settings_outbound.gonow clears the job bindings (config.AIProviderBindingKeys) along with the list. Bindings with no list left, as that step leaves them, also clear the bundle.offvalues, a field that replacesenabled. Mail still turnsemail.enabledoff. The AI bundle writes an empty provider list at the current legacy-conversion version, which it takes fromconfig.PlanAIProviderConversion(nil).ai.base_urlas a keyless provider. With recommendations on, it also adopts an Ollama default athttp://ollama:11434and binds embeddings to it.SECRET_KEY, like any stored provider list. The startup backfill that would otherwise encrypt a plaintext row reads it and writes it back without a guard, so another API server could save a provider in between and lose it.CarryOutboundSettingsandpostLoad.carrynow take the restore's cipher for this. A restore run without a key writes the list as plaintext, which Silo reads as it is and encrypts when it starts.docs/architecture/backups.mdrecords the rule.The empty list comes from the conversion planner rather than a new exported helper because #4668 is changing
internal/config/ai_providers.go.Validation
dec9d151(main):--into … --database-only, and started the server on the copy.the text model provider "custom-71e34b" is not connected.TestBackupRestoreRoundTripDBnow covers the cleared AI bundle and the bindings-only case.go mod tidy -diff, vet,make lint-changed(0 issues),make lint-router-recovery(0 issues) andmake test-go. Theinternal/backupdatabase tests also pass against a freshly migrated database.settings_outbound_postgres_test.goto keep the round-trip test file under the size limit.verify-settings-bindings-allwasn't run to the end because the web dependencies aren't installed here, and no settings contract changed.Evidence
Nothing changes on screen. The evidence page has the steps, both build identities, the trimmed API responses and server log lines, and the test runs on main and on this branch.
Evidence: https://evidence.siloserver.org/r/silo-server/restore-ai-bindings/
Risks
SECRET_KEYof a backup that has no bindings: the step that clears unreadable settings deletes the list, so nothing in the bundle triggers the clear. Follow-up: [bug] A restore with another key can leave the restored server converting the backup's old AI endpoints #4801, which waits for this PR to merge.Checklist
Council review
Plan round (before implementing):
Background review: round 1 reviewed c810ca1
Sol's review couldn't be posted from its task, so its two low findings are handled here. Fixed: the test now also checks that the emptied list holds no providers (5102ede), which Sol and Gemini both raised. Answered: the misleading "AI providers" line after a replace of another deployment's backup is pre-existing and tracked in #4813. A test for a dropped restore cipher isn't added: a nil cipher only falls back to the plaintext path, which reads correctly, and covering it would mean adding AI settings to the shared round-trip seed. Opus found nothing to post.
Nothing on screen changes, so there was no visual review.
AI Disclosure
xhighcode review (three finders and a sweep; its validation check couldn't read the v1.0 board), whose doc and test findings were fixed; and a simplify pass. See Council review.🤖 Generated with Claude Code
Note
Fix restore to clear AI provider bindings with the provider registry
outboundBundlenow has an off-values map instead of a single enabled switch, so a cleared bundle can write multiple off settings (settings_outbound.go).postLoad.carry,carryLiveState, andPGLoader.CarryOutboundSettings, so sensitive off values (like the empty registry) are encrypted with the server's key when available. Restores with another key write them as plaintext.DatabaseLoader.CarryOutboundSettingschanged signature; any out-of-tree loader implementing it needs the new cipher parameter.Macroscope summarized 1d9f3d1.