} from './types.js'
import {
+ AGENT_ACTOR_EFFORT,
AGENT_ACTOR_MODEL,
+ AGENT_CRITIC_EFFORT,
AGENT_CRITIC_MODEL,
AGENT_IDLE_TIMEOUT_S,
AGENT_ITERATION_BUDGET,
let actorResult: Awaited<ReturnType<typeof sandbox.run>>
try {
actorResult = await sandbox.run({
- agent: agentProvider(strategy.actorModel ?? AGENT_ACTOR_MODEL),
+ agent: agentProvider(
+ strategy.actorModel ?? AGENT_ACTOR_MODEL,
+ strategy.actorEffort ?? AGENT_ACTOR_EFFORT
+ ),
completionSignal: COMPLETION_SIGNAL,
idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
maxIterations: budget,
const { baseBranch, sandbox, signal, spec, strategy } = ctx
let critic = await sandbox.run({
- agent: agentProvider(strategy.criticModel ?? AGENT_CRITIC_MODEL),
+ agent: agentProvider(
+ strategy.criticModel ?? AGENT_CRITIC_MODEL,
+ strategy.criticEffort ?? AGENT_CRITIC_EFFORT
+ ),
completionSignal: COMPLETION_SIGNAL,
idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
maxIterations: 1,
if (findings === null) {
console.warn(` #${spec.id}: Critic parse failed. Retrying.`)
critic = await sandbox.run({
- agent: agentProvider(strategy.criticModel ?? AGENT_CRITIC_MODEL),
+ agent: agentProvider(
+ strategy.criticModel ?? AGENT_CRITIC_MODEL,
+ strategy.criticEffort ?? AGENT_CRITIC_EFFORT
+ ),
completionSignal: COMPLETION_SIGNAL,
idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
maxIterations: 1,
import {
AGENT_IDLE_TIMEOUT_S,
+ AGENT_PLANNER_EFFORT,
AGENT_PLANNER_MODEL,
AGENT_TASK_TIMEOUT_MS,
COMPLETION_SIGNAL,
let plan: Awaited<ReturnType<typeof sandcastle.run>>
try {
plan = await sandcastle.run({
- agent: agentProvider(AGENT_PLANNER_MODEL),
+ agent: agentProvider(AGENT_PLANNER_MODEL, AGENT_PLANNER_EFFORT),
completionSignal: COMPLETION_SIGNAL,
hooks: SANDBOX_AUTH_HOOKS,
idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
*/
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export type LoopStrategy = {
+ /** Reasoning effort for the actor agent. Defaults to AGENT_ACTOR_EFFORT constant. */
+ actorEffort?: string
/** Model for the actor agent. Defaults to AGENT_ACTOR_MODEL constant. */
actorModel?: string
/** Path to the actor prompt file. */
buildActorArgs: (spec: TaskSpec, findings: Finding[]) => Record<string, string>
/** Builds promptArgs for the critic run from task spec and base branch. */
buildCriticArgs: (spec: TaskSpec, baseBranch: string) => Record<string, string>
+ /** Reasoning effort for the critic agent. Defaults to AGENT_CRITIC_EFFORT constant. */
+ criticEffort?: string
/** Model for the critic agent. Defaults to AGENT_CRITIC_MODEL constant. */
criticModel?: string
/** Path to the critic prompt file. */
/**
* Returns a sandcastle agent provider for the given model, selected by AGENT_PROVIDER constant.
* @param model - The model identifier (e.g., 'github-copilot/claude-sonnet-4.6').
+ * @param effort - Reasoning effort level passed as `variant` to opencode.
* @returns The configured agent provider.
*/
-export function agentProvider (model: string): AgentProvider {
+export function agentProvider (model: string, effort?: string): AgentProvider {
switch (AGENT_PROVIDER) {
case 'opencode':
- return sandcastle.opencode(model)
+ return sandcastle.opencode(model, effort ? { variant: effort } : undefined)
case 'pi':
return sandcastle.pi(model)
}