chore: use thinking mode
This commit is contained in:
+24
-4
@@ -119,7 +119,8 @@ async function runOllamaLoop(ctx: AgentRunContext): Promise<AgentResult> {
|
||||
tools,
|
||||
keep_alive: "10m",
|
||||
options: {
|
||||
think: false,
|
||||
think: true,
|
||||
num_ctx: 32768,
|
||||
} as Record<string, unknown>,
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -206,13 +207,32 @@ async function runOllamaLoop(ctx: AgentRunContext): Promise<AgentResult> {
|
||||
// re-calling select_mode instead of executing the workflow.
|
||||
if (calledSelectMode && !pendingModeNudge) {
|
||||
pendingModeNudge = true;
|
||||
|
||||
// Parse the selected mode name from the tool result so we can give a
|
||||
// more specific first-step instruction.
|
||||
let selectedMode = "";
|
||||
try {
|
||||
const lastToolMsg = messages[messages.length - 1];
|
||||
const parsed = JSON.parse(
|
||||
typeof lastToolMsg.content === "string" ? lastToolMsg.content : "",
|
||||
);
|
||||
if (typeof parsed?.modeName === "string") selectedMode = parsed.modeName;
|
||||
} catch {
|
||||
// best-effort
|
||||
}
|
||||
|
||||
const firstStep =
|
||||
selectedMode === "Review" || selectedMode === "IncrementalReview"
|
||||
? "Your first tool call must be checkout_pr with the PR number from the event context."
|
||||
: "Call the first tool required by the workflow now.";
|
||||
|
||||
messages.push({
|
||||
role: "user",
|
||||
content:
|
||||
"Good. You have selected a mode and received the workflow. " +
|
||||
`Good. You have selected ${selectedMode || "a"} mode and received the workflow. ` +
|
||||
"Do NOT call select_mode again. " +
|
||||
"Call the next tool to execute the workflow now (e.g. checkout_pr, get_issue, create_pull_request_review). " +
|
||||
"Start immediately.",
|
||||
`${firstStep} ` +
|
||||
"Execute the complete workflow step by step until you call create_pull_request_review or report_progress.",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user