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
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