]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor(sandcastle): split AGENT_MODEL into per-role constants
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 7 May 2026 06:40:37 +0000 (08:40 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 7 May 2026 06:40:37 +0000 (08:40 +0200)
.sandcastle/constants.ts
.sandcastle/refinement-loop.ts
.sandcastle/task-source.ts

index 5a7efb78fc65c23e0c32a525e8dc078f885d9ce2..74497537b34c0fa5ddb1cb272e4d41980e4f2eb5 100644 (file)
@@ -3,7 +3,9 @@ import { existsSync } from 'node:fs'
 
 export const AGENT_IDLE_TIMEOUT_S = 300
 
-export const AGENT_MODEL = 'github-copilot/claude-sonnet-4.6'
+export const AGENT_ACTOR_MODEL = 'github-copilot/claude-sonnet-4.6'
+
+export const AGENT_CRITIC_MODEL = 'github-copilot/claude-sonnet-4.6'
 
 export const BRANCH_PREFIX = 'agent/issue'
 
@@ -61,7 +63,7 @@ export const MAX_CRITIC_ROUNDS = 10
 
 export const MAX_TITLE_LENGTH = 200
 
-export const PLANNER_MODEL = 'github-copilot/claude-opus-4.6'
+export const AGENT_PLANNER_MODEL = 'github-copilot/claude-opus-4.6'
 
 export const PUSH_TIMEOUT_MS = 60_000
 
index 779bcaf3ab8f98dda7d5c094640d60f62073be7f..9983e51836a141c61e6adff15494e9d75e9e1e39 100644 (file)
@@ -13,8 +13,9 @@ import type {
 } from './types.js'
 
 import {
+  AGENT_ACTOR_MODEL,
+  AGENT_CRITIC_MODEL,
   AGENT_IDLE_TIMEOUT_S,
-  AGENT_MODEL,
   COMPLETION_SIGNAL,
   CONTEXT_HASH_RADIUS,
   HASH_PREFIX_LENGTH,
@@ -432,7 +433,7 @@ async function executeRound (
   let implementerResult: Awaited<ReturnType<typeof sandbox.run>>
   try {
     implementerResult = await sandbox.run({
-      agent: sandcastle.opencode(AGENT_MODEL),
+      agent: sandcastle.opencode(AGENT_ACTOR_MODEL),
       completionSignal: COMPLETION_SIGNAL,
       idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
       maxIterations: budget,
@@ -592,7 +593,7 @@ async function runCritic (
   signal?: AbortSignal
 ): Promise<Finding[] | null> {
   let critic = await sandbox.run({
-    agent: sandcastle.opencode(AGENT_MODEL),
+    agent: sandcastle.opencode(AGENT_CRITIC_MODEL),
     completionSignal: COMPLETION_SIGNAL,
     idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
     maxIterations: 1,
@@ -607,7 +608,7 @@ async function runCritic (
   if (findings === null) {
     console.warn(`  #${spec.id}: Critic parse failed. Retrying.`)
     critic = await sandbox.run({
-      agent: sandcastle.opencode(AGENT_MODEL),
+      agent: sandcastle.opencode(AGENT_CRITIC_MODEL),
       completionSignal: COMPLETION_SIGNAL,
       idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
       maxIterations: 1,
index 4a4458d157ecd187735e3a6fdb98b99ba463eff1..3a52af19801c8ff2104fe905ac3f97ef72c1f742 100644 (file)
@@ -12,7 +12,7 @@ import {
   MAX_ISSUES_FETCH,
   MAX_PRS_FETCH,
   MAX_TITLE_LENGTH,
-  PLANNER_MODEL,
+  AGENT_PLANNER_MODEL,
   TASK_TIMEOUT_MS,
 } from './constants.js'
 import { execFileAsync, toErrorMessage } from './utils.js'
@@ -96,7 +96,7 @@ export class GithubIssueSource implements TaskSource {
       let plan: Awaited<ReturnType<typeof sandcastle.run>>
       try {
         plan = await sandcastle.run({
-          agent: sandcastle.opencode(PLANNER_MODEL),
+          agent: sandcastle.opencode(AGENT_PLANNER_MODEL),
           completionSignal: COMPLETION_SIGNAL,
           idleTimeoutSeconds: AGENT_IDLE_TIMEOUT_S,
           maxIterations: 1,