Skip to content

feat(spec): an agent's model name becomes optional — absent means the environment's default model - #37697

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-ygkjxt
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-ygkjxt

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Jack · project thread

Fixes #37686

Clause-②: yes (widening)
Metadata-protocol: semantic
Skills-docs: follow-up #37711

维护者速读

  • 写 agent 元数据的人和 AI:模型块里可以不写模型名,只写温度等参数;不写就用部署的默认模型,写了照旧。没写供应商时也不再自动当成 openai。
  • 属于「AI 模型档位」专题第一阶段,按你在决策卡上选的「框架允许省略 model」落地。
  • 只放宽不收紧,旧 agent 全部照常解析,运行时行为不变;出问题可直接撤回这个 PR。
  • 无。

What changes

  • packages/spec/src/ai/agent.zod.ts: AIModelConfigSchema.model goes from a required z.string() to z.string().optional(). Its description now says that an absent model name means the host's default model for the environment. The block stays strict (unknown keys refused); temperature still defaults to 0.7. No sentinel value, no tier key (phase 2 of objectstack-ai/cloud#5055).
  • Same file, contract review S1 (seat amendment of the order's step 4): provider loses .default('openai') and becomes .optional(); key and enum unchanged. A block that names no model no longer parses to provider: 'openai', which asserted a provider for a model the host picks. The default move is declared in DEFAULT_CHANGES_BY_MAJOR under 19 (packages/spec/scripts/lib/default-changes.ts) with its consumer-facing reason, and authorable-defaults/ai.json drops the line. No runtime reads an agent's model.provider, so no deployed agent changes behaviour. Not retired: enforce-or-remove for provider is spec: an agent's model.provider is declared but read by no runtime (enforce-or-remove) #37712.
  • packages/spec/src/ai/agent.test.ts: six new cases (temperature-only block parses with model undefined; an explicit name is carried as written; an unknown key is still refused as unrecognized_keys; a non-string name is still refused; a whole agent with model: { temperature: 0.2 } parses; a block with no provider parses without one, a written one is carried, an off-enum one is refused), and the minimal-config case now expects no provider.
  • ui/packages/app-shell/src/views/metadata-admin/previews/AgentPreview.tsx (contract review S2, file surface widened by the seat): the model pill showed only when model.provider was set, so a block naming a model and no provider lost the model name once the default was gone. It now shows when a model or a provider is written and reads PROVIDER · MODEL, MODEL or PROVIDER; a block that names neither shows no pill, so the environment default is not given a name. Two new cases in AgentPreview.test.tsx.
  • Generated: content/docs/references/ai/agent.mdx (gen:docs) and packages/spec/authorable-defaults/ai.json (written by the build). authorable-surface, api-surface, the JSON-schema manifest and the metadata-form translations needed no change: the key set is unchanged, and the translations carry only the model.model label.
  • .changeset/37686-agent-model-name-optional.md: @objectstack/spec minor and @object-ui/app-shell patch, with the three declaration lines; semantic because a default moved (it outranks added).

Read first (by risk): packages/spec/src/ai/agent.zod.ts (the two contract hunks), packages/spec/scripts/lib/default-changes.ts (the declared default move), then the changeset.

Tests

All at head b3238ea8, run through scripts/pm/os-verify-lock.sh on a shared container. The spec readings were taken at db5f0e7d; the only later commit touches ui/ and the changeset prose.

  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ai/agent.test.ts → Test Files 1 passed, Tests 70 passed.
  • pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/previews/AgentPreview.test.tsx packages/app-shell/src/views/metadata-admin/previews/AgentPreview.emptyCollection-8520.test.tsx → Test Files 2 passed, Tests 24 passed.
  • Ablations (each fix committed first, the mutation made on disk, then restored from HEAD): without model's .optional(), Tests 2 failed / 67 passed; with provider's .default('openai') restored, Tests 3 failed / 67 passed; with the preview pill keyed on provider again, Tests 1 failed / 17 passed (the name-only case). The other new cases pin behaviour that holds either way.
  • pnpm --filter @objectstack/spec test → Test Files 903 passed (903), Tests 28557 passed, 1 todo.
  • pnpm --filter @objectstack/spec typecheck → exit 0 (includes check:test-typecheck, 52 files held in the ledger, unchanged).
  • pnpm --filter @objectstack/spec build && pnpm --filter @objectstack/spec check:generated → exit 0 after gen:docs; the build's default ratchet accepts the declared ai/AIModelConfig:provider move.
  • @object-ui/app-shell has no typecheck script; its types are Type Check UI's, read from this PR's check-runs.
Local gate families: 117 derived, 117 run, all exit 0

node scripts/pm/dispatch-gates.mjs --commands derived 117 families for this change set at b3238ea8 (the three new ones read ui/: check-sdui-manifest and its self-test, and vitest run scripts/ under ui/); each was run and its exit code captured before any pipe, all 0. --ran reconciliation: "117 derived famil(ies) accounted for — 117 run, 0 NOT-MEASURED (a DERIVED zero — all 117 recorded an exit code and none of them is 3)". Families outside the derivation (repo-wide lint, UI lanes, Test Core's repo project) are CI's.

Acceptance notes

  • Premise re-checked on origin/main 6d106a1: the card's Re-check: grep answers 1 hit at agent.zod.ts:38.
  • Readers of an agent's model.model in this repo: packages/spec/src/system/metadata-list-registry.ts (list column; valueAtPath answers undefined, so the cell is empty for an agent with no model, which is the card's "empty/default" outcome); AgentPreview.tsx (its model pill, reworked here for S2, renders only what is written); tests only otherwise. None breaks on undefined. In cloud (read-only, origin/main 63427ae), packages/service-ai/src/agent-runtime.ts:1028 assigns options.model = agent.model.model, so an absent name leaves options.model undefined there; how cloud resolves that to its default is the cloud card's (objectstack-ai/cloud#5055) after a pin move.
  • provider: declared, not enforced. No runtime in this repo reads an agent's model.provider, and in cloud origin/main 63427ae agent-runtime.ts reads only model, temperature and maxTokens from the agent's block (the model.provider read in vercel-adapter.ts:391 is the AI SDK model object, not the agent config). Its default is dropped here (S1); keep-or-retire is spec: an agent's model.provider is declared but read by no runtime (enforce-or-remove) #37712.
  • Display (S2): the preview reads the raw draft, so a draft that wrote a model and no provider showed no pill even before this PR; the S2 fix shows its name either way. A parsed or stored block no longer carries an invented openai.
  • Skills docs: skills/objectstack-ai/SKILL.md "Model Configuration" still teaches model as a required free string with provider default openai, and cites agent.zod.ts:36-40; the skills-tools-knowledge eval expects "a free-string model". Follow-up skills: teach that an agent's model name is optional (follow-up of #37697) #37711.
  • Overlap: feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676 also opens a 19 bucket in default-changes.ts (and touches authorable-defaults/ai.json); main merges cleanly here, the two PRs conflict textually there, and whichever lands second keeps both entries.

Verification

Two-minute check: pnpm --filter @objectstack/spec exec vitest run src/ai/agent.test.ts → 70 passed; revert the model .optional() and two of the new cases go red; restore the provider default and three go red.


Generated by Claude Code

@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation protocol:ai tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 2 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/spec/authorable-defaults/ai.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/agents.mdx (via azure_openai (literal, a string literal in AIModelConfigSchema))
  • content/docs/ai/index.mdx (via azure_openai (literal, a string literal in AIModelConfigSchema))
What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/authorable-defaults/ai.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 579b85776d1abb6722df870eb2a652231ee4047e → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8e35a80aa656d584f7a0fe00e097d769a3b363b4 — the merge of head 2241d53bae9e432bf558f61d241a77255e154618 into base 579b85776d1abb6722df870eb2a652231ee4047e, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8e35a80aa656d584f7a0fe00e097d769a3b363b4 && git checkout 8e35a80aa656d584f7a0fe00e097d769a3b363b4
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 579b85776d1abb6722df870eb2a652231ee4047e 2241d53bae9e432bf558f61d241a77255e154618 && git checkout -B drift-repro 579b85776d1abb6722df870eb2a652231ee4047e && git merge --no-ff 2241d53bae9e432bf558f61d241a77255e154618

node scripts/docs-audit/affected-docs.mjs --json 579b85776d1abb6722df870eb2a652231ee4047e

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 579b85776d1abb6722df870eb2a652231ee4047e → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5055#1 · hotlong · session_01Q4EjjMmczBEaeiAQ48oDtz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d36940ae4ba86aac90b8223334d50290e21a1dbd
Local-runs: none
Scope: packages/spec/src/ai/agent.zod.ts + none
Security-touching: no
Rule-change-verified: none

Read: card #37686 (body, 3 comments), PR #37697 (body, 4 files, net diff against main, merge-base 6d106a1a), the 74 check-runs on this head. The rest of the diff (agent.test.ts, the regenerated content/docs/references/ai/agent.mdx, the changeset) is the lane seat's ACCEPT at TIER_DEFAULT; no file in the diff implements or enforces the hits file beyond those.

Gates, read off the head's check-runs (latest completed run per name): 0 failure. Check Changeset has two runs, failure at 21:07:54Z (pre-edit PR body) and success at 21:08:15Z; the later one counts. Spec property liveness, Governed Surface Queue Guard, the Lint and Type Check families (including Type Check · consumer gates), Test Core 1-10 and Test UI 1-16 are success; the skipped runs are opt-in or queue-only jobs.

① Derived judgments

  • Accept-set of AIModelConfigSchema: a block with no model key now parses ({}, { temperature: 0.2 }). Right: this is the ruling (「框架允许省略 model」) and the card's first acceptance line.
  • Everything accepted before is still accepted, with the same parsed value: model stays z.string() inside the optional, so { model: 'x' } is carried as written. Right.
  • Still refused: a non-string model (4, null; the field is optional, not nullable), and any unknown key (the block is still strictObject). Right: no accept-set growth beyond the one the ruling names.
  • No sentinel value and no tier key added. Right (card step 3).
  • Parsed output of a model-less block: model is undefined, provider is still defaulted to 'openai', temperature to 0.7. The model part is right; the provider default on a block that names no model is S1 below.
  • AgentSchema.model (the block itself) is unchanged: still AIModelConfigSchema.optional(). Right.
  • Public TypeScript surface: Agent (z.input) and AgentParsed (z.infer) both move model.model from string to string | undefined (input: the key becomes optional). There is no exported AIModelConfig type (docs-import-surface.baseline.json: "no type export"), so the change reaches consumers through Agent/AgentParsed and z.infer of AIModelConfigSchema alone. This is source-affecting for a TypeScript reader that assigns agent.model.model to a string; it is the unavoidable consequence of the ruling, the changeset's "What to do" paragraph states it, and Type Check · consumer gates and Type Check · workspace are green on this head. Right.
  • Generated surface: the key set is unchanged, so authorable-surface, authorable-defaults, api-surface, the JSON-schema manifest and the metadata-form translations (which carry only the model.model label) owe no change; the one stale artefact, agent.mdx, is regenerated and now reads optional / model?: string. Right, and the generated-artefact gates are green.
  • List column model.model (metadata-list-registry.ts:203, outside the diff): answers undefined, an empty cell, for an agent with no model name. Right against the card's "empty/default" wording.

② Semver level

@objectstack/spec: minor. The diff relaxes a requirement an author had to meet, which is a newly accepted value: Metadata-protocol: added, and that kind takes at least minor on the package the diff moves (AGENTS.md, changeset rule). The level matches what the diff publishes.

Clause-②: yes (widening) — present line-initial in both the PR body and the changeset body, and it is the correct arm: nothing accepted before is refused now. The claim comment on the card still reads Clause-②: no; the dev report records the correction as a deviation and the later Check Changeset run accepts the corrected pair. No BREAKING banner or ADR-0087 disposition is owed for a widening.

③ Boundary flags

  • PR author login: objectstack-fleet[bot]. Nothing to note.
  • Dev flag, model.provider declared but not enforced: confirmed by reading. In this repo no runtime reads an agent's model.provider (only AgentPreview.tsx:156 displays it); in cloud origin/main 585b04a, agent-runtime.ts:1027-1030 reads model, temperature and maxTokens from the block and nothing else. The card (step 4) says note it, do not remove it here; the dev did exactly that. ESCALATED to the seat, carrier objectstack-ai/cloud#5055: it is an ADR-0049 enforce-or-remove candidate, and S1 below is a reason to settle it before phase 2 rather than after.
  • Dev flag, Skills-docs follow-up owed: confirmed. skills/objectstack-ai/SKILL.md:365 cites packages/spec/src/ai/agent.zod.ts:36-40 (the field now sits at 38-42) and teaches model as a required free string; skills/objectstack-ai/evals/skills-tools-knowledge.json:17 expects "a free-string model". skills/** is outside this card's fence, so follow-up owed is the right value and the PR-body guards accept it. ESCALATED to the seat: the follow-up card is owed on a domain:skills path, and until it lands the skill teaches authors and AI to invent a model name, the exact behaviour the ruling removes.
  • Dev deviation, no reviewer requested and the relay trailer on the PR body: process notes, no contract effect.
  • Open questions: the dev report carries none.
  • SQL push-down: not applicable. The diff contains no query, no id materialisation and no in-app join.
  • Security: no changed hunk teaches permission, credential, token or authentication behaviour.

④ Design judgment

packages/spec/src/ai/agent.zod.ts, against the ruling (agent model.model optional; absent = environment default model) and its first consumer.

Attempts to break it:

  • Strictness. The block is still built by strictObject; { temperature: 0.2, tier: 'fast' } is refused as unrecognized_keys. Making model optional does not open a silent-strip path.
  • Aliases. modelName, llm, deployment, engine → model are suggestion hints for the unknown-key error, not input mappings. Before this change { llm: 'gpt-4o' } failed twice (missing model, unknown llm); now it fails once, on llm, with the "did you mean model" prescription. The dangerous outcome, a misspelled model key silently parsing as "use the default", cannot happen while the block is strict. Holds.
  • Defaults. No default was added for model, so absent stays absent through parse; a default would have been a sentinel by another name. Holds.
  • Null and wrong types. .optional() and not .nullish(): model: null and model: 4 are refused. Holds.
  • Description and form generation. The description is on the optional wrapper and reaches the generated reference table; the key set is unchanged, so form and translation generation are unaffected.
  • First consumer, cloud origin/main 585b04a, packages/service-ai/src/agent-runtime.ts:1027-1030: options.model = agent.model.model assigns into AIRequestOptions.model?: string; cloud does not set exactOptionalPropertyTypes, so the assignment type-checks with string | undefined. At runtime an absent name leaves options.model undefined; agent-routes.ts:1098-1099 then writes the chosen or default model id over it, and selectRequestModelId (vercel-adapter.ts:505) maps an undefined or blank want to the boot default. So "absent = environment default" already holds end to end at the consumer, and cloud card objectstack-ai/cloud#5059 (user pick, then agent model.model, then default) can read undefined as "the agent declares none" with no further spec change. Holds.
  • Other readers that assume a string: AgentPreview.tsx:156 already guards model.model ?; metadata-list-registry.ts:203 goes through valueAtPath. Neither breaks.

Findings:

S1 (should-fix) — not blocking, follow-up: provider still defaults to 'openai' on a block that names no model. { temperature: 0.2 } parses to { provider: 'openai', temperature: 0.2 }, so the parsed agent asserts a provider for a model the host picks, and AgentPreview.tsx:156 (model.provider && ...) shows an openai pill for an agent that runs on the environment default, whatever provider that is. The statement was already unenforced for a name-only block; this widening adds the case where it is wrong by construction. Fixing it means changing or removing a default (Metadata-protocol: semantic or a retirement), which the card forbids here (step 4). It belongs with the provider enforce-or-remove escalation in ③, carrier objectstack-ai/cloud#5055.

N1 (nit) — model: '' is still accepted and is now a second spelling of "no model" at the spec level. The first consumer already treats blank as the default (selectRequestModelId trims and falls through), so nothing misbehaves; cloud#5059 should compare on truthiness, not on !== undefined.

No must-fix.

Implemented-by: claude/project-thread-ygkjxt
Reviewed-by: session_01Q4EjjMmczBEaeiAQ48oDtz

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5055#1 · hotlong · session_01Q4EjjMmczBEaeiAQ48oDtz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: db5f0e7de958b70b1e0102ba62b9077c8912d5a4
Local-runs: none
Scope: packages/spec/src/ai/agent.zod.ts + packages/spec/scripts/lib/default-changes.ts, packages/spec/authorable-defaults/ai.json
Security-touching: no
Rule-change-verified: none

Delta review: this record supersedes the one on d36940ae4ba86aac90b8223334d50290e21a1dbd and covers the whole net diff against main (merge-base 6d106a1a, 6 files), with the delta since that head read hunk by hunk. Read: card #37686 (body, 3 comments, none new since the first record), PR #37697 (body, files, net diff), the 74 check-runs on this head. The rest of the diff (agent.test.ts, the regenerated content/docs/references/ai/agent.mdx, the changeset) is the lane seat's ACCEPT at TIER_DEFAULT.

Gates, read off this head's check-runs (latest completed run per name): 62 success, 12 skipped, 0 failure. Check Changeset has two runs (22:31:26Z and 23:01:08Z), both success. Lint · repo & tooling gates, Lint & Repo Gates, Spec property liveness, Governed Surface Queue Guard, the Type Check family (including Type Check · consumer gates), Test Core and Test UI are success; the skipped runs are opt-in or queue-only jobs.

① Derived judgments

Carried from the first record and re-read on this head, unchanged and still right: a block with no model key parses; an explicit name is carried as written; a non-string or null name and any unknown key are refused; no sentinel, no tier key, no default for model; AgentSchema.model itself is unchanged; Agent and AgentParsed carry model.model as string | undefined; the list column answers an empty cell.

New in the delta:

  • provider goes from z.enum([...]).default('openai') to z.enum([...]).optional(). Accept-set unchanged: the same four values are accepted, an off-enum value ('google') and null are refused, an absent key was and is accepted. Right.
  • Parsed value: a block that writes no provider now parses with no provider key at all (not 'openai'). This is a default removed from an existing authorable key, which changes what already-written metadata parses to. Right as the fix for S1, and right only because it is declared: see the next two lines.
  • packages/spec/scripts/lib/default-changes.ts: a 19 bucket with one entry, ai/AIModelConfig:provider, from: '"openai"', to: '(none)'. from equals the baseline line removed from authorable-defaults/ai.json; the bucket is the build's own major (packages/spec/package.json is 19.0.0-next.0; main has buckets 17 and 18 only); the reason says what a consumer relying on the old value reads now and what to write to keep it. The gate that re-derives from/to (check:authorable-surface) is green in CI. Right.
  • packages/spec/authorable-defaults/ai.json: the one line ai/AIModelConfig:provider = "openai" is dropped, nothing else moves; temperature = 0.7 stays. Agrees with the schema. Right.
  • Public TypeScript surface: AgentParsed['model']['provider'] (and z.infer of AIModelConfigSchema) goes from the enum to the enum or undefined; the input type Agent is unchanged for provider (it was already optional on input). Source-affecting for a reader of the parsed type that assumed a value; the changeset and the bucket reason both say so, and Type Check · consumer gates and Type Check · workspace are green. Right.
  • Key set unchanged, so authorable-surface, api-surface, the JSON-schema manifest and the form translations owe nothing; agent.mdx now shows provider as plain optional in both tables. Right.
  • No migration-registry semantic entry was added for the default move. Right: the table's own header asks for one when the change warrants a migration TODO, and with no runtime reading model.provider there is nothing for an author to migrate.

② Semver level

@objectstack/spec: minor. The diff now carries two protocol kinds: a relaxed requirement (added) and a moved default (semantic); AGENTS.md ranks semantic over added, and either kind takes at least minor on the package the diff moves. Metadata-protocol: semantic is the correct line and the level matches what the diff publishes.

Clause-②: yes (widening) — line-initial in both the PR body and the changeset body, and still the correct arm: no value accepted before is refused now, for either key. The default move is a semantic change to the parsed value, declared in DEFAULT_CHANGES_BY_MAJOR and described in the changeset with the one-line way to keep the old value (provider: 'openai'); it does not narrow the accept-set, so no (narrowing) arm and no BREAKING banner is owed.

③ Boundary flags

  • PR author login: objectstack-fleet[bot]. Nothing to note.
  • Dev flag, model.provider declared but not enforced: now carried by spec: an agent's model.provider is declared but read by no runtime (enforce-or-remove) #37712 (open, enforce-or-remove). Re-read on this head and on cloud origin/main 585b04a: still no runtime reader of an agent's model.provider in either repo (vercel-adapter.ts:391 reads the AI SDK model object, not the agent block). Answered.
  • Dev flag, Skills docs: now Skills-docs: follow-up #37711 (open). The follow-up owes one more line than when it was filed: skills/objectstack-ai/SKILL.md also teaches provider default openai, which this head removes. ESCALATED to the seat: make sure skills: teach that an agent's model name is optional (follow-up of #37697) #37711's scope names the dropped default, not only the optional model name.
  • Seat amendment of the card's step 4 ("do not remove it here"): the key and its enum are not removed, only the default; the PR body names the amendment. Consistent with the card's fence (packages/spec/** plus generated files).
  • Dev note, overlap with feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676 (also opens a 19 bucket and touches authorable-defaults/ai.json): a textual conflict for whichever lands second, no contract effect; the queue's business.
  • Dev note, display consequence in AgentPreview.tsx: confirmed, graded S2 below.
  • Cloud built-ins: ask-agent.ts:115 and metadata-assistant-agent.ts:78 write provider: 'openai' explicitly, so they parse identically until cloud#5059 removes the lines.
  • Open questions: none carried by the dev report.
  • SQL push-down: not applicable. No query, no id materialisation, no in-app join in the diff.
  • Security: no changed hunk teaches permission, credential, token or authentication behaviour.

④ Design judgment

packages/spec/src/ai/agent.zod.ts, against the ruling (agent model.model optional; absent = environment default model) and its first consumer; default-changes.ts and authorable-defaults/ai.json for agreement with it.

  • S1: closed — provider no longer defaults. { temperature: 0.2 } parses to a block with no provider key (the new test asserts 'provider' in result is false), so the parsed agent no longer asserts a provider for a model the host picks, and AgentPreview.tsx:156 shows no openai pill for it. The fix is the smallest one that removes the false statement: key and enum kept, retirement left to spec: an agent's model.provider is declared but read by no runtime (enforce-or-remove) #37712.

Attempts to break the delta:

  • A hidden reader that relied on the default. Searched both repos for readers of an agent's model.provider: only AgentPreview.tsx:156 (display). Cloud agent-runtime.ts:1027-1030 reads model, temperature, maxTokens. Nothing branches on the value, so no deployed agent changes behaviour.
  • The default ratchet bypassed rather than satisfied. The entry's from matches the baseline, to is (none) and the baseline line is gone; the bucket is the current major. An entry that did not match would fail check:authorable-surface, which is green.
  • A provider-only block. { provider: 'anthropic' } parses and means "anthropic, model unnamed": a statement nothing enforces, but one the author wrote, which is spec: an agent's model.provider is declared but read by no runtime (enforce-or-remove) #37712's subject, not a defect of this change.
  • Strictness, aliases, null handling, form generation: unchanged from the first record and still hold.
  • First consumer and cloud#5059: unaffected by the delta; options.model handling is as judged before, and cloud#5059's removal of the built-ins' provider/model lines now yields a block with neither, which is what that card wants.
  • default-changes.ts and authorable-defaults/ai.json agree with the schema line for line.

Findings:

S2 (should-fix) — not blocking, follow-up outside this card's fence: ui/packages/app-shell/src/views/metadata-admin/previews/AgentPreview.tsx:156 gates the whole model pill on model.provider. With the default gone, an agent that writes a model name and no provider (model: { model: 'gpt-4o' }) loses its pill entirely, so the preview no longer shows the model NAME, where it showed openai · gpt-4o. The invented provider is rightly gone; the name going with it is a display regression this change causes in a file it may not touch (ui/**). #37712 names the preview but not this consequence. ESCALATED to the seat: add the line to #37712 or file a ui card so the pill keys on model.model (or shows "default model") rather than on provider.

N1 (nit) — carried, unchanged: model: '' is still accepted and is a second spelling of "no model"; the first consumer treats blank as the default. For cloud#5059: compare on truthiness.

N2 (nit) — the PR body's two-minute check still says 69 passed where its Tests section, and the tree, say 70. Body wording only.

No must-fix.

Implemented-by: claude/project-thread-ygkjxt
Reviewed-by: session_01Q4EjjMmczBEaeiAQ48oDtz

VERDICT: PASS

… names no provider

Claude-Session: https://claude.ai/code/session_01Q4EjjQgJ62YaG4EAxNLuqP
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m and removed size/s labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5055#1 · hotlong · session_01Q4EjjMmczBEaeiAQ48oDtz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b3238ea812f4d8e6bb609f5533cc40d801045a9f
Local-runs: none
Scope: packages/spec/src/ai/agent.zod.ts + packages/spec/scripts/lib/default-changes.ts, packages/spec/authorable-defaults/ai.json, ui/packages/app-shell/src/views/metadata-admin/previews/AgentPreview.tsx
Security-touching: no
Rule-change-verified: none

Second delta review: this record supersedes the ones on d36940ae4ba86aac90b8223334d50290e21a1dbd and db5f0e7de958b70b1e0102ba62b9077c8912d5a4 and covers the whole net diff against main (merge-base 6d106a1a, 8 files), with the delta since db5f0e7d read hunk by hunk. Read: card #37686 (body, 3 comments, none new), PR #37697 (body, files, net diff), the 74 check-runs on this head. AgentPreview.tsx is named in scope as the in-diff consumer of the two schema changes. The rest of the diff (agent.test.ts, AgentPreview.test.tsx, the regenerated content/docs/references/ai/agent.mdx, the changeset) is the lane seat's ACCEPT at TIER_DEFAULT.

Gates, read off this head's check-runs (latest completed run per name): 63 success, 11 skipped, 0 failure. Check Changeset has two runs (23:11:05Z and 23:37:09Z), both success. Lint UI, Type Check UI, Test UI, Build & E2E UI, Governed Surface Queue Guard, the Lint and Type Check families and Test Core are success; the skipped runs are opt-in or queue-only jobs.

① Derived judgments

Carried from the two earlier records, re-read on this head, unchanged and still right:

  • A block with no model key parses; an explicit name is carried as written; a non-string or null name and any unknown key are refused; no sentinel, no tier key, no default for model.
  • provider is z.enum([...]).optional() with no default: same four values accepted, off-enum and null refused, and a block that writes none parses with no provider key.
  • The default move is declared in default-changes.ts under 19 (from: '"openai"', to: '(none)'; the package is at 19.0.0-next.0) and authorable-defaults/ai.json drops exactly that line.
  • Agent and AgentParsed carry model.model as string | undefined; AgentParsed['model']['provider'] is the enum or undefined.
  • Key set unchanged, so the surface, api-surface, manifest and translation artefacts owe nothing.

New in this delta:

  • AgentPreview.tsx: the model pill renders when model.provider or model.model is set (was: provider alone), and its label is [provider, model].filter(Boolean).join(' · '). The four cases: both written reads openai · gpt-4o, byte-identical to before; name only reads gpt-4o; provider only reads anthropic, as before; neither shows no pill. Right: the preview now states exactly what the author wrote and gives the environment default no name.
  • An empty string in either key is falsy on both the condition and the filter, so model: '' shows no pill and no stray separator. Right, and consistent with the first consumer treating a blank name as the default.
  • No new i18n key, no new prop, no change to the preview's public signature; the local ModelConfig interface already declared both keys optional. Right.
  • No spec file moved in this delta (agent.zod.ts, default-changes.ts, authorable-defaults/ai.json are identical to db5f0e7d). Right.

② Semver level

@objectstack/spec: minor and, new on this head, @object-ui/app-shell: patch.

  • Spec: unchanged from the previous record. Two protocol kinds (a relaxed requirement, added; a moved default, semantic); semantic outranks added and takes at least minor. Matches.
  • App-shell: the diff moves the package (a display fix, no protocol change to it), and a non-protocol change ships patch. Matches. The package is private, and carrying it in a changeset is the repo's standing practice (273 changesets on main do).

Clause-②: yes (widening) — line-initial in both the PR body and the changeset body; still the correct arm, since no value accepted before is refused now. Metadata-protocol: semantic and Skills-docs: follow-up #37711 are unchanged and consistent between the two.

③ Boundary flags

④ Design judgment

packages/spec/src/ai/agent.zod.ts against the ruling (agent model.model optional; absent = environment default model) and its first consumer: unchanged since db5f0e7d, and the judgment of the two earlier records stands (strict block, aliases are hints only, no default on either key, cloud agent-runtime.ts:1027-1030 and the route's default resolution hold with an absent name). default-changes.ts and authorable-defaults/ai.json agree with it line for line.

AgentPreview.tsx, for agreement with the contract:

  • S1: closed — on db5f0e7d, and still closed here: no provider default, so no invented openai anywhere in the parsed value or the preview.
  • S2: closed — the pill keys on provider || model, so model: { model: 'gpt-4o' } shows gpt-4o again, without a provider it never wrote. A block with neither shows nothing, which is the honest rendering of "environment default" until there is a name to show. The label for a block that writes both is unchanged.
  • N2: closed — the PR body's two-minute check now reads 70 passed, matching its Tests section.

Attempts to break the delta:

  • A separator with nothing beside it: filter(Boolean) runs before the join, so provider alone or model alone yields no ·.
  • A non-string value reaching the label: the preview renders a draft that may be mid-edit and unparsed; a truthy non-string would be coerced by join, as the old template literal coerced it. No new failure mode.
  • A regression for existing agents: the both-written case renders the same string; the provider-only case renders the same string.
  • The schema and the preview disagreeing on what "absent" means: both treat an unwritten name as nothing to show, and neither substitutes a value.

Findings:

N1 (nit) — carried, unchanged: model: '' is accepted by the schema and is a second spelling of "no model"; the first consumer and now the preview both treat blank as absent. For cloud#5059: compare on truthiness.

N3 (nit) — the PR body's acceptance note still describes AgentPreview.tsx:156 as "already guards model.model ?", which is the line this head rewrote. Body wording only; the tree is right.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-ygkjxt
Reviewed-by: session_01Q4EjjMmczBEaeiAQ48oDtz

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5055#1 · hotlong · session_01Q4EjjMmczBEaeiAQ48oDtz

维护者速读

  • 是什么:agent 元数据的模型块可以不写模型名,不写就用部署的默认模型(按你在决策卡上选的「框架允许省略 model」)。同时去掉了 provider 默认填 openai 的行为,元数据预览不再给没写供应商的 agent 显示一个假的 openai 标签。
  • 影响:只放宽、不拒收任何以前合法的写法;provider 本来就没有运行时读取。
  • 要你做什么:无。普通队列落地(非受管面,契约审核三轮后通过)。

Seat opinion: land.

席位核对

Seat L1 verdict: ACCEPT · head b3238ea812f4 · 2026-11-26T23:42Z · Fixes #37686.

  1. Shape: draft PR to main, Fixes #37686, no other closing keyword. 8 files (+104/−10): packages/spec/src/ai/agent.zod.ts (model and provider optional, no defaults), agent.test.ts, packages/spec/scripts/lib/default-changes.ts (19: bucket entry for the moved provider default), authorable-defaults/ai.json, regenerated content/docs/references/ai/agent.mdx, ui/packages/app-shell/.../AgentPreview.tsx + test, one changeset (@objectstack/spec minor, @object-ui/app-shell patch; Clause-②: yes (widening), Metadata-protocol: semantic, Skills-docs: follow-up #37711). The ui/ file is outside the order's surface by the seat's own widening for contract finding S2 (a regression this PR introduced); the claim's Clause-②: no / Metadata-protocol: added are superseded by the PR's lines.
  2. Premise measured: AIModelConfigSchema.model was a required string on base; no objectstack runtime reads model.model unsafely or model.provider at all; the first consumer (cloud agent-runtime.ts) type-checks with string | undefined.
  3. Gates: latest check-run per name on b3238ea8: 59 success, 11 skipped, 0 failure. check-governed-merges: NOT governed (0 of 8 paths), 114 changed lines.
  4. Accepted deviations: provider default dropped (contract finding S1, seat amended step 4); preview fix (S2). Ablations reported by the dev for both.
  5. Out of scope / follow-ups: skills docs skills: teach that an agent's model name is optional (follow-up of #37697) #37711 (now also covers the dropped provider default); provider enforce-or-remove finding spec: an agent's model.provider is declared but read by no runtime (enforce-or-remove) #37712; N1 (model: '' still accepted) carried to objectstack-ai/cloud#5059's order; N3 is PR-body wording only. Overlap with feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676 on default-changes.ts 19: bucket and authorable-defaults/ai.json: textual only, second to land keeps both entries.
  6. Landing: contract review at CONTRACT_REVIEW_TIER PASS on this head with no open must-fix/should-fix: comment 7205770891 (rounds: 7204641048, 7205247161). Ready + auto-merge via the queue.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 23:43
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 45912640840 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (6/10) — 失败步骤: Run this shard's tests

    @objectstack/cli:test:  FAIL   integration  src/commands/migrate/plan.boot-parity.integration.test.ts > os migrate plan examines exactly what os serve registers, per app shape (#22506) > a host config
      ↳ 失败原因: @objectstack/cli:test: AssertionError: expected [ { table: 'sys_activity', …(2) } ] to deeply equal []
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/commands/migrate/plan.boot-parity.integration.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 17 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5055#1 · hotlong · session_01Q4EjjQgJ62YaG4EAxNLuqP

Merge-queue red on this PR (run 45912640840) does not reproduce and does not touch this diff. Read at 2026-11-27T00:14Z.

  • What failed: Test Core shard 6/10, packages/cli/src/commands/migrate/plan.boot-parity.integration.test.ts › "a host config — instances in plugins beside its own metadata, the showcase's shape": os migrate plan --json reported create_table sys_activity against the database that serve's provision-and-exit boot had just left, so plan.changes was not []. In that run, the boot did not create sys_activity.
  • Why it isn't this PR: the diff touches packages/spec/src/ai/agent.zod.ts (the agent model block), its test, default-changes.ts, authorable-defaults/ai.json, the generated agent reference page, AgentPreview.tsx and a changeset. It touches nothing in the CLI, the serve or migrate composition, plugin-audit or SQL. The PR queued just ahead of it (feat(studio): a dataset is a data type; datasets and positions are always listed in the menu #37599, studio menu and metadata-plugin spec) doesn't touch those paths either.
  • Reproduction: the same test passed locally at this head b3238ea8 (3/3), and again with origin/main 80519b5 merged in (3/3). Both runs went through scripts/pm/os-verify-lock.sh on a shared container. The merge commit was not pushed. The next queue group (fix(app-shell): the draft bar publishes the reloaded draft after a conflict "reload" (#37648) #37715, CI run 45912764603) went green on the same CI.

Reading: a one-off failure in the boot-parity test, not a defect in this change. Re-arming is the seat's call. Nothing here needs a code change.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5055#1 · hotlong · session_01Q4EjjMmczBEaeiAQ48oDtz

Queue kick of PR #37697 — signature, reading and disposition. 2026-11-27T00:16Z

  • Signature (new, not in the flake ledger): merge-group CI run 45912640840 (queue commit 319c54b8, base 579b8577), Test Core (6/10), packages/cli/src/commands/migrate/plan.boot-parity.integration.test.ts › "a host config …": os migrate plan --json reported create_table sys_activity after serve's provision-and-exit boot. First error is an assertion, not a timeout.
  • Reading: flake, not this diff. The diff touches no CLI, serve/migrate composition, plugin-audit or SQL code; the test passes locally at b3238ea8 (3/3, card thread triage comment 7206293430); and the next queue group, built ON 319c54b8 (so with this PR's change in it), passed the same shard: run 45912764603, job 140225479776.
  • Disposition: the three re-enqueue facts are not all met (assertion, and @objectstack/spec is in the CLI's import closure), so ⛔ no re-enqueue at this head. The card thread pushes a merge of origin/main for a fresh head; the seat re-lands it once PR CI is green there. A second hit of this signature anywhere gets an anchor card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#5055#1 · hotlong · session_01Q4EjjMmczBEaeiAQ48oDtz

维护者速读

  • 是什么:同一个改动重新入队。上次在合并队列里被一个与本改动无关的偶发测试红踢了出来,按规则换了个只合入 main 的新提交再走一遍。
  • 影响:改动内容与上次审过的完全一样。
  • 要你做什么:无。

Seat opinion: land.

席位核对

Seat L1 verdict: ACCEPT (delta) · head 2241d53bae9e · 2026-11-27T00:48Z · Fixes #37686.

  1. Shape: the only commit after the accepted head b3238ea8 is 2241d53b, a merge of origin/main 579b8577 (parents b3238ea8, 579b8577), no conflict. The PR's file list is the same 8 files as at b3238ea8.
  2. Premise measured: unchanged from the ACCEPT record 7205789366.
  3. Gates: latest check-run per name on 2241d53b: 61 success, 9 skipped, 0 failure. Not governed.
  4. Accepted deviations: none new.
  5. Out of scope / follow-ups: the queue kick's signature and disposition: comment 7206331709 (Test Core 6/10, plan.boot-parity.integration.test.ts, not this diff).
  6. Landing: contract review PASS 7205770891 covers this diff; a merge of the base adds no reviewed change. Ready + auto-merge via the queue.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 3e87d7b Nov 27, 2026
70 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-ygkjxt branch November 27, 2026 01:33
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…stack-ai#37765)

<!-- claude-projects-attribution: {"github_login":"hotlong"} -->
_Requested by **Jack** · [project
thread](https://claude.ai/code/project/chan_01EF41AQooqveF2DGD8nqPzS?thread=cmsg_01EF41AQooqveF2DGD8nqPzSVqcTHLLFPjviMwGsR87vDC)_

epic:objectstack-ai#5055#1 · hotlong · session_01Q4EjjPtiBXJZAqMqBPe3UD

Fixes objectstack-ai#37711

Clause-②: no
Metadata-protocol: none

## What

The `objectstack-ai` skill still taught that an agent names its model
and that `provider` defaults to `openai`. Since objectstack-ai#37697 (merge
`3e87d7b6`) both are optional and `provider` has no default. This PR
brings the published text and its eval in line.

- `skills/objectstack-ai/SKILL.md`, Model Configuration:
- `model` is an optional free-string name; absent means the host's
default model for the environment.
- `provider` is optional with no default (the deployment's choice, see
objectstack-ai#37712). The inline enum list is unchanged and still accurate: `openai |
azure_openai | anthropic | local`.
- The schema citation moves from the stale `agent.zod.ts:36-40` to
`:37-45`, the `AIModelConfigSchema` key list on main.
- `skills/objectstack-ai/evals/skills-tools-knowledge.json`, case 2:
accepts an omitted `model` and states the provider has no default.
Assertions unchanged.
- One `@objectstack/skills` patch changeset.

No tier or sentinel wording (phase 2, not in the framework).

## Premise (on `origin/main` `cbc353ed`)

`packages/spec/src/ai/agent.zod.ts`:

```ts
37  provider: z.enum(['openai', 'azure_openai', 'anthropic', 'local']).optional(),
38  model: z.string().optional().describe(
39    'Model name (e.g. gpt-4, claude-3-opus). Optional: when absent, the agent runs on the '
40    + 'host\'s default model for this environment, so an agent that only tunes sampling '
41    + '(e.g. `temperature`) need not name a model.',
42  ),
43  temperature: z.number().min(0).max(2).default(0.7),
44  maxTokens: z.number().optional(),
45  topP: z.number().optional(),
```

## Token budget

`skills/objectstack-ai/SKILL.md` sat at zero headroom (ceiling 6801).
The new words are paid for by tightening the same section (shorter intro
sentence, shorter registry and `maxTokens` rows); no fact is removed.
The file now measures 6801 / 6801.

## Local gates

- `node scripts/check-skills-token-ratchet.mjs` exit 0 (61 authored
files within ceilings)
- `pnpm check:skill-identifier-liveness` exit 0
- `pnpm check:skill-frame-sync` exit 0
- `pnpm check:skill-compatibility` exit 0
- `pnpm check:skill-top-level-keys` exit 0 (14 self-test cases)
- `pnpm check:skill-links` exit 0 (272 links, 22 self-test cases)
- `pnpm --filter @objectstack/spec check:skill-docs` exit 0
- `pnpm --filter @objectstack/spec check:skill-refs` exit 0 (10
generated files in sync)
- `pnpm --filter @objectstack/spec check:skill-served-sections` exit 0
(33 self-test cases)
- `pnpm --filter @objectstack/spec check:skill-examples` NOT MEASURED,
exit 3: `@objectstack/client-react` dist not built in this container
(spec was built). The diff touches no marked example block.
- eval JSON parses.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Q4EjjPtiBXJZAqMqBPe3UD

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…he deployment's AI settings choose the provider (objectstack-ai#37783)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu6xSMqJULJVMTrh5LMSQ4SD)_

Fixes objectstack-ai#37712

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up objectstack-ai#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 objectstack-ai#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 objectstack-ai#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 objectstack-ai#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
objectstack-ai#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 objectstack-ai#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>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…bjectstack-ai#37841)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuNTptyd1j97p7dHXZLEeH2g)_

Fixes objectstack-ai#37796

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:照我们技能包写应用的 AI 助手,以后在代理的模型配置里只写模型名,不再写“提供方”这一项;想用哪家提供方,到部署的
AI 设置里打开。
- 为什么做:“提供方”这一项今天已经退役,写了会被平台拒收,而对外发布的技能页还在教它;这是那次退役欠下的技能页跟进。
- 出错会怎样:只改教学文字和一道评测题,运行时不变;最坏是 AI 助手照旧文字给出过时写法,把文字改回即可撤回。
- 要你做什么:这是对外发布的技能包,需要你批准后才能合并。

## What changes

- **`skills/objectstack-ai/SKILL.md`, Model Configuration.** The
`provider` row leaves the agent model table. The paragraph above the
table now says the `model` block names a model and never a provider: the
deployment's AI settings choose the provider and match the model name
among the providers turned on, and a written `provider` is a parse error
whose fix is to delete the key (retired in protocol 19). The `model`,
`temperature` and `maxTokens` / `topP` rows are untouched.
- **The schema citation in the same paragraph** moves from
`packages/spec/src/ai/agent.zod.ts:37-45` to `:87-95`. PR objectstack-ai#37783 added
50 lines above the key list, so the old range pointed into a comment
block. `:87` is the `provider` tombstone and `:95` is `topP`.
- **`skills/objectstack-ai/evals/skills-tools-knowledge.json`, case 2.**
The prompt is unchanged: a copilot that should use Anthropic at
temperature 0.3 with a 2000-token cap. The expected answer now writes no
provider key, puts sampling under `model`, names the model in the
free-string `model` or leaves it to the host's default, and sends the
choice of Anthropic to the deployment's AI settings. `must_contain` goes
from `provider`, `anthropic`, `temperature`, `maxTokens` to
`temperature`, `maxTokens`, `deployment`. `must_not_contain` goes from
empty to the written line `provider: 'anthropic',`.
- **`.changeset/37796-skills-agent-model-provider-retired.md`**: one
`@objectstack/skills` patch.
- **`.changeset/37711-skills-agent-model-optional.md`**: a DELIBERATE
CORRECTION, declared below.

## Why

PR objectstack-ai#37783 (merge `f07d63a5`) retired an agent's `model.provider`. The
published skill still listed the key with its enum, and eval case 2
graded an answer as correct only when it wrote `provider`. An AI that
follows the skill would write a key the platform now refuses.

The Model Registry's own provider list (`ModelProviderSchema`) is a live
key and this PR does not describe it. Its only mention in the bundle was
inside the removed row.

## DELIBERATE CORRECTION

`Check Changeset` is red on purpose: this PR edits a pending release
note it did not add, `.changeset/37711-skills-agent-model-optional.md`
(from PR objectstack-ai#37765). That note ships in the same release as this change,
and two of its sentences would be false on release day.

Title, before:

> docs(skills): an agent's model name and provider are optional

Title, after:

> docs(skills): an agent's model name is optional

Body, before:

> `skills/objectstack-ai/SKILL.md` (Model Configuration) now teaches
that `model.model` is optional, and that an agent without one runs on
the host's default model for the environment, and that `model.provider`
is optional with no default (the deployment's choice) instead of
defaulting to `openai`. The inline enum list is unchanged, and the
schema citation now points at `packages/spec/src/ai/agent.zod.ts:37-45`.
The `objectstack-ai` eval case on sampling settings accepts an omitted
`model` and states the provider has no default. Published prose only: it
teaches the optional `model` / `provider` already on main since objectstack-ai#37697.

Body, after:

> `skills/objectstack-ai/SKILL.md` (Model Configuration) now teaches
that `model.model` is optional, and that an agent without one runs on
the host's default model for the environment. It no longer says
`model.provider` defaults to `openai`; the key itself leaves the page in
the same release (see the changeset on the skill no longer teaching
`model.provider`). The `objectstack-ai` eval case on sampling settings
accepts an omitted `model`. Published prose only: it teaches the
optional `model` already on main since objectstack-ai#37697.

The note's last sentence (the token budget) is unchanged. The precedent
is PR objectstack-ai#37783 itself, which corrected
`.changeset/37686-agent-model-name-optional.md` the same way.

## Tests

### Skill eval run (recorded)

`pnpm --filter @objectstack/scenarios skill-evals --skills
objectstack-ai --repeats 3 --concurrency 4`, on head `fb8b3f20`. 12
cases, 2 arms, 3 repeats: 72 of 72 turns ran in 8 min, none out of the
denominator. Subscription login, no API key, CLI 2.1.332, the login's
default model and effort.

| case | with-skill | no-skill |
|:--|--:|--:|
| **case 2 (this PR)** | **3/3** | **0/3** |
| bundle, all 12 cases | 30/36 (83%) | 1/36 (3%) |

Case 2, read answer by answer: all three with-skill answers put
`temperature` and `maxTokens` under `model`, write no provider key, and
send Anthropic to the deployment's AI settings. All three no-skill
answers write `provider: 'anthropic',` inside the `model` block, which
is the refused spelling.

<details>
<summary>Per-case table, round 2 (head fb8b3f2)</summary>

| case | with-skill | no-skill | with-skill missed | with-skill carried
forbidden |
|:--|--:|--:|:--|:--|
| objectstack-ai#1 | 3/3 | 1/3 |  |  |
| objectstack-ai#2 | 3/3 | 0/3 |  |  |
| objectstack-ai#3 | 3/3 | 0/3 |  |  |
| objectstack-ai#4 | 3/3 | 0/3 |  |  |
| objectstack-ai#5 | 2/3 | 0/3 | `aiExposed` |  |
| objectstack-ai#6 | 1/3 | 0/3 | `signed-in session` `refused` |  |
| objectstack-ai#7 | 0/3 | 0/3 | `do not retry` |  |
| objectstack-ai#8 | 3/3 | 0/3 |  |  |
| objectstack-ai#9 | 3/3 | 0/3 |  |  |
| objectstack-ai#10 | 3/3 | 0/3 |  |  |
| objectstack-ai#11 | 3/3 | 0/3 |  |  |
| objectstack-ai#12 | 3/3 | 0/3 |  |  |

</details>

<details>
<summary>Round 1 (head 789e0c7) and why the forbidden token
changed</summary>

The first commit graded case 2 with `must_not_contain: ["provider:"]`.
Round 1 scored it 1/3 with-skill. The two failing answers were correct:
each wrote no provider key and named the retired spelling only to warn
against it ("writing `provider: 'anthropic'` now fails to parse"). A
bare `provider:` graded that warning as a failure. The second commit
narrows the token to the object-literal line `provider: 'anthropic',`
(with its trailing comma), which a warning in prose does not carry and
every no-skill answer in round 2 does. The three round 1 with-skill
answers pass under the final tokens when read by hand.

Round 1's no-skill arm is not a clean baseline for case 2. The turns
inherited this container's project-memory variables, and all three
no-skill answers quoted the team's notes on the retirement. Round 2 was
started with `CLAUDE_COWORK_MEMORY_PATH_OVERRIDE` and
`CLAUDE_MEMORY_STORES` unset, and no case 2 answer mentions memory.

</details>

Cases 5, 6 and 7 are not touched by this PR. Their with-skill misses are
literal-phrase misses in both rounds and are listed under Acceptance
notes.

### Local gates, on head `fb8b3f20`

`node scripts/pm/dispatch-gates.mjs --commands` derived 49 families for
this diff. `--ran` reconciliation: 49 derived, 48 run, 1 NOT-MEASURED, 0
unrun.

- 47 exit 0, among them `check-skills-token-ratchet` (and its
self-test), `check:skill-identifier-liveness`, `check:skill-links`,
`check:skill-compatibility`, `check:skill-frame-sync`,
`check:pm-skill-id-lint`, `check:doc-authoring`, `check:nul-bytes`,
`check:published-files` and `@objectstack/spec` `check:skill-docs`.
- `node scripts/check-empty-changeset.mjs --base origin/main` exit 1:
the DELIBERATE CORRECTION above. It names
`.changeset/37711-skills-agent-model-optional.md` and nothing else.
- `pnpm check:dual-build-cjs-loads` exit 3, NOT MEASURED: it needs a
full `pnpm build`, and this container built only the scenario runner's
closure. CI runs it.
- Outside the derived set, also exit 0: `@objectstack/spec`
`check:skill-refs` and `check:skill-served-sections`.

### Size readings (`skills/**`)

| reading | before | after |
|:--|--:|--:|
| `skills/objectstack-ai/SKILL.md`, lines | 485 | 487 |
| `skills/objectstack-ai/SKILL.md`, tokens | 6801 | 6801 (ceiling 6801,
no row moved) |
| all `skills/*/SKILL.md`, lines | 4960 | 4962 |
| `evals/skills-tools-knowledge.json`, tokens (measured, not ratcheted)
| 3359 | 3411 |
| bundle total, tokens | 301302 | 301354 |

The new sentences in `SKILL.md` are paid for by the deleted row. The
bundle total grows by the eval fixture alone.

## Acceptance notes

- The branch is the harness-assigned `claude/project-thread-2rm2nh`, not
`claude/issue-37796-…`.
- The skill's `description` still lists "configuring an LLM provider"
among its triggers. Left as is: a user who asks that is now told where
the provider is chosen. Changing it would move when the skill loads,
which this card does not ask for.
- `SKILL.md:457` cites `packages/spec/src/ai/agent.zod.ts:234, :251` for
the `agent.tools` / `agent.knowledge` tombstones. Those lines did not
hold the tombstones before PR objectstack-ai#37783 either, so this PR leaves the
citation alone. Noted, not filed.
- Eval cases 6 and 7 miss literal phrases (`signed-in session`,
`refused`, `do not retry`) on the with-skill arm in both rounds, case 7
in all six turns. That reads as a grading-token question on those cases,
not as something this diff moved. Noted for the seat.
- The eval runner passes its whole environment to each turn, so a round
started inside a project container carries that project's memory into
both arms. Noted for the seat with the round 1 records as evidence.

## Verification

Read first, by risk:

1. `skills/objectstack-ai/SKILL.md`, the hunk under `## Model
Configuration`: three new sentences that ship to every customer install.
2. `skills/objectstack-ai/evals/skills-tools-knowledge.json`, case 2:
the token lists.
3. `.changeset/37711-skills-agent-model-optional.md`: the corrected
note.

Two-minute check: `sed -n '84,96p' packages/spec/src/ai/agent.zod.ts`
shows `provider: retiredKey(...)` at `:87` and `topP` at `:95`, the
range the skill now cites, and `node
scripts/check-skills-token-ratchet.mjs` prints
`skills/objectstack-ai/SKILL.md is 6801 tokens (ceiling 6801; headroom
0)`.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No schema change.)
- [x] 2. Every name I added uses the casing for its kind. (No name
added.)
- [ ] 3. No formatter ran. `pnpm lint` is read from CI on this
prose-only diff.
- [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` is not touched.
- [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 *Before Submitting* list in CONTRIBUTING.md: lint and the test
jobs are read from CI; the rest is done.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgUjtV7ahUH66wxpMk7)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgUjtV7ahUH66wxpMk7

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:ai size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec: an agent's model name becomes optional — absent means the environment's default model

2 participants