Skip to content

fix(server): keep previously used providers working after upgrades - #8176

Merged
t3dotgg merged 6 commits into
mainfrom
t3code/provider-default-upgrade-fix
Aug 25, 2026
Merged

fix(server): keep previously used providers working after upgrades#8176
t3dotgg merged 6 commits into
mainfrom
t3code/provider-default-upgrade-fix

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 25, 2026

Copy link
Copy Markdown
Member

Provider defaults changed, but stable releases omitted default enabled values from saved settings. Existing Cursor, Grok, and OpenCode threads could stop working after an upgrade.

Read persisted thread sessions and provider runtime sessions before loading provider settings. Restore only providers and provider instances that have real usage history, keep unused providers disabled, preserve explicit enables and disables across restarts, and restore used providers even when settings are invalid.

Verified with 87 focused settings, provider contract, provider registry, and startup tests, two integrated server startup tests, and server and contracts type checking.

Made by GPT-5.6 Sol through the Codex harness.

Note

Restore previously used optional providers (cursor, grok, opencode) on settings load

  • loadSettingsFromDisk in serverSettings.ts now queries provider usage history from projection_thread_sessions and provider_session_runtime, then enables optional providers and their instances that were previously used but lack explicit enabled flags.
  • Adds PersistedOptionalProviderSettings schema for lenient decoding of just the optional provider enabled flags, so valid flags survive even when other settings fields are invalid JSON.
  • writeSettingsAtomically now uses PERSISTED_SERVER_SETTINGS_DEFAULTS (with optional provider enabled set to undefined) so explicit enabled:false entries are retained in the persisted sparse JSON.
  • ServerSettingsLayerLive in server.ts is now wired with SqlitePersistenceLayerLive to support the history queries.
  • Risk: getSettings now fails with ServerSettingsError(operation="read-provider-history") if the provider history SQL query fails; callers handling ServerSettingsError should account for this new operation literal added in settings.ts.

Macroscope summarized 7252980.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d9ecff7c-b4d6-414a-958d-d53c61da092c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.3 KiB 13.3 KiB −16 B (−0.1%) 15.1 KiB
Codex Thread snapshot wire 6.9 KiB 6.9 KiB −3 B (−0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.4 KiB 6.4 KiB −13 B (−0.2%) 7.8 KiB
Codex Live turn WebSocket decoded 55.6 KiB 55.6 KiB −44 B (−0.1%) 66.4 KiB
Codex Live turn messages 11 10 −1 (−9.1%) 21
Claude Total thread wire 13.3 KiB 13.3 KiB −84 B (−0.6%) 15.1 KiB
Claude Thread snapshot wire 6.9 KiB 6.9 KiB −3 B (−0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.4 KiB −81 B (−1.2%) 7.8 KiB
Claude Live turn WebSocket decoded 56.4 KiB 56.4 KiB −88 B (−0.2%) 66.4 KiB
Claude Live turn messages 11 9 −2 (−18.2%) 21

Baseline: 1a4a759 · PR result: 7252980 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 109.4 KiB
  • Claude decoded thread snapshot: 110.1 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Comment thread apps/server/src/serverSettings.ts Outdated
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 25, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — Provider activation now depends on persisted database history, affecting startup hydration, provider probing, fallback selection, and settings-read failure behavior. The SQLite dependency and changed enablement semantics make this a material runtime change rather than a narrowly isolated fix.

You can add or adjust custom eligibility rules. Learn more.

@t3dotgg
t3dotgg force-pushed the t3code/provider-default-upgrade-fix branch from 00d8c18 to 7ec7746 Compare August 25, 2026 07:21
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 25, 2026 07:21

Dismissing prior approval to re-evaluate 7ec7746

@t3dotgg t3dotgg changed the title fix(server): keep existing Grok and OpenCode providers enabled fix(server): keep previously used providers working after upgrades Aug 25, 2026
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Aug 25, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One finding on error modeling for the new provider-history query. Import namespaces, Context.Service/make/layer shape, and dependency acquisition (yield* SqlClient.SqlClient with SqlClient surfaced in layer's requirements and provided in server.ts) all look consistent with the conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/serverSettings.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f492427. Configure here.

Comment thread apps/server/src/serverSettings.ts Outdated
Comment thread apps/server/src/serverSettings.ts
Comment thread apps/server/src/serverSettings.ts
@t3dotgg
t3dotgg merged commit 06de9e9 into main Aug 25, 2026
24 checks passed
@t3dotgg
t3dotgg deleted the t3code/provider-default-upgrade-fix branch August 25, 2026 08:10
BarretoDiego added a commit to BarretoDiego/t3code that referenced this pull request Aug 25, 2026
- Providers no server: compatibilidade preservada após upgrades (pingdotgg#8176), CLIs disponíveis no serviço do macOS (pingdotgg#8173) e fim do probing do Cursor enquanto não estiver habilitado (pingdotgg#8175)
- Client-runtime: retry de queries após interrupção de conexão (pingdotgg#8117), com ajustes em authorization/remote e state/runtime
- Claude: compactação de threads antigas antes de estourar o uso (pingdotgg#8144), incluindo novo módulo claudeCompaction em packages/shared e medidor de janela de contexto na web
- Web: dicas de atalho de thread agora atrasadas em 200 ms (pingdotgg#8172)
- Grok: limite nas atualizações cumulativas de saída de ferramentas (pingdotgg#7279)
- Mobile: coleta de modelo de dispositivo e versão de SO (pingdotgg#8169)
- Docs: release passa a verificar atualizações remotas com migrações de banco (pingdotgg#8177) e doc de providers do Claude atualizada
- Conflitos: 2 arquivos conflitaram e foram resolvidos manualmente, mantendo as modificações próprias do fork e incorporando as mudanças do upstream por cima

Sync automatico t3code-sync em 2026-08-25T06:05:15-03:00
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 25, 2026
## What's Changed
* feat(mobile): track device models and OS versions by @t3dotgg in pingdotgg/t3code#8169
* fix(grok): bound cumulative tool output updates by @lnieuwenhuis in pingdotgg/t3code#7279
* fix(web): delay thread shortcut hints by 200 ms by @t3dotgg in pingdotgg/t3code#8172
* fix(server): stop probing Cursor until enabled by @t3dotgg in pingdotgg/t3code#8175
* docs(release): verify remote updates with database migrations by @t3dotgg in pingdotgg/t3code#8177
* fix(server): keep provider CLIs available in the macOS service by @t3dotgg in pingdotgg/t3code#8173
* feat(claude): compact old threads before they burn through usage by @t3dotgg in pingdotgg/t3code#8144
* fix(client-runtime): retry queries after connection interruption by @tris203 in pingdotgg/t3code#8117
* fix(server): keep previously used providers working after upgrades by @t3dotgg in pingdotgg/t3code#8176


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260825.1182...v0.0.34-nightly.20260825.1183

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260825.1183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant