Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .changeset/37686-agent-model-name-optional.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
'@objectstack/spec': minor
'@object-ui/app-shell': patch
Expand All @@ -11,10 +11,10 @@

`AIModelConfigSchema.model` (the `model` key inside an agent's `model` block) is now optional. An agent that only tunes sampling can write `model: { temperature: 0.2 }` without naming a model; the host then runs it on its default model for the environment. Before, the block refused a missing `model`, so such an agent had to invent a model name it did not mean.

`AIModelConfigSchema.provider` loses its `openai` default. A block that names no model also names no provider, so the parse no longer stamps `provider: 'openai'` onto it — that would assert a provider for a model the host picks. The key and its enum are unchanged, and a written `provider` is carried as written. No runtime reads an agent's `model.provider`, so no deployed agent changes behaviour; what changes is the parsed value.
`AIModelConfigSchema.provider` loses its `openai` default. A block that names no model also names no provider, so the parse no longer stamps `provider: 'openai'` onto it — that would assert a provider for a model the host picks. The key itself leaves the spec in the same major (`agent-model-provider-removed`, see that changeset): delete `provider`, the deployment's AI settings choose the provider. No runtime reads an agent's `model.provider`, so no deployed agent changes behaviour; what changes is the parsed value.

Unchanged: an explicit `model: { model: 'gpt-4o' }` parses and is carried as written; the block is still strict, so an unknown key is refused; `temperature` still defaults to `0.7`. There is no sentinel value and no tier key.

`@object-ui/app-shell`: the agent preview's model pill appears when the block names a model or a provider, and reads `PROVIDER · MODEL`, `MODEL` or `PROVIDER` from what is written. Before, it keyed on `provider` alone, so a block that named only a model showed no model at all.
`@object-ui/app-shell`: the agent preview's model pill appears when the block names a model, and reads the model name. Before, it keyed on `provider` alone, so a block that named only a model showed no model at all.

What to do: nothing for existing agents. Code that reads `agent.model.model` gets `string | undefined` from the `Agent` type and treats `undefined` as "use the host's default model". Code that read `model.provider` from a parsed agent and relied on `openai` when the author wrote none now reads `undefined`; to keep `openai`, write `provider: 'openai'` in the agent.
What to do: nothing for existing agents. Code that reads `agent.model.model` gets `string | undefined` from the `Agent` type and treats `undefined` as "use the host's default model". Code that read `model.provider` from a parsed agent and relied on `openai` when the author wrote none now reads nothing there: the provider is the deployment's choice.
31 changes: 31 additions & 0 deletions .changeset/37712-agent-model-provider-retired.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
'@objectstack/spec': minor
'@objectstack/cli': patch
'@objectstack/platform-objects': patch
'@object-ui/app-shell': patch
'@object-ui/console': patch
---

feat(spec)!: retire an agent's `model.provider` — no runtime read it; the deployment's AI settings choose the provider

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37796

<!-- adr-0087: registered agent-model-provider-removed, agent-model-provider-retired -->

**BREAKING** key removal on `AIModelConfigSchema` (`@objectstack/spec/ai`), an agent's `model` block. The key declared which provider served the agent, from an enum of `openai`, `azure_openai`, `anthropic` and `local`, and no runtime ever read it: the AI runtime that executes agents applies the model name, `temperature` and `maxTokens` from the block and nothing else, so an agent that declared `anthropic` ran on whatever provider the deployment served. The providers a deployment can turn on are its own AI settings, a list the enum neither matched nor could follow.

| FROM | TO |
|:--|:--|
| `model: { provider: 'anthropic', model: 'claude-sonnet-4' }` | `model: { model: 'claude-sonnet-4' }` — the deployment resolves the name among the providers it has turned on |

The one-line fix: delete `provider` from every agent's `model` block; `os migrate meta --from 18 --write` deletes it from agent sources. Writing it after upgrade fails `tsc` (the input type is `never`) and fails the parse with that prescription. `provider: 'openai'`, the default every released 18.x toolchain wrote into a parsed agent's `model` block, is accepted as inert residue and stripped, so agents built and stored by 18.x keep loading. The model name, `temperature`, `maxTokens` and `topP` are unchanged.

The retirement kit:

- **`@objectstack/spec`**: `provider` is a `retiredKey()` tombstone on `AIModelConfigSchema`, and the 18.x emitted default is stripped by `acceptRetiredDefaultResidue`. The D2 conversion `agent-model-provider-removed` (lossless, retired from the load path) deletes the key from `agents[]` on every data-at-rest seam (stored rows, built artifacts, `os migrate meta`); the D3 entry `agent-model-provider-retired` names what the upgrade still owes: whether the model each agent names is one the target deployment offers. The key is registered in `RETIRED_KEYS_BY_MAJOR[19]`. The liveness ledger's `model` row records the removal. The agent form's model help text no longer names a provider, and a `provider` written at the agent's top level is answered with the same fact instead of a pointer to `model.provider`. The `AIModelConfigSchema` export is now the residue stage's preprocess pipe with a read-through `shape` (the `ViewSharingSchema` shape), so `.extend()`, `.pick()`, `.omit()` and `.partial()` are no longer available on it; extend the inner shape instead.
- **`@objectstack/platform-objects`**: the agent form's regenerated help-text labels.
- **`@object-ui/app-shell`**: the agent metadata preview shows the model name alone and never a provider pill.
- **`@object-ui/console`**: the agent preview sample no longer writes `provider`.
- **`@objectstack/cli`**: `os explain agent` describes the `model` block without `provider`, and its example drops it.
6 changes: 1 addition & 5 deletions content/docs/ai/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ own `ask` / `build` records use exactly these fields):
| `surface` | `'ask'` \| `'build'` — the product surface this agent binds (ADR-0063 §1) |
| `role` | Free-text **persona** string (e.g. `"Senior Support Engineer"`) — not an enum |
| `instructions` | System prompt / prime directives |
| `model` | Provider + model config (`provider`: `openai` \| `azure_openai` \| `anthropic` \| `local`) |
| `model` | Model config: `model` (the model name, optional — absent means the deployment's default model), `temperature`, `maxTokens`, `topP`. There is no `provider`: it was **removed in protocol 19 (#37712)** because no runtime read it — the deployment's AI settings choose the provider, and resolve the model name among the providers they turn on |
| `skills` | Skill names to attach (the primary Agent → Skill → Tool capability model) |
| `tools` | **Removed in protocol 17 (#3894)** — typed `never`, so writing it fails `tsc`, and a value that reaches the runtime is rejected at parse. This is **not** a rename: there is no key the value moves to. Declare each tool on a **skill** instead — a platform tool by its registered name, or `action_<name>` for one of your own AI-exposed Actions — and attach that skill through `skills` (ADR-0064) |
| `knowledge` | **Removed in protocol 17 (#3896)** — typed `never`, so writing it fails `tsc`, and a value that reaches the runtime is rejected at parse. Declaring `sources` / `indexes` here never scoped retrieval: `search_knowledge` takes `sourceIds` from the LLM's own tool-call arguments, not from the agent record, so an author who “scoped” access here scoped nothing. This is **not** a rename: there is no key the value moves to — delete the block. Restrict retrieval at the knowledge-service / source level (per-source permissions), and describe intended grounding in `instructions` so the model asks for the right sources |
Expand Down Expand Up @@ -365,7 +365,6 @@ Your responsibilities:
Always be professional and data-driven.`,

model: {
provider: 'openai',
model: 'gpt-4',
temperature: 0.7,
maxTokens: 2000,
Expand Down Expand Up @@ -401,7 +400,6 @@ Your responsibilities:
Always be empathetic and solution-focused.`,

model: {
provider: 'openai',
model: 'gpt-4',
temperature: 0.5,
maxTokens: 1500,
Expand Down Expand Up @@ -434,7 +432,6 @@ Tasks:
Use reputable data sources.`,

model: {
provider: 'openai',
model: 'gpt-3.5-turbo',
temperature: 0.3,
maxTokens: 1000,
Expand Down Expand Up @@ -470,7 +467,6 @@ Responsibilities:
Use the data tools to query records and aggregate metrics.`,

model: {
provider: 'openai',
model: 'gpt-4',
temperature: 0.2,
maxTokens: 3000,
Expand Down
1 change: 0 additions & 1 deletion content/docs/getting-started/common-patterns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ export const supportAgent = defineAgent({
label: 'Customer Support Agent',
role: 'Customer Support Agent',
model: {
provider: 'openai',
model: 'gpt-4o',
temperature: 0.3,
maxTokens: 2048
Expand Down
6 changes: 3 additions & 3 deletions content/docs/references/ai/agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const result = AIModelConfigSchema.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **provider** | `Enum<'openai' \| 'azure_openai' \| 'anthropic' \| 'local'>` | optional | |
| **provider** | `never` | optional | [REMOVED] `agent.model.provider` was removed in @objectstack/spec 19.0.0 (ADR-0049 enforce-or-remove) — it never had an effect: no runtime read it, and the provider that serves an agent is chosen by the deployment's AI settings, never by the agent. Delete the key. To pin a model, name it in `agent.model.model`; the deployment resolves that name among the providers it has turned on, and an agent that names no model runs on the deployment's default model. Run `os migrate meta --from 18` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **model** | `string` | optional | Model name (e.g. gpt-4, claude-3-opus). Optional: when absent, the agent runs on the host's default model for this environment, so an agent that only tunes sampling (e.g. `temperature`) need not name a model. |
| **temperature** | `number` | optional (default: `0.7`) | |
| **maxTokens** | `number` | optional | |
Expand All @@ -48,7 +48,7 @@ const result = AIModelConfigSchema.parse(data);
| **avatar** | `string` | optional | |
| **role** | `string` | ✅ | The persona/role (e.g. "Senior Support Engineer") |
| **instructions** | `string` | ✅ | System Prompt / Prime Directives |
| **model** | `{ provider?: Enum<'openai' \| 'azure_openai' \| 'anthropic' \| 'local'>; model?: string; temperature?: number; maxTokens?: number; … }` | optional | |
| **model** | `{ model?: string; temperature?: number; maxTokens?: number; topP?: number }` | optional | |
| **lifecycle** | `never` | optional | [REMOVED] `agent.lifecycle` was removed in @objectstack/spec 17.7.0 (ADR-0049 enforce-or-remove) — no runtime ever read it: no agent moved through a declared state and no transition was ever refused. Delete the key. A phase of a conversation is a skill with its own `instructions` and `tools`, selected by its `triggerConditions` (ADR-0064); multi-step process orchestration is a Flow (ADR-0019); a record's status transitions are a `state_machine` validation rule on the object (ADR-0020). Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **surface** | `Enum<'ask' \| 'build'>` | optional (default: `"ask"`) | Product surface this agent binds ('ask' \| 'build') — ADR-0063 §1 |
| **skills** | `string[]` | optional | Skill names to attach (Agent→Skill→Tool architecture) |
Expand All @@ -72,7 +72,7 @@ const result = AIModelConfigSchema.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **provider** | `Enum<'openai' \| 'azure_openai' \| 'anthropic' \| 'local'>` | optional | |
| **provider** | `never` | optional | [REMOVED] `agent.model.provider` was removed in @objectstack/spec 19.0.0 (ADR-0049 enforce-or-remove) — it never had an effect: no runtime read it, and the provider that serves an agent is chosen by the deployment's AI settings, never by the agent. Delete the key. To pin a model, name it in `agent.model.model`; the deployment resolves that name among the providers it has turned on, and an agent that names no model runs on the deployment's default model. Run `os migrate meta --from 18` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
| **model** | `string` | optional | Model name (e.g. gpt-4, claude-3-opus). Optional: when absent, the agent runs on the host's default model for this environment, so an agent that only tunes sampling (e.g. `temperature`) need not name a model. |
| **temperature** | `number` | optional (default: `0.7`) | |
| **maxTokens** | `number` | optional | |
Expand Down
1 change: 0 additions & 1 deletion docs/notes/crm-development-standards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ export const MyAgent: Agent = {
instructions: `Clear instructions for the AI...`,

model: {
provider: 'openai', // 'openai' | 'azure_openai' | 'anthropic' | 'local'
model: 'gpt-4',
temperature: 0.7,
maxTokens: 2000,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/explain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const SCHEMAS: Record<string, SchemaInfo> = {
],
optional: [
{ name: 'skills', type: 'string[]', description: 'Skill names to attach (Agent -> Skill -> Tool architecture, ADR-0064). This is where tool access comes from: a platform tool by its registered name, or `action_<name>` for one of your own AI-exposed Actions — declared inside the skill, not here.' },
{ name: 'model', type: 'AIModelConfig', description: 'LLM configuration OBJECT — { provider, model, temperature, maxTokens, topP }. A bare model string is rejected, and model settings such as `temperature` live in HERE, never at the agent top level.' },
{ name: 'model', type: 'AIModelConfig', description: 'LLM configuration OBJECT — { model, temperature, maxTokens, topP }; `model` is optional (absent = the deployment\'s default model). A bare model string is rejected, model settings such as `temperature` live in HERE, never at the agent top level, and there is no `provider` (removed: the deployment\'s AI settings choose it).' },
{ name: 'surface', type: '"ask" | "build"', description: 'Product surface this agent is for (default "ask")' },
{ name: 'avatar', type: 'string', description: 'Avatar image reference' },
{ name: 'access', type: 'string[]', description: 'Who can chat with this agent — enforced at the chat route' },
Expand All @@ -208,7 +208,7 @@ export const SCHEMAS: Record<string, SchemaInfo> = {
// tool inside a skill and attach the skill by name here.
skills: ['knowledge_lookup'],
// \`model\` is an object, and temperature belongs inside it.
model: { provider: 'openai', model: 'gpt-4o', temperature: 0.2 },
model: { model: 'gpt-4o', temperature: 0.2 },
}`,
related: ['object', 'flow', 'query'],
docsPath: 'ai/agent',
Expand Down
2 changes: 1 addition & 1 deletion packages/objectql/src/metadata-validation-sweep.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ const FIXTURES: Record<string, Fixture> = {
label: 'Sweep',
role: 'Sweep test agent',
instructions: 'be helpful',
model: { provider: 'openai', model: 'gpt-4o-mini' },
model: { model: 'gpt-4o-mini' },
},
invalid: { name: 'sweep_agent', label: 'Sweep' },
invalidatedField: 'instructions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
model: {
label: "النموذج",
helpText: "تهيئة نموذج الذكاء الاصطناعي (المزوّد، واسم النموذج، ودرجة الحرارة، إلخ)"
helpText: "تهيئة نموذج الذكاء الاصطناعي (اسم النموذج، ودرجة الحرارة، إلخ)"
},
planning: {
label: "التخطيط",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const deMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
model: {
label: "Modell",
helpText: "Konfiguration des KI-Modells (Anbieter, Modellname, Temperatur usw.)"
helpText: "Konfiguration des KI-Modells (Modellname, Temperatur usw.)"
},
planning: {
label: "Planung",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
model: {
label: "Model",
helpText: "AI model configuration (provider, model name, temperature, etc.)"
helpText: "AI model configuration (model name, temperature, etc.)"
},
planning: {
label: "Planning",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
model: {
label: "Modelo",
helpText: "Configuración del modelo de IA (provider, model name, temperature, etc.)"
helpText: "Configuración del modelo de IA (model name, temperature, etc.)"
},
planning: {
label: "Planificación",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const frMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
model: {
label: "Modèle",
helpText: "Configuration du modèle d’IA (fournisseur, nom du modèle, température, etc.)"
helpText: "Configuration du modèle d’IA (nom du modèle, température, etc.)"
},
planning: {
label: "Planification",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
model: {
label: "モデル",
helpText: "AI モデル設定(provider, model name, temperature など)"
helpText: "AI モデル設定(model name, temperature など)"
},
planning: {
label: "計画",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const koMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
model: {
label: "모델",
helpText: "AI 모델 구성(공급자, 모델 이름, 온도 등)"
helpText: "AI 모델 구성(모델 이름, 온도 등)"
},
planning: {
label: "계획",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const ptBRMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
model: {
label: "Modelo",
helpText: "Configuração do modelo de IA (provedor, nome do modelo, temperatura etc.)"
helpText: "Configuração do modelo de IA (nome do modelo, temperatura etc.)"
},
planning: {
label: "Planejamento",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const ruMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
model: {
label: "Модель",
helpText: "Настройка модели ИИ (поставщик, имя модели, температура и т. д.)"
helpText: "Настройка модели ИИ (имя модели, температура и т. д.)"
},
planning: {
label: "Планирование",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
model: {
label: "模型",
helpText: "AI 模型配置(提供方、模型名、温度等)"
helpText: "AI 模型配置(模型名、温度等)"
},
planning: {
label: "规划",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ export const zhHantMetadataForms: NonNullable<TranslationData['metadataForms']>
},
model: {
label: "模型",
helpText: "AI 模型設定(提供方、模型名、溫度等)"
helpText: "AI 模型設定(模型名、溫度等)"
},
planning: {
label: "規劃",
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/authorable-surface/ai.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keys": [
"ai/AIModelConfig:maxTokens",
"ai/AIModelConfig:model",
"ai/AIModelConfig:provider",
"ai/AIModelConfig:provider [RETIRED]",
"ai/AIModelConfig:temperature",
"ai/AIModelConfig:topP",
"ai/AIUsageRecord:costUsd",
Expand Down
1 change: 0 additions & 1 deletion packages/spec/docs/MCP_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ export const salesAgent = AgentSchema.parse({
instructions: 'You help sales team with customer data and pipeline management.',

model: {
provider: 'openai',
model: 'gpt-4-turbo',
temperature: 0.3,
},
Expand Down
Loading
Loading