fix(agent): make goal completion directive imperative to ensure auto-complete (#4310)

This commit is contained in:
Salar
2026-06-30 20:20:03 +05:30
committed by GitHub
parent 72f80a9a3e
commit 965bd0d5b0
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -150,7 +150,8 @@ fn continuation_prompt(objective: &str) -> String {
"[goal continuation] You are resuming autonomous work toward this thread's goal — \
no user is currently present.\n\nGoal: {objective}\n\n\
Assess progress against concrete evidence, then take the next useful step. \
If the goal is already satisfied, call `goal_complete`. If you are blocked or \
Verify whether the goal is already satisfied. If yes, call `goal_complete` now. \
If you are blocked or \
need the user (e.g. an irreversible external action, missing input), stop and \
summarise the blocker and the next step rather than guessing — external actions \
are not auto-approved while you run unattended."
+3 -2
View File
@@ -91,8 +91,9 @@ pub async fn pause_for_current_thread(workspace_dir: &Path) {
pub fn active_goal_context_block(goal: &ThreadGoal) -> Option<String> {
let directive = match goal.status {
ThreadGoalStatus::Active => {
"Keep working toward this goal. When evidence confirms it's done, call \
goal_complete; if the objective has changed, update it with goal_set."
"Keep working toward this goal. Before responding, verify whether the \
objective is satisfied. If confirmed, call `goal_complete` now. \
If the objective has changed, call `goal_set` to update it."
}
ThreadGoalStatus::BudgetLimited => {
"This goal has reached its token budget. Stop substantive work: summarise \