Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughProvider runtime configuration comparisons now distinguish runtime fields from presentation fields. Live instances retain resources after presentation edits and are replaced when runtime configuration changes or an entry is removed. Provider settings request confirmation before applicable changes. ChangesProvider lifecycle
Priority: ⬆️ High Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: High Suggested reviewers: Merge Risk: ⚪ Minimal · up to Presentation edits preserve live provider instances, while disruptive changes request confirmation. No actionable merge-blocking issue is established; merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Preserving sessions during presentation edits is appropriately separated from runtime changes. However, delayed confirmations retain an earlier settings snapshot, creating a risk that accepting an action overwrites concurrent changes, including provider disablement. No expanded cross-environment access was established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
b647041 to
fc71bc7
Compare
|
I left a use case on #11043 that this PR does not cover yet: #11043 (comment) In short: one of my provider instances has an environment variable holding access cookies that expire. Refreshing them means editing the variable, and that edit stops every thread running on the instance, including agents that never use the cookies. With this PR an environment edit counts as a runtime edit, so it still stops the running threads, now behind a confirmation. That is better than a silent kill, but I am left with the same two options: wait for everything to finish before editing, or restart the threads afterwards. Would it be possible for environment edits to let running sessions finish on the environment they were started with, and apply the new values only to sessions started after the edit? A provider process cannot pick up a changed environment after spawn anyway, so stopping it gains nothing. I understand if that is out of scope here, since it means keeping the old instance alive next to its replacement. In that case it would help to know whether it is worth a follow-up. |
| // or HTTP server construction path. | ||
| // or HTTP server construction path. Include retained instances so | ||
| // presentation edits reach clients without replacing subscriptions. | ||
| yield* Effect.forEach( |
There was a problem hiding this comment.
Could you add a focused ProviderRegistry test that reconciles a presentation-only edit and asserts getProviders publishes the updated name/color while retaining the instance subscription? The new snapshot-all-instances path is needed specifically for this behavior, but the added test only checks snapshots on ProviderInstanceRegistry directly. No code diff is appropriate because the fix belongs in a separate test file.
Posted via Macroscope — Effect Service Conventions
|
Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition. This PR guards provider renames by inspecting thread.session.status and session.providerInstanceId. The V2 client read model no longer exposes that session lifecycle; refile the guard against current runtime/run state. Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved. |
What Changed
Renaming or recoloring a provider keeps its live instance and sessions, while refreshed snapshots publish the new presentation. Runtime edits, disabling, and resetting warn when that instance has running threads. Deletion always asks for confirmation.
Why
The registry compared the whole settings envelope and closed the instance scope for cosmetic edits, so renaming a provider killed in-flight work in every thread using it. Compare runtime fields separately and update presentation in place. Normalize the legacy
enabledflag during hydration so a default provider's first rename preserves its instance too.Fixes #11043.
Scope and approval
Maintainer-triaged bug: triage comment on #11043 (labels
bug,accepted). Its suggested fix has three parts, and this PR does exactly those: keep the instance for presentation-only edits, warn before delete and other rebuilds when the instance has active threads, and add a registry test that a display-name-only reconcile keeps the live instance.Verification
main: renaming a provider with running threads tore down every live session on that instance. The new registry regression test failed before the fix.0cf482b08b(Claude Opus 5.5, this session; resolved conflicts in the registry test and settings panel):vp test run src/provider/Layers/ProviderInstanceRegistryLive.test.ts src/provider/Layers/CodexProvider.test.ts(apps/server): 17/17 passed.vp test run src/components/settings/ProviderSettingsPanel.environment.test.tsx(apps/web): 11/11 passed.tsc --noEmitin packages/contracts: no errors. The apps/server and apps/web typechecks did not finish within 20 minutes on this heavily loaded machine, so they were not completed after the rebase; CI covers them. Before the rebase, all three passed.vp linton the changed files: no errors (one existing warning).vp fmt --check: clean.UI Changes
Before: Delete immediately removes the provider. After: confirmation explains the effect on running threads.
Before recording · Rename, color, and cancellation recording
Checklist
Implemented with GPT-6 in Codex. Rebase by Claude Opus 5.5 via Claude Code.