diff --git a/.changeset/37850-agent-model-provider-refused-residue.md b/.changeset/37850-agent-model-provider-refused-residue.md new file mode 100644 index 00000000000..3aa05d4db5a --- /dev/null +++ b/.changeset/37850-agent-model-provider-refused-residue.md @@ -0,0 +1,17 @@ +--- +'@objectstack/skills': patch +'@objectstack/spec': patch +--- + +docs(skills,spec): an agent's retired `model.provider` is described as refused, naming the one 18.x value that still parses + +Clause-②: no +Metadata-protocol: none + +`skills/objectstack-ai/SKILL.md` (Model Configuration) said that writing `provider` is a parse error. One value is not: the `provider: 'openai'` that a released 18.x toolchain wrote out into every agent `model` block it parsed is accepted and stripped (`acceptRetiredDefaultResidue`); every other value is refused at parse, and `tsc` refuses the key whatever its value. The skill now says the key is retired and refused, names that exception, and keeps the instruction: delete it. The `provider` jsdoc on `AIModelConfigSchema` in `packages/spec/src/ai/agent.zod.ts`, which used the same words, names the exception too. Comment only on the spec side: no schema, type or export changes. + +Three `objectstack-ai` eval cases are graded more fairly, with no change to what a correct answer must say: + +- Sampling settings (Anthropic, temperature 0.3, 2000 tokens): the forbidden written line is now a set of code spellings (single or double quotes, with or without a trailing comma, and the JSON form), not one. An inline prose warning such as `provider: 'anthropic'` in backticks still passes. +- Nightly approval script: the any-of group also accepts "refuses". +- `run_action` with `confirm: true`: "do not retry" moves into an any-of group with "Do not retry", "don't retry" and "Don't retry"; the grader matches case-sensitively, and correct answers used all four. diff --git a/packages/spec/src/ai/agent.zod.ts b/packages/spec/src/ai/agent.zod.ts index aa0c14e0fe3..022cd5005d9 100644 --- a/packages/spec/src/ai/agent.zod.ts +++ b/packages/spec/src/ai/agent.zod.ts @@ -82,7 +82,9 @@ export const AIModelConfigSchema = lazySchema(() => acceptRetiredDefaultResidue( * REMOVED (#37712, ADR-0049) — the provider is the deployment's choice, never * the agent's; see `MODEL_PROVIDER_RETIRED` above. A tombstone, not a bare * delete, so authoring it is a `tsc` error and a parse error that carries - * the prescription instead of an anonymous unrecognized-key refusal. + * the prescription instead of an anonymous unrecognized-key refusal. One + * value parses: the `'openai'` an 18.x toolchain wrote out is stripped + * (`MODEL_PROVIDER_RETIRED_KEY_RESIDUE` above); `tsc` refuses it all the same. */ provider: retiredKey(MODEL_PROVIDER_RETIRED), model: z.string().optional().describe( diff --git a/skills/objectstack-ai/SKILL.md b/skills/objectstack-ai/SKILL.md index 4156efb6919..cd707145fac 100644 --- a/skills/objectstack-ai/SKILL.md +++ b/skills/objectstack-ai/SKILL.md @@ -363,15 +363,16 @@ live, but listing-only: carried onto the tool, never sent to the model). ## Model Configuration Sampling lives under an agent's `model` (`AIModelConfigSchema`), **never a -top-level `temperature` / `maxTokens`** (`packages/spec/src/ai/agent.zod.ts:87-95`). -The block names a model, never a provider: the deployment's AI settings choose -the provider and resolve the model name among the providers turned on. -`provider` is retired (protocol 19): writing it is a parse error. Delete it. +top-level `temperature` / `maxTokens`** (`packages/spec/src/ai/agent.zod.ts:89-97`). +The block names a model: the deployment's AI settings choose the provider and +resolve the model name among the ones turned on. `provider` is retired +(protocol 19) and refused, except the `'openai'` an 18.x toolchain wrote out, +which parses and is stripped. Delete it. | Key | Contract | |:--|:--| -| `model` | Optional free-string model name; absent = the host's default model for the environment | -| `temperature` | `min(0).max(2)`, default `0.7`. **Outside 0–2 is a parse error** | +| `model` | Optional free-string name; absent = the host's default model | +| `temperature` | Default `0.7`. **Outside 0–2 is a parse error** | | `maxTokens` / `topP` | Optional, schema-unbounded numbers | --- diff --git a/skills/objectstack-ai/evals/skills-tools-knowledge.json b/skills/objectstack-ai/evals/skills-tools-knowledge.json index d8f53953fc2..890e58dc649 100644 --- a/skills/objectstack-ai/evals/skills-tools-knowledge.json +++ b/skills/objectstack-ai/evals/skills-tools-knowledge.json @@ -14,11 +14,21 @@ { "id": 2, "prompt": "Our copilot should use Anthropic with a low temperature (0.3) and cap responses at 2000 tokens. Where do these settings go in the metadata?", - "expected_output": "Places sampling under the agent's `model` block (`AIModelConfigSchema`): `temperature: 0.3` (0–2, outside is a parse error) and `maxTokens: 2000`, and states that there is no top-level `temperature` / `maxTokens` on an agent. Writes no provider key: `provider` is retired in protocol 19 and a parse error, because the deployment's AI settings choose the provider, not the agent. To run on an Anthropic model, names that model in the free-string `model` (the deployment resolves the name among the providers turned on) or omits it to run on the host's default model; turning Anthropic on is done in the deployment's AI settings, not in metadata.", + "expected_output": "Places sampling under the agent's `model` block (`AIModelConfigSchema`): `temperature: 0.3` (0–2, outside is a parse error) and `maxTokens: 2000`, and states that there is no top-level `temperature` / `maxTokens` on an agent. Writes no provider key: `provider` is retired in protocol 19 and refused, because the deployment's AI settings choose the provider, not the agent. To run on an Anthropic model, names that model in the free-string `model` (the deployment resolves the name among the providers turned on) or omits it to run on the host's default model; turning Anthropic on is done in the deployment's AI settings, not in metadata.", "files": [], "assertions": { "must_contain": ["temperature", "maxTokens", "deployment"], - "must_not_contain": ["provider: 'anthropic',"] + "must_not_contain": [ + "provider: 'anthropic',", + "provider: \"anthropic\",", + "provider: 'anthropic'\n", + "provider: \"anthropic\"\n", + "provider: 'anthropic' }", + "provider: \"anthropic\" }", + "provider: 'anthropic'}", + "provider: \"anthropic\"}", + "\"provider\": \"anthropic\"" + ] } }, { @@ -58,7 +68,7 @@ "expected_output": "Does not decide on the token: the script may list the queue (`client.ai.pendingActions.list({ status: 'pending' })`), but approving or rejecting an item is the person's own act, done in the app on their signed-in session by the person the assistant call ran as. An API key or token is refused on the decide door, even the person's own, and so is an AI identity; another user's `ai:approve` does not decide the item, and the model's own confirmation does not count. The script reports or notifies the stale items instead; where a second person must approve the write, that is the approvals engine's `held` outcome.", "files": [], "assertions": { - "must_contain_any": [["ai:approve", "signed-in session", "refused", "never decides"]], + "must_contain_any": [["ai:approve", "signed-in session", "refused", "refuses", "never decides"]], "must_not_contain": ["pendingActions.approve("] } }, @@ -68,7 +78,8 @@ "expected_output": "Stop sending `confirm`: `run_action` and `resume_run` refuse any call that carries the member, on every action, because the agent cannot confirm for the person. Call `run_action({ actionName: 'crm_close_deal', recordId })` without it. Where the host registers a pending-confirmation service, the answer is `status: 'pending_confirmation'` with a `pendingId` and a message: that is a success, not an error, and nothing has run. Relay the message, tell the user to approve it in the app, and do not retry. On a host with no such service (the open-source build ships none) the call is refused 428 `ACTION_CONFIRMATION_REQUIRED` with `details.reason: 'no_confirmation_service'`, and the person performs the action in the app. The two delete tools still take the member.", "files": [], "assertions": { - "must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service", "do not retry"], + "must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service"], + "must_contain_any": [["do not retry", "Do not retry", "don't retry", "Don't retry"]], "must_not_contain": ["recordId, confirm: true", "then retry with"] } },