Skip to content

Commit ff4698c

Browse files
committed
Add an earlier, softer step-budget nudge at 2 steps remaining (in addition to the hard final-step guarantee), per the documented fix plan's escalating-notice design
1 parent f154c89 commit ff4698c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

connectors/gemini/delegate.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,14 @@ export async function runInvestigation({ task, max_steps = 6, resume_run_id }) {
926926
// an honest one: the model is told to say it couldn't finish, rather
927927
// than presenting a rushed, incomplete answer as if it were complete.
928928
const remainingAfterThisStep = cappedSteps - step;
929-
if (remainingAfterThisStep <= 1) {
929+
if (remainingAfterThisStep === 2) {
930+
// Earlier, softer nudge -- gives the model a chance to steer toward
931+
// synthesis before the hard cutoff two notes down, instead of only
932+
// finding out at the last possible moment.
933+
responseParts.push({
934+
text: `[SYSTEM NOTE: only 2 step(s) remain after this one. Start wrapping up -- prioritize synthesizing what you've already found over opening new lines of investigation.]`,
935+
});
936+
} else if (remainingAfterThisStep <= 1) {
930937
// When remainingAfterThisStep is 0, the NEXT turn is the final step,
931938
// which is called with no tools at all (see isFinalStep above) -- so
932939
// this note can say so as a fact, not just a suggestion to wrap up.

0 commit comments

Comments
 (0)