import type { CanonicalThinkingConfig, CanonicalToolChoice, MultimodalConstraints } from "../../model/index.js";
import type { PermissionContext, PermissionMode } from "../../permission/index.js";
export type AgentRuntimeConfig = {
provider: string;
model: string;
modelMultimodal?: MultimodalConstraints;
cwd: string;
systemPrompt?: string;
maxOutputTokens?: number;
temperature?: number;
thinking?: CanonicalThinkingConfig;
toolChoice?: CanonicalToolChoice;
maxContextMessages?: number;
stopOnStructuredOutput?: boolean;
permissionMode: PermissionMode;
permissionModeOrigin?: "user" | "tool";
permissionModeBeforePlan?: PermissionMode;
permissionContext: PermissionContext;
env?: NodeJS.ProcessEnv;
maxResultBytes?: number;
metadata?: Record<string, unknown>;
isSubagent?: boolean;
* Subagent fork depth — incremented on each level of `agent` tool fork.
* Top-level agent runs at depth 0; `agent` tool refuses to spawn another
* subagent once `subagentDepth >= maxSubagentDepth`. Default 0.
*/
subagentDepth?: number;
* Cap on `subagentDepth`. Defaults to 1 (one level of forking allowed,
* but no nested forks). Increase only when intentional.
*/
maxSubagentDepth?: number;
subagentTimeoutMs?: number;
jsonSelfCorrect?: boolean;
* The agent's default-model context window (tokens). Passed through so the
* loop can compare it with the routed model's window and trigger a
* post-routing compaction pass when the routed window is smaller.
*/
maxContextTokens?: number;
};