mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-24 21:41:08 +02:00
Validation range is now 1-500. The Advanced tab's native number inputs are replaced with a segmented minus/value/plus stepper (custom buttons, digits-only typing, range clamping, immediate save on step). The chat override gets a smaller placeholder, steps from the effective global limit when empty, and has a clear button to fall back to the global limit.
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { z } from 'zod';
|
|
import { DEFAULT_MAX_MODEL_CALLS } from './turns.js';
|
|
|
|
/**
|
|
* User-configurable model-call budgets (see issue #768).
|
|
*
|
|
* - maxModelCalls: the global limit every turn inherits by default,
|
|
* including headless/knowledge work and spawned sub-agents (it is also
|
|
* the cap a parent can grant a sub-agent).
|
|
* - chatMaxModelCalls: optional override for interactive chat turns only;
|
|
* when absent, chat uses the global limit.
|
|
*
|
|
* Changing these affects only newly created turns — each turn persists its
|
|
* resolved limit in turn_created.config.maxModelCalls.
|
|
*/
|
|
export const MIN_MODEL_CALL_LIMIT = 1;
|
|
export const MAX_MODEL_CALL_LIMIT = 500;
|
|
|
|
const limit = z
|
|
.number()
|
|
.int()
|
|
.min(MIN_MODEL_CALL_LIMIT)
|
|
.max(MAX_MODEL_CALL_LIMIT);
|
|
|
|
export const TurnLimitsSettingsSchema = z.object({
|
|
maxModelCalls: limit,
|
|
chatMaxModelCalls: limit.optional(),
|
|
});
|
|
|
|
export const DEFAULT_TURN_LIMITS_SETTINGS: TurnLimitsSettings = {
|
|
maxModelCalls: DEFAULT_MAX_MODEL_CALLS,
|
|
};
|
|
|
|
export type TurnLimitsSettings = z.infer<typeof TurnLimitsSettingsSchema>;
|