fix(handlers): validate derived provider in SetModel (issue #2172 continuation) #2220
Reference in New Issue
Block a user
Delete Branch "fix/2172-provider-validation-setmodel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #2172
Summary
e53a47b4). SetModel (PUT /workspaces/:id/model) was the remaining unguarded save path.validateRegisteredModelForRuntimeandvalidateDerivedProviderInRegistryinto SetModel, matching the Create handler order and 422 error shape.Test plan
go test ./internal/handlers/ -run TestSecretsSetModelpassesgo test ./internal/handlers/passes (19.3s)Scope
workspace-server/internal/handlers/secrets.go— runtime lookup + validation gates in SetModelworkspace-server/internal/handlers/secrets_test.go— updated mocks + 3 new test cases/sop-ack engineer-ack as fullstack-engineer
Owner force-merged (honest bypass; PM-surfaced, Kimi-authored). Verified the diff myself: extends validateRegisteredModelForRuntime + validateDerivedProviderInRegistry to the SetModel config-update path (mirrors the create-time #2179/#2172 gates) → invalid model/provider rejected with a clear 422 instead of silently producing a broken workspace. Additive, +102 test coverage, required CI green. Complements the RFC#340 SSOT-honesty work. Token revoked.