feat(organizations): add gated organization mode defaults#3981
feat(organizations): add gated organization mode defaults#3981pandemicsyn wants to merge 5 commits into
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental diff refactors the default-model validation logic from ad-hoc boolean/branded-type guards into a clean discriminated union ( Files Reviewed (1 file changed since previous review)
Previously Reviewed Files (unchanged, 6 files)
Previous Review Summary (commit 166e95a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 166e95a)Status: No Issues Found | Recommendation: Merge Executive SummaryBoth previously flagged issues have been resolved in this update: the Files Reviewed (7 files)
Reviewed by deepseek-v4-pro-20260423 · 195,858 tokens Review guidance: REVIEW.md from base branch |
jeanduplessis
left a comment
There was a problem hiding this comment.
Judgement Review
Problem statement
non-blocking: PR explains staged rollout well. Could add one sentence naming expected client precedence order in final shipped behavior: user local override > org mode default > existing fallback.
Solution
- Pragmatic and clear solution, no feedback.
Risk
- No feedback.
Architecture
blocking: Mode default model writes diverge from existing org model-setting ownership. Current org default model and access-list mutations use organizationBillingMutationProcedure (owner or billing manager), and UI copy says only owners can edit model access. This PR adds per-mode model defaults through organizationMemberMutationProcedure. That creates two architecture concepts for who owns org model policy. Align defaultModel writes with existing org model-setting ownership, or document why mode defaults intentionally follow broader custom-mode permissions.
Operability
blocking: Rollback and stale-default behavior are unclear. Disabling org-default-model-config stops UI/write access, but /api/organizations/[id]/modes still returns persisted config.defaultModel. Also, if org policy later denies stored model, test coverage keeps stale value in mode config. Future clients may consume invalid defaults unless endpoint filters them or clients must validate. Add explicit contract plus tests: either server filters/omits invalid mode defaults, settings changes clear invalid mode defaults, or clients must validate against allowed model list before use.non-blocking: Add short rollback note: Something like disable flag, clear affected config.defaultModel values if clients already shipped, verify mode API no longer returns active defaults.
Verification
blocking: Verification section lacks confirmation of manual verification for main user journeys: flag on/off behavior, setting and clearing a mode default in UI, built-in override clear/revert behavior, Teams org rejection, denied model rejection, and API payload after set/clear.non-blocking: Add verification steps for reviewer to confirm these flows locally.
Agent Entropy
non-blocking: Add short comment or doc near OrganizationModeConfigSchema naming relationship to organization.settings.default_model: org default is global fallback; mode default is per-mode override; user local selection still wins. This will prevent future agent confusion once client work lands.
Summary
defaultModelsupport to organization mode config so organizations can choose a model per mode before CLI and VSCode clients begin consuming that field.architectwhile keepingcodeon a faster coding model, without removing user-level model overrides.org-default-model-config.Verification
API response sample
Visual Changes
Mode Default ModelpickerReviewer Notes
defaultModelis optional in the JSONB config.