From 33a03784389040bc6444f5293a10f9831cf9457d Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 14 Apr 2026 03:22:29 +0000 Subject: [PATCH] fix(watcher): sync primaryUserGoal field rename across codebase --- packages/core/src/agents/types.ts | 2 +- packages/core/src/agents/watcher-agent.ts | 14 +++++++------- packages/core/src/core/client.ts | 4 ++-- packages/core/src/core/client_watcher.test.ts | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/core/src/agents/types.ts b/packages/core/src/agents/types.ts index acf3b7b437..82bdb65ead 100644 --- a/packages/core/src/agents/types.ts +++ b/packages/core/src/agents/types.ts @@ -106,7 +106,7 @@ export interface SubagentProgress { } export interface WatcherProgress { - userDirections: string; + primaryUserGoal: string; progressSummary: string; evaluation: string; feedback?: string; diff --git a/packages/core/src/agents/watcher-agent.ts b/packages/core/src/agents/watcher-agent.ts index cb9427d0ce..4ff3294396 100644 --- a/packages/core/src/agents/watcher-agent.ts +++ b/packages/core/src/agents/watcher-agent.ts @@ -12,7 +12,7 @@ import { GEMINI_MODEL_ALIAS_FLASH } from '../config/models.js'; import * as path from 'node:path'; export const WatcherReportSchema = z.object({ - userDirections: z + primaryUserGoal: z .string() .describe( 'High level user directions/redirections and any change of plans.', @@ -142,14 +142,14 @@ Analyze the recent history against the North Star. Actively look for anti-patter *(Note: If this is a Standalone Short-Horizon task with no ongoing goal, just set all fields to "EMPTY" or "N/A" and omit feedback.)* -* \`userDirections\`: Any parsed _strategic_ changes, or note if the user transitioned/aborted tasks. -* \`progressSummary\`: Brief text of what was achieved, or "N/A" for short-horizon. +* \`primaryUserGoal\`: A concise, 1-2 sentence strictly HIGH LEVEL GOAL. Any parsed _strategic_ changes, or note if the user transitioned/aborted tasks. +* \`progressSummary\`: Brief text of what was achieved, or "N/A" for short-horizon. Use bullet points. * \`evaluation\`: "ON_TRACK", "DEVIATING", "STUCK", "LOOPING", or "NOT_APPLICABLE". -* \`feedback\`: - * **If Short-Horizon or ON_TRACK**: Leave empty. - * **If DEVIATING/STUCK/LOOPING**: Provide a strong, authoritative directive to the main agent. (e.g., _"WARNING: You are in a loop trying to fix test_utils.py. The original goal is to build the API endpoint. Revert your last change, ignore the test warning for now, and return to the API endpoint."_) +* \`feedback\`: **CRITICAL: THIS IS INJECTED INTO THE AGENT'S CHAT HISTORY.** + * **If Short-Horizon or ON_TRACK**: You MUST leave this field empty. + * **If DEVIATING/STUCK/LOOPING**: Provide a strong, authoritative directive to the main agent. (e.g., _"WARNING: You are hyper fixating on fixing test_utils.py and looping as a result. The original goal is to build the API endpoint. Revert your last change, ignore the test warning for now, and return to the API endpoint."_). If the agent is truly stuck, provide the directive to stop unless the agent can get new information. -You MUST call \`complete_task\` with a JSON report containing \`userDirections\`, \`progressSummary\`, \`evaluation\`, and optional \`feedback\`.`, +You MUST call \`complete_task\` with a JSON report containing \`primaryUserGoal\`, \`progressSummary\`, \`evaluation\`, and optional \`feedback\`.`, }, }; }; diff --git a/packages/core/src/core/client.ts b/packages/core/src/core/client.ts index d7a5ba3855..e1c5df79f2 100644 --- a/packages/core/src/core/client.ts +++ b/packages/core/src/core/client.ts @@ -1423,8 +1423,8 @@ export class GeminiClient { const reportLines = [ '# Watcher Memory State', '', - '## 1. User Directions', - parsed.userDirections, + '## 1. Primary User Goal', + parsed.primaryUserGoal, '', '## 2. Progress Summary', parsed.progressSummary, diff --git a/packages/core/src/core/client_watcher.test.ts b/packages/core/src/core/client_watcher.test.ts index ac3f577985..fb3fd355ac 100644 --- a/packages/core/src/core/client_watcher.test.ts +++ b/packages/core/src/core/client_watcher.test.ts @@ -87,7 +87,7 @@ describe('GeminiClient Watcher Integration', () => { vi.spyOn(config, 'getApprovalMode').mockReturnValue(ApprovalMode.DEFAULT); const mockWatcherTool = createMockWatcherTool({ - userDirections: 'Keep testing', + primaryUserGoal: 'Keep testing', progressSummary: 'Test in progress', evaluation: 'Good', feedback: 'Keep going', @@ -204,7 +204,7 @@ describe('GeminiClient Watcher Integration', () => { vi.spyOn(config, 'getApprovalMode').mockReturnValue(ApprovalMode.DEFAULT); const mockWatcherTool = createMockWatcherTool({ - userDirections: 'Keep testing', + primaryUserGoal: 'Keep testing', progressSummary: 'Test in progress', evaluation: 'Good', feedback: 'Keep going', @@ -278,7 +278,7 @@ describe('GeminiClient Watcher Integration', () => { vi.spyOn(config, 'getApprovalMode').mockReturnValue(ApprovalMode.DEFAULT); const reportData = { - userDirections: 'Messy test direction', + primaryUserGoal: 'Messy test direction', progressSummary: 'Messy progress', evaluation: 'ON_TRACK', };