Repository navigation
API: which models a team's people may run - #2084
Merged
Merged
Conversation
getTeamModels, replaceTeamModels and deleteTeamModels under teams/{teamId}/models. Any member reads a team's list; only an owner or an admin sets or clears it. A person runs only a model one of their teams' lists names (parents included), within what the organization allows; a team with no list sets nothing. getModelCatalogue's description says it is narrowed by the caller's teams too, and team.models_changed joins the trail.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 23, 2026 20:58
…fers only what can run
# Conflicts: # CHANGELOG.md
listRefusedTurns lists the caller's turns refused before they ran (a model they may not run, a permission they lack, no plan): the message each was for, where it came in the thread, and the refusal's code and words. Nothing of a refused turn reaches the thread, so a reopened conversation lost both the person's message and the refusal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An admin sets, per team, which models its people may run. The spec and the regenerated client: additive only.
What it adds
getTeamModels,replaceTeamModels,deleteTeamModelsat/api/v2/organizations/{organizationId}/teams/{teamId}/models(tag Teams).TeamModelsis{ models, updatedBy, updatedAt }, each null when the team sets none.PERMISSION_DENIED, "Only an admin of this organization can change a team's models."). BodyTeamModelsInput{ models }: 1 to 200, unique, each one the organization's catalogue offers (getModelCataloguewithview=all), or 400VALIDATION_ERRORnaming it.Idempotency-Keylike every write. 404TEAM_NOT_FOUND.provider/model(the catalogue'sproviderand a model'sid).getTeamModels: a person in teams with lists (their teams' parents included) runs only a model one of those lists names, within what the organization allows; a team with no list sets nothing; admins and owners are held to it too.getModelCatalogue's description says it is narrowed for the caller by their teams' lists as well as the organization's allowlist.team.models_changedon the organization's trail (before and after), with its words inshared/audit-words.ts.Tests
bun run api:lintclean;bun test api/ shared/tests/api-deprecations.test.ts(89 pass);app/tests/audit-event-words.test.tsxandapp/tests/tolerant-reader.test.tspass; app typecheck, biome lint and format clean.