fix: identify OpenCode Go requests by session
This commit is contained in:
@@ -14,7 +14,7 @@ export const buildGoalIntroText = (tokenBudget) => {
|
||||
+ '\n</system-reminder>';
|
||||
};
|
||||
|
||||
const fitObjective = async ({ objective, directory, providerID, modelID, warn }) => {
|
||||
const fitObjective = async ({ objective, directory, sessionID, providerID, modelID, warn }) => {
|
||||
if (objective.length <= GOAL_OBJECTIVE_CHAR_LIMIT) return objective;
|
||||
|
||||
let distilled = null;
|
||||
@@ -32,6 +32,7 @@ const fitObjective = async ({ objective, directory, providerID, modelID, warn })
|
||||
'Write in the same language as the task text.',
|
||||
].join('\n'),
|
||||
directory,
|
||||
sessionID,
|
||||
preferredProviderID: providerID,
|
||||
preferredModelID: modelID,
|
||||
});
|
||||
@@ -66,6 +67,7 @@ export const createSessionGoal = async ({
|
||||
const objectiveText = await fitObjective({
|
||||
objective: String(objective ?? '').trim(),
|
||||
directory,
|
||||
sessionID,
|
||||
providerID,
|
||||
modelID,
|
||||
warn,
|
||||
|
||||
@@ -378,6 +378,7 @@ export const createSessionGoalRuntime = ({
|
||||
prompt: `The goal objective:\n\n<objective>\n${goal.objective}\n</objective>\n\nThe agent's latest turn:\n\n${assistantText}\n\nReturn the verdict JSON. Write the note in the SAME language as this sample from the objective: "${goal.objective.slice(0, 200).replace(/\s+/g, ' ').trim()}"`,
|
||||
system: buildAuditSystemPrompt(),
|
||||
directory,
|
||||
sessionID: typeof lastAssistantInfo?.sessionID === 'string' ? lastAssistantInfo.sessionID : undefined,
|
||||
preferredProviderID: typeof lastAssistantInfo?.providerID === 'string' ? lastAssistantInfo.providerID : undefined,
|
||||
preferredModelID: typeof lastAssistantInfo?.modelID === 'string' ? lastAssistantInfo.modelID : undefined,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user