Repository navigation
Commit f07d63a
feat(spec)!: retire an agent's model.provider — no runtime read it; the deployment's AI settings choose the provider (#37783)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu6xSMqJULJVMTrh5LMSQ4SD)_
Fixes #37712
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37796
## 维护者速读
- 是什么:agent 元数据里的 `model.provider`(openai / azure_openai / anthropic /
local)从来没有运行时读取,按 ADR-0049「执行或移除」退役。供应商由部署的 AI 设置决定,agent 只写模型名。
- 影响:以后 agent 里写 `provider` 会报错,并提示删掉这一行;`os migrate meta --from 18
--write` 会自动删。18.x 默认写进去的 `provider: 'openai'` 会被静默剥掉,已构建、已存储的 agent
照常加载。元数据预览不再显示供应商标签。运行时行为不变。
- 要你做什么:无(座位已采纳退役路线,hold 记录 7206344767)。
## What changes
- **Schema** (`packages/spec/src/ai/agent.zod.ts`):
`AIModelConfigSchema.provider` is a `retiredKey()` tombstone with the
prescription, so writing it fails `tsc` (input type `never`) and the
parse answers with the fix. The 18.x emitted default `provider:
'openai'` is accepted as inert residue and stripped
(`acceptRetiredDefaultResidue`, the #12840 rule for a retired defaulted
key; same shape as `ViewSharingSchema`). Every other value meets the
tombstone.
- **ADR-0087 kit**: D2 conversion `agent-model-provider-removed`
(`conversions/entries/19/`, step 19, `retiredFromLoadPath: true`,
`retiredAfter: '18.6.0'`, lossless `stripKeys`);
`RETIRED_KEYS_BY_MAJOR[19]` entry `ai/AIModelConfig:provider`; D3
semantic entry `agent-model-provider-retired` (relevance `agents`); one
sentence in the step-19 rationale; JOIN row in
`retired-key-removal-version.pin.test.ts`.
- **Ledger**: `liveness/agent.json` `model` row note records the removal
(a nested key has no row of its own). Evidence and `verifiedAt`
unchanged: this session cannot read the cloud repository to re-verify
it.
- **Generated**: `authorable-surface/ai.json` (`[RETIRED]` row),
`content/docs/references/ai/agent.mdx`.
- **`DEFAULT_CHANGES_BY_MAJOR[19]`** (from #37697): the reason no longer
tells authors to write `provider: 'openai'`; it points at this
retirement instead.
- **Form**: the agent form's `model` help text no longer names a
provider; the 11 locale bundles were regenerated (`en`) and hand-trimmed
(the other ten drop the provider word only).
- **UI** (`AgentPreview.tsx`): the preview shows the model name alone; a
stale draft that still carries a provider never shows it.
- **Docs and fixtures**: `content/docs/ai/agents.mdx` (table row + 4
examples), `getting-started/common-patterns.mdx`,
`packages/spec/docs/MCP_GUIDE.md`,
`docs/notes/crm-development-standards.mdx`, `os explain agent` text and
example, `benchmark.bench.ts`, `metadata-validation-sweep.test.ts`,
`agent.test.ts`.
- **Pins**: `src/ai/agent-model-provider-retirement.test.ts`: refusal at
every door (schema, `defineStack`), residue strip with a near-value
control, `tsc` channel, D2 conversion on the stored-row seam and the
boot door, idempotence, load-path retirement, registration, and a
tree-scoped absence walk over the declared radius (added to
`vitest.repo-tests.json`).
- **Changeset**: `.changeset/37712-agent-model-provider-retired.md`,
`@objectstack/spec` minor, BREAKING banner, FROM → TO table, ADR-0087
marker.
## Why
ADR-0049 enforce-or-remove. Removal, not enforcement, because:
1. The enum does not match the deployment's providers. The deployment's
list is `AI_PROVIDERS` in
`packages/services/service-settings/src/manifests/ai-models.ts`
(`gateway`, `openai`, `anthropic`, `google`, `deepseek`, `dashscope`,
`cloudflare`, `siliconflow`, `openrouter`). `azure_openai` and `local`
are not providers a deployment has, and most real ones cannot be
written. Enforcing it would mean redesigning the key, not adding a
reader.
2. objectstack-ai/cloud#5055 phase 1 resolves a model by its id among
the providers the deployment turned on. The capability "pin an agent to
a model" is `model.model`, which is live.
3. No reader in this repository (only the preview pill). Cloud side: the
ledger's cross-repo row (cloud @cb8ee7ff) and the card's 11-26 read of
cloud main; not re-verified here.
## Acceptance notes
- **Decided in the thread (small things):** the residue stage is
adopted. Every released 18.x toolchain wrote `provider: 'openai'` into
each parsed `model` block, so refusing that value would refuse agents
nobody wrote a provider for; the #12840 rule names this case. Cost: an
explicit `provider: 'openai'` in untyped JSON is stripped silently
(`tsc` still refuses it in TypeScript).
- **Overlap:** `overlap-check` against `origin/main` is clean. Against
#37676 there is one conflict in
`packages/spec/src/conversions/registry.ts` (both insert a line at the
head of the sorted `MAJOR_19_CONVERSIONS` list). It cannot be avoided by
placement; whichever lands second keeps both lines sorted by identifier.
The step-19 rationale sentence was placed so it does not conflict.
- **Out of scope:** the ledger says `model.topP` has no reader either.
`top_p` is a mainstream setting, so the fix is a reader in cloud's AI
runtime (`carrier: cloud`, raised with the seat).
- **Skills (follow-up #37796):** `skills/objectstack-ai/SKILL.md:370`
(`provider` table row) and
`skills/objectstack-ai/evals/skills-tools-knowledge.json:17` (expected
output names the enum). The tombstone keeps the identifier in
`packages/`, so neither gate goes red on this PR; the skills card
follows the retirement.
- **Absence walk radius:** the tree-scoped absence walk covers the five
roots `spec#test` already declares and excludes `ui/`; the `ui/` agent
fixtures were cleaned by hand (commit 8655944). They are untyped
objects, so tsc did not catch them either.
## Verification
- ui fixtures: `automationPreviews.i18n-10862` and three more
(`emptyCollection-8526`, `ResourceListPage.servedListColumns-36860`,
`apps/console/src/preview-samples.ts`) stop writing `provider` (commit
8655944); those 5 files 121 passed, console preview-samples 47
passed.
- `pnpm --filter @objectstack/spec build` then `check:generated`: 14/14
up to date.
- Source audits: `check:empty-state`, `check:skill-examples`,
`check:skill-served-sections`, `check:yaml-examples`,
`check:template-manifests`, `check:variant-docs`,
`check:error-code-provenance`, `check:duration-unit-keys`,
`check:exported-any`, `check:dual-source-exports`,
`check:entry-nameability`, `check:browser-reachable-entries`,
`check:scripts-typecheck`, `check:llms-txt`: all exit 0.
- `pnpm --filter @objectstack/spec typecheck` (tsc + scripts +
test-typecheck): 0.
- `@objectstack/spec` full vitest: 998 files, 30139 passed; the one
failure on the first run (`retired-key-removal-version.pin` JOIN row) is
fixed and that file re-run green.
- `pnpm check:i18n`: all bundles in sync.
`check:skill-identifier-liveness`, `check:doc-authoring`,
`check:adr-0087-registration`, `check:empty-changeset`,
`check:changeset-fixed`, `check:cross-package-test-inputs`,
`check-changeset-no-major`: 0.
- `packages/cli` `test/commands.test.ts` +
`test/explain-rule-id.test.ts`: 64 passed. `packages/objectql`
`metadata-validation-sweep.test.ts`: passed. `ui` `AgentPreview*`: 24
passed.
- eslint on the new and changed source files: clean.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (changed files).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English (the 维护者速读 block is the
maintainer's standing exception).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
Session: session_01L6bhgTnm6d4W7ugSacDJ3j
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgTnm6d4W7ugSacDJ3j
<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgV6i8jfWwSXjpWJrjA -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8fbae19 commit f07d63a
43 files changed
Lines changed: 647 additions & 79 deletions
File tree
- .changeset
- content/docs
- ai
- getting-started
- references/ai
- docs/notes
- packages
- cli/src/commands
- objectql/src
- platform-objects/src/apps/translations
- spec
- authorable-surface
- docs
- liveness
- scripts/lib
- src
- ai
- conversions
- entries/19
- migrations
- entries
- retired-keys
- semantic
- ui
- apps/console/src
- packages/app-shell/src/views/metadata-admin
- previews
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | 368 | | |
370 | 369 | | |
371 | 370 | | |
| |||
401 | 400 | | |
402 | 401 | | |
403 | 402 | | |
404 | | - | |
405 | 403 | | |
406 | 404 | | |
407 | 405 | | |
| |||
434 | 432 | | |
435 | 433 | | |
436 | 434 | | |
437 | | - | |
438 | 435 | | |
439 | 436 | | |
440 | 437 | | |
| |||
470 | 467 | | |
471 | 468 | | |
472 | 469 | | |
473 | | - | |
474 | 470 | | |
475 | 471 | | |
476 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
400 | 399 | | |
401 | 400 | | |
402 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3288 | 3288 | | |
3289 | 3289 | | |
3290 | 3290 | | |
3291 | | - | |
| 3291 | + | |
3292 | 3292 | | |
3293 | 3293 | | |
3294 | 3294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3288 | 3288 | | |
3289 | 3289 | | |
3290 | 3290 | | |
3291 | | - | |
| 3291 | + | |
3292 | 3292 | | |
3293 | 3293 | | |
3294 | 3294 | | |
| |||
0 commit comments