Skip to content

Commit 2728156

Browse files
committed
docs(agent): say which side of a fallback the catalog may not know
The tuning doc read as if an unknown primary's values passed through. They do not: the block never shows a graded knob for a model outside the catalog, so a value stored under one is stale and the row's own field decides. A test now pins that.
1 parent b4481fe commit 2728156

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

‎apps/sim/lib/workflows/blocks/fallback-models.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,22 @@ describe('resolveFallbackTuning', () => {
265265
expect(resolved.thinkingLevel).toBeUndefined()
266266
})
267267

268+
it('treats a value stored under an uncatalogued primary as stale, and lets the row decide', () => {
269+
/** The block never shows a graded knob for a model outside the catalog. */
270+
const stale = resolveFallbackTuning({ model: 'gpt-small' }, 'openrouter/custom', {
271+
reasoningEffort: 'high',
272+
})
273+
expect(stale.reasoningEffort).toBeUndefined()
274+
expect(stale.adjustments).toEqual(['reasoningEffort: high -> provider default'])
275+
276+
const own = resolveFallbackTuning(
277+
{ model: 'gpt-small', reasoningEffort: 'low' },
278+
'openrouter/custom',
279+
{ reasoningEffort: 'high' }
280+
)
281+
expect(own.reasoningEffort).toBe('low')
282+
})
283+
268284
it('clamps temperature and max tokens to the fallback caps, keeping the input type', () => {
269285
const resolved = resolveFallbackTuning({ model: 'claude-sonnet-5' }, 'gpt-big', {
270286
temperature: '1.5',

‎apps/sim/lib/workflows/blocks/fallback-models.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,11 @@ function clampToCap(
310310
* Temperature and max output tokens are caps in the primary's terms, so they
311311
* are clamped to what the fallback allows rather than dropped: a low
312312
* temperature chosen for repeatability must survive, and "no more than N" still
313-
* holds under a smaller ceiling. A model the catalog does not know has no caps
314-
* and no lists, so everything passes through unchanged.
313+
* holds under a smaller ceiling. A fallback the catalog does not know has no
314+
* caps and no lists, so everything passes through to it unchanged. A primary
315+
* the catalog does not know never showed a graded knob in the editor, so a
316+
* value stored under it is stale and is not inherited; the row shows the field
317+
* instead, and its own value is what applies.
315318
*/
316319
export function resolveFallbackTuning(
317320
candidate: FallbackModelCandidate,

0 commit comments

Comments
 (0)