Skip to content

Commit 3ffa92d

Browse files
docs(skills,spec): agent model.provider is refused, bar the 18.x openai residue; objectstack-ai eval cases 2, 6, 7 grade every correct spelling (#38156)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuFLwsbUXqRkpg67fCZfuCf3)_ Fixes #37850 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用 AI 技能写智能体的开发者会读到更准确的一句话:智能体模型里的「服务商」字段已退役、会被拒绝,唯一例外是旧版工具自动写进去的 openai 默认值,会被接受并自动删掉;做法不变,仍是删掉它。运行时行为不变。 - 为什么做:上一次去掉这个字段的改动在审核里留下的四个尾巴:说法不准一处、评测判分词太窄三处(另一处过期行号已被别的改动删掉)。 - 出错会怎样:只影响技能文字和评测读数,产品行为不变;判分若放得太松会把没学会的答案判对,本次用两轮旧录音重判,不带技能的答案一个也没有因此变对。可以直接撤回。 - 要你做什么:技能包是对外发布的受管文件,需要你批准合并。 ## What changes - `skills/objectstack-ai/SKILL.md` (Model Configuration): "`provider` is retired (protocol 19): writing it is a parse error" becomes "retired (protocol 19) and refused, except the `'openai'` an 18.x toolchain wrote out, which parses and is stripped. Delete it." The instruction is unchanged. The file sits at zero token headroom, so the clause is paid for by deletions in the same section: ", never a provider" (the next clause says the deployment chooses it), the `model` row's "for the environment" and "model " in "free-string model name", and the `temperature` row's "`min(0).max(2)`, " (the same cell says "Outside 0–2 is a parse error"). Ceiling unchanged. - `packages/spec/src/ai/agent.zod.ts`: the `provider` tombstone's jsdoc, which said the same words, names the one value that parses (`MODEL_PROVIDER_RETIRED_KEY_RESIDUE`) and that `tsc` refuses it all the same. Comment only. - `skills/objectstack-ai/evals/skills-tools-knowledge.json`: - case 2 (sampling settings): `expected_output` says "refused" instead of "a parse error"; `must_not_contain` goes from the one spelling `provider: 'anthropic',` to nine code spellings: single or double quotes, followed by a comma, a newline, ` }` or `}`, and the JSON form `"provider": "anthropic"`. The backtick-terminated inline warning (`` `provider: 'anthropic'` ``) still passes. - case 6 (nightly approval script): the `must_contain_any` group gains `refuses`. - case 7 (`run_action` with `confirm: true`): `do not retry` moves from `must_contain` into a `must_contain_any` group `["do not retry", "Do not retry", "don't retry", "Don't retry"]`. - `.changeset/37850-agent-model-provider-refused-residue.md`: `@objectstack/skills` patch, `@objectstack/spec` patch (jsdoc). ## Why The four boxes of #37850, each against `main` 581ae76: 1. **N1, the parse-error wording.** True for every value but one: `acceptRetiredDefaultResidue(…, { provider: 'openai' })` at `agent.zod.ts:71`/`:96` strips the 18.x default (pinned by `agent-model-provider-retirement.test.ts:91-95`). Fixed in the skill and the jsdoc. 2. **N2, case 2's single forbidden spelling.** Fixed as a set of spellings, not the bare key: a bare `provider:` fails correct answers that quote the retired spelling to warn (round-1 answers do exactly that). 3. **`SKILL.md:457` citing `agent.zod.ts:234, :251`.** Already gone on `main`: #37939 (62dd9e1) rewrote that passage and dropped the citation. Closed with that reason; nothing to change. 4. **Cases 6 and 7 missing their literal phrases.** Judged against the recorded answers of both #37796 rounds (round records kept by the seat): the **grading token** was wrong in both, the teaching is right. - Case 7: all six with-skill answers say "Don't retry" / "Do not retry" / "**don't retry**" next to the right handling of `pending_confirmation` and `no_confirmation_service`; the grader is a case-sensitive literal match (`grade.ts`), and `SKILL.md:212` teaches "do not retry". - Case 6: #37969 (dc45b1e) already moved it to an any-of group; one correct with-skill answer still failed it only because it wrote "refuses" ("ObjectStack refuses decisions made with API tokens"). ## Verification <details><summary>Re-grade of the recorded rounds under the new assertions (literal grader, script in the thread scratchpad)</summary> Round 2 (runner fb8b3f2, the clean round): | case | with-skill before → after | no-skill before → after | |:--|:--|:--| | 2 | 3/3 → 3/3 | 0/3 → 0/3 | | 6 | 1/3 → 3/3 | 0/3 → 0/3 | | 7 | 0/3 → 3/3 | 0/3 → 0/3 | Round 1 (789e0c7) with-skill: case 6 0/3 → 3/3, case 7 0/3 → 3/3. Round 1's no-skill arm read project memory (#37842), so its case 2 flips (graded then under an older assertion) are not evidence either way. `pnpm --filter @objectstack/scenarios skill-evals --regrade` on a copy of round 2 exits 0: the catalog loads; it sets cases 2/6/7 apart as changed since the round, as designed, so the table above is the literal-grader reading. </details> <details><summary>Local gates at c5dee31; at 72007e7 (S1, a line number only) and at 61188fd (main merged + the 5-byte cut) the token ratchet, check-nul-bytes, check:skill-links, check:skill-frame-sync, check:skill-identifier-liveness, check:skill-docs, check:skill-refs and check:empty-changeset re-run, exit 0</summary> All exit 0: `node scripts/check-skills-token-ratchet.mjs` (`skills/objectstack-ai/SKILL.md is 6893 tokens (ceiling 6893; headroom 0)`), `check-affected-docs`, `check-drift-comment`, `@objectstack/spec` `build` + `check:generated` (`All 14 generated artifacts are up to date`), `check:docs`, `check:skill-docs`, `check:skill-refs`, `check:liveness`, `check:llms-txt`, `check:doc-authoring`, `check:pm-skill-id-lint`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:skill-frame-freshness`, `check:skill-identifier-liveness`, `check:skill-links`, `check:spec-docblock-symbol-anchors`, `check:spec-parsed-alias`, `check:skill-top-level-keys`, `check-nul-bytes`, `check:empty-changeset`. The rest of the derived families are CI's. </details> Skills readings (lines), against `main` at the merge: `skills/objectstack-ai/SKILL.md` 488 → 489; bundle (all `skills/*/SKILL.md`) 4953 → 4954. Tokens: 6906 → 6906 of 6906 (before the merge: 6893 → 6893 of 6893). No eval round run (Sales paused rounds). Two-minute check: `node scripts/check-skills-token-ratchet.mjs | grep objectstack-ai/SKILL` prints ✓ at 6893. ## Acceptance notes - Read first: the SKILL.md hunk (the residue sentence and the three deletions paying for it), then case 2's spellings. - Case 2 still lets a code line with trailing spaces or a `//` comment after `provider: 'anthropic'` (no comma), or `provider:'anthropic'` with no space, slip past; closing those with literal substrings would start catching the inline prose warning. Left open. - Accepted nits from the contract review (not changed this round): case 2's two `}` spellings also fail a correct answer that warns inline with the braces (the retired key shown inside a backticked `model: { … }`), so "the inline warning still passes" holds for the bare-key form only, and a fenced counter-example still fails; case 7 still misses a typographic apostrophe, "never retry", or bold inside the phrase; case 6's any-of group is met by generic refusal wording and leans on its one forbidden call spelling (older than this PR). - `SKILL.md:365`'s cite moves `agent.zod.ts:87-95` → `:89-97`: the jsdoc hunk adds two lines above the `model` block's keys (review S1). ## Serial Open PR #38013 edits other hunks of the same two skill files (the knowledge-service sentence at `SKILL.md:244`, case 14); the text merges clean. It does not fit under the token ceiling, though: #38013 re-pins `skills/objectstack-ai/SKILL.md` to 6906 at its own measurement (27650 bytes), this PR adds 3 bytes (27596 → 27599), and the two merged are 27653 bytes, `ceil((27653 - 27) / 4)` = 6907, one over #38013's row. Whichever lands second goes red on the token ratchet and must cut 2 bytes or re-pin; merging `main` alone is not enough. **Resolved here:** #38013 landed first, and this PR's first merge-queue run went red on exactly that row (6907 / 6906). `main` is merged in (c725268) and 61188fd deletes a repeated noun inside this PR's own Model Configuration hunk ("among the providers turned on" → "among the ones turned on", 5 bytes; "the ones" refers back to "the provider" five words earlier). The file is 6906 / 6906 and no ceiling moves. The cut is sized to land on the row: the ratchet is red below its ceiling too, so a larger cut would have had to lower the row in the same commit. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (jsdoc only) - [x] 2. Every name I added uses the casing for its kind. (none added) - [x] 3. No formatter ran; `pnpm lint` passes. (left to CI) - [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. (`check:generated`: all up to date, nothing to commit) - [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. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUDWstaVZQkWbWFNBK --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUDWstaVZQkWbWFNBK)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUDWstaVZQkWbWFNBK --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 22e1089 commit 3ffa92d

4 files changed

Lines changed: 42 additions & 11 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
docs(skills,spec): an agent's retired `model.provider` is described as refused, naming the one 18.x value that still parses
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`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.
12+
13+
Three `objectstack-ai` eval cases are graded more fairly, with no change to what a correct answer must say:
14+
15+
- 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.
16+
- Nightly approval script: the any-of group also accepts "refuses".
17+
- `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.

‎packages/spec/src/ai/agent.zod.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ export const AIModelConfigSchema = lazySchema(() => acceptRetiredDefaultResidue(
8282
* REMOVED (#37712, ADR-0049) — the provider is the deployment's choice, never
8383
* the agent's; see `MODEL_PROVIDER_RETIRED` above. A tombstone, not a bare
8484
* delete, so authoring it is a `tsc` error and a parse error that carries
85-
* the prescription instead of an anonymous unrecognized-key refusal.
85+
* the prescription instead of an anonymous unrecognized-key refusal. One
86+
* value parses: the `'openai'` an 18.x toolchain wrote out is stripped
87+
* (`MODEL_PROVIDER_RETIRED_KEY_RESIDUE` above); `tsc` refuses it all the same.
8688
*/
8789
provider: retiredKey(MODEL_PROVIDER_RETIRED),
8890
model: z.string().optional().describe(

‎skills/objectstack-ai/SKILL.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,16 @@ live, but listing-only: carried onto the tool, never sent to the model).
363363
## Model Configuration
364364

365365
Sampling lives under an agent's `model` (`AIModelConfigSchema`), **never a
366-
top-level `temperature` / `maxTokens`** (`packages/spec/src/ai/agent.zod.ts:87-95`).
367-
The block names a model, never a provider: the deployment's AI settings choose
368-
the provider and resolve the model name among the providers turned on.
369-
`provider` is retired (protocol 19): writing it is a parse error. Delete it.
366+
top-level `temperature` / `maxTokens`** (`packages/spec/src/ai/agent.zod.ts:89-97`).
367+
The block names a model: the deployment's AI settings choose the provider and
368+
resolve the model name among the ones turned on. `provider` is retired
369+
(protocol 19) and refused, except the `'openai'` an 18.x toolchain wrote out,
370+
which parses and is stripped. Delete it.
370371

371372
| Key | Contract |
372373
|:--|:--|
373-
| `model` | Optional free-string model name; absent = the host's default model for the environment |
374-
| `temperature` | `min(0).max(2)`, default `0.7`. **Outside 0–2 is a parse error** |
374+
| `model` | Optional free-string name; absent = the host's default model |
375+
| `temperature` | Default `0.7`. **Outside 0–2 is a parse error** |
375376
| `maxTokens` / `topP` | Optional, schema-unbounded numbers |
376377

377378
---

‎skills/objectstack-ai/evals/skills-tools-knowledge.json‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,21 @@
1414
{
1515
"id": 2,
1616
"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?",
17-
"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.",
17+
"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.",
1818
"files": [],
1919
"assertions": {
2020
"must_contain": ["temperature", "maxTokens", "deployment"],
21-
"must_not_contain": ["provider: 'anthropic',"]
21+
"must_not_contain": [
22+
"provider: 'anthropic',",
23+
"provider: \"anthropic\",",
24+
"provider: 'anthropic'\n",
25+
"provider: \"anthropic\"\n",
26+
"provider: 'anthropic' }",
27+
"provider: \"anthropic\" }",
28+
"provider: 'anthropic'}",
29+
"provider: \"anthropic\"}",
30+
"\"provider\": \"anthropic\""
31+
]
2232
}
2333
},
2434
{
@@ -58,7 +68,7 @@
5868
"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.",
5969
"files": [],
6070
"assertions": {
61-
"must_contain_any": [["ai:approve", "signed-in session", "refused", "never decides"]],
71+
"must_contain_any": [["ai:approve", "signed-in session", "refused", "refuses", "never decides"]],
6272
"must_not_contain": ["pendingActions.approve("]
6373
}
6474
},
@@ -68,7 +78,8 @@
6878
"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.",
6979
"files": [],
7080
"assertions": {
71-
"must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service", "do not retry"],
81+
"must_contain": ["pending_confirmation", "pendingId", "no_confirmation_service"],
82+
"must_contain_any": [["do not retry", "Do not retry", "don't retry", "Don't retry"]],
7283
"must_not_contain": ["recordId, confirm: true", "then retry with"]
7384
}
7485
},

0 commit comments

Comments
 (0)