Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.
JavaScript 3d3d-assets3d-modelingagent-skillsagent-toolsai-agentsasset-pipelinecligame-assetsglbgltfmcpmcp-servermodel-context-protocolprocedural-generationprocedural-modelingtext-to-3dthreejstypescript
fix: support claude sonnet 5 thinking defaults
Matt Kissinger5318714dfb2d
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 92e9d0e3..dc4e8dbd 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,11 +5,18 @@ for the consuming app's lockfile + tarball provenance, not public npm releases.## [Unreleased]+## [0.1.1] — 2026-06-30+### Documentation- Clarified that `@kiln/engine` remains private execution infrastructure. External developer accessis mediated by Studio `/v1`, private SDK/skills, and future AgentCore Gateway product tools ratherthan direct engine, raw Forge, or composer harness exposure.+### Changed+- Treat native `claude-sonnet-5` as adaptive-only for Anthropic thinking controls: numeric+ `KILN_THINKING` budgets are ignored for this model so the agent harness does not send+ manual extended-thinking params that Sonnet 5 rejects.+### Added — scene composer (`@kiln/engine/composer`, `/composer/agent`)A THREE-free scene-composition surface: a `PlacementModel` single-source-of-truth with asmall scene DSL (`scene()`/`asset()`), terrain-agnostic hierarchy-aware layout, an overlapdiff --git a/package.json b/package.jsonindex 3081c677..d6037171 100644--- a/package.json+++ b/package.json@@ -1,7 +1,7 @@{"name": "@kiln/engine","private": true,- "version": "0.1.0",+ "version": "0.1.1","description": "Kiln 3D engine — text-to-GLB codegen agent loop, deterministic CPU render/rasterizer, primitive/CSG library, palette + instanceability grading, and pairwise ranking arena. Extracted from pixel-forge.","license": "MIT","author": "Matthew Kissinger",diff --git a/src/agent/providers.test.ts b/src/agent/providers.test.tsindex 9673a283..c4702a50 100644--- a/src/agent/providers.test.ts+++ b/src/agent/providers.test.ts@@ -148,6 +148,14 @@ describe('makeKilnModel', () => {expect(cfg['betas']).toEqual(['interleaved-thinking-2025-05-14']);});+ test('Sonnet 5 ignores numeric thinking budgets because it is adaptive-only', () => {+ const cfg = getCfg(+ makeKilnModel({ provider: 'anthropic', model: 'claude-sonnet-5', thinking: 8000 }),+ );+ expect(cfg['params']).toBeUndefined();+ expect(cfg['betas']).toBeUndefined();+ });+test('env keyword/number applies (numbers floored to 1024); descriptor 0 forces default; google ignores it', () => {const prev = process.env['KILN_THINKING'];try {diff --git a/src/agent/providers.ts b/src/agent/providers.tsindex d43001d5..fa17ee38 100644--- a/src/agent/providers.ts+++ b/src/agent/providers.ts@@ -100,7 +100,12 @@ const trimmedEnv = (k: string): string | undefined => {* minimum of 1024, interleaved beta added). Unset / 0 / '' → undefined, i.e.* send nothing and take the API default.*/+function isAnthropicAdaptiveOnlyModel(model: string): boolean {+ return /^claude-sonnet-5(?:-|$)/.test(model);+}+function resolveAnthropicThinking(+ model: string,fromDesc?: string | number,): { params: Record<string, unknown>; betas?: string[] } | undefined {const raw = fromDesc ?? trimmedEnv('KILN_THINKING');@@ -113,6 +118,10 @@ function resolveAnthropicThinking(: undefined;if (asNum !== undefined) {if (!Number.isFinite(asNum) || asNum <= 0) return undefined;+ // Sonnet 5 has adaptive thinking on by default and rejects manual+ // extended-thinking budgets. Do not let a global KILN_THINKING number make+ // this model fail before the first tool call.+ if (isAnthropicAdaptiveOnlyModel(model)) return undefined;return {params: { thinking: { type: 'enabled', budget_tokens: Math.max(1024, Math.floor(asNum)) } },betas: ['interleaved-thinking-2025-05-14'],@@ -134,7 +143,7 @@ export function makeKilnModel(desc: KilnModelDescriptor, opts: MakeKilnModelOpticonst maxTokens = desc.maxTokens;switch (desc.provider) {case 'anthropic': {- const thinking = resolveAnthropicThinking(desc.thinking);+ const thinking = resolveAnthropicThinking(desc.model, desc.thinking);return new AnthropicModel({modelId: desc.model,...(maxTokens != null ? { maxTokens } : {}),