fix: allow ToolLoopAgent prepareCall to type top-level reasoning overrides - #18482
Conversation
Bugfix reviewOutcome: approved Reproduction replayStatus: no-longer-reproduces The exact original reproduction completed successfully and the original bug signal did not appear. Fixes issueStatus: fully-addresses The change adds Side effectsRisk: none The production change is type-only and permits an optional property already present at runtime; it does not alter legitimate runtime behavior. PerformanceRisk: none No runtime code, allocation behavior, or execution path changes. Backwards compatibilityRisk: none The change does not read, write, migrate, or alter persisted data. Breaking changesRisk: none This is an additive widening of the exported ArchitectureRisk: none The fix remains within the owning AI package and existing Change scopeStatus: minimal The diff contains only the two required type additions, focused regression type coverage, and the required patch changeset. SecurityRisk: none No runtime handling, network access, credentials, parsing, validation, or trust boundaries are changed. TestingStatus: appropriate The regression test covers reading VerificationInspected the complete merge-base diff, relevant public types, exports, runtime prepareCall flow, and all changed files. The AI package type check passed, the Node suite passed including ToolLoopAgent tests, formatting and diff checks passed, and the authoritative replay confirmed the original bug no longer reproduces. |
|
🚀 Published in:
|
Background
ToolLoopAgent runtime exposed and forwarded the top-level reasoning option, but prepareCall consumers received TS2339 and TS2353 when reading or overriding it.
Root Cause
Both prepareCall Pick lists omitted reasoning even though ToolLoopAgentSettings defines it and runtime spreads the complete settings into and out of prepareCall; the reproduction confirmed the type errors alongside correct runtime forwarding.
Summary
Added reasoning to the prepareCall input and return types, added regression type coverage, removed reproduction artifacts, and added an ai patch changeset.
Testing
Added a type test covering access to settings.reasoning and typed reasoning return overrides.
End-to-end Validation
pnpm -C examples/ai-functions exec tsc --noEmit --pretty false --strict --skipLibCheck --target es2022 --module esnext --moduleResolution bundler --types node src/reproduction/tool-loop-agent-reasoning-validation.ts— consumer-style code compiled successfully when reading and overriding reasoning.Related Issues
Fixes #18478
Closes #18479