MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / createMaxStepsExceededError

Function createMaxStepsExceededError

packages/agent-core/src/loop/errors.ts:7–16  ·  view source on GitHub ↗
(maxSteps: number, message?: string)

Source from the content-addressed store, hash-verified

5import { ErrorCodes, KimiError, isKimiError } from '#/errors';
6
7export function createMaxStepsExceededError(maxSteps: number, message?: string): KimiError {
8 return new KimiError(
9 ErrorCodes.LOOP_MAX_STEPS_EXCEEDED,
10 message ??
11 `Turn exceeded maxSteps=${maxSteps}. If max_steps_per_turn is too small, raise it in config.toml (loop_control.max_steps_per_turn), or run "/update-config" to update it, then "/reload".`,
12 {
13 details: { maxSteps },
14 },
15 );
16}
17
18export function isMaxStepsExceededError(error: unknown): boolean {
19 return isKimiError(error) && error.code === ErrorCodes.LOOP_MAX_STEPS_EXCEEDED;

Callers 1

runTurnFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected