Update planner to verify screenshot first. #54
Conversation
… changed for planner to high and grounder to medium
📝 WalkthroughWalkthroughTwo files updated in the goal executor's planner module: the AI agent now increases Google provider thinking level from 'medium' to 'high' for planner phases, while the planner prompt now enforces screenshot-first validation before issuing tap, long_press, or input_text actions. Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/goal-executor/src/ai/AIAgent.ts`:
- Line 420: The planner behavior was changed in AIAgent (thinkingLevel set to
'high' when phase === 'planner'), so update the test in AIAgent.test (the
assertion around the planner case that currently expects 'medium' between lines
~133-148) to expect 'high' instead; locate the test that inspects the agent's
thinkingLevel for the 'planner' phase (look for references to thinkingLevel or
phase === 'planner' in the test) and change the expected value to 'high' so
tests match the new behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7c5869b0-52ef-4abb-a1ec-471ee1061899
📒 Files selected for processing (2)
packages/goal-executor/src/ai/AIAgent.tspackages/goal-executor/src/prompts/planner.md
| google: { | ||
| thinkingConfig: { | ||
| thinkingLevel: phase === 'planner' ? 'medium' : 'minimal', | ||
| thinkingLevel: phase === 'planner' ? 'high' : 'medium', |
There was a problem hiding this comment.
Update planner reasoning-level test expectation to match this behavior change.
Line 420 intentionally changes planner thinkingLevel to 'high', but packages/goal-executor/src/ai/AIAgent.test.ts (Line 133-148 in the provided snippet) still asserts 'medium'. This will cause test failure and leave behavior/docs/tests out of sync.
✅ Suggested test update
test('AIAgent uses medium Gemini 3 reasoning defaults for planner calls', () => {
const providerOptions = getProviderOptions({
provider: 'google',
modelName: 'gemini-3.1-pro-preview',
phase: 'planner',
});
assert.deepEqual(providerOptions, {
google: {
thinkingConfig: {
- thinkingLevel: 'medium',
+ thinkingLevel: 'high',
includeThoughts: false,
},
},
});
});🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/goal-executor/src/ai/AIAgent.ts` at line 420, The planner behavior
was changed in AIAgent (thinkingLevel set to 'high' when phase === 'planner'),
so update the test in AIAgent.test (the assertion around the planner case that
currently expects 'medium' between lines ~133-148) to expect 'high' instead;
locate the test that inspects the agent's thinkingLevel for the 'planner' phase
(look for references to thinkingLevel or phase === 'planner' in the test) and
change the expected value to 'high' so tests match the new behavior.
Also the thinking level is changed for planner to high and grounder to medium
Summary by CodeRabbit