discouraging use of screenshots for verification#66
Conversation
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThe PR bumps package version to 0.2.3 and expands the inline descriptions for three server-side tools—take_screenshot, get_element_attribute, and execute_script—to clarify recommended usage, batching, and when to prefer attribute/script checks over screenshots. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 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 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.
🧹 Nitpick comments (1)
src/lib/server.js (1)
439-439: Consider also referencingget_element_textfor text-content verification.The description steers agents toward
get_element_attributeandexecute_script, but omitsget_element_text, which is the most direct tool for verifying visible text — likely the most common reason an LLM would reach for a screenshot. Adding it alongsideget_element_attributecloses that gap.✏️ Suggested description update
- description: "captures a screenshot of the current page. Prefer using the accessibility://current resource for understanding page content. Use get_element_attribute or execute_script to verify element state. Only use screenshots when visual layout or styling needs to be verified.", + description: "captures a screenshot of the current page. Prefer using the accessibility://current resource for understanding page content. Use get_element_text to verify text content, get_element_attribute to verify element state, or execute_script to batch-read multiple values. Only use screenshots when visual layout or styling needs to be verified.",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lib/server.js` at line 439, The description string for the screenshot tool omits recommending get_element_text for verifying visible text; update the description (the string assigned to description in the screenshot tool definition) to mention get_element_text alongside get_element_attribute and execute_script as the preferred way to verify text content before taking screenshots so agents use get_element_text for text verification rather than defaulting to screenshots.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/lib/server.js`:
- Line 439: The description string for the screenshot tool omits recommending
get_element_text for verifying visible text; update the description (the string
assigned to description in the screenshot tool definition) to mention
get_element_text alongside get_element_attribute and execute_script as the
preferred way to verify text content before taking screenshots so agents use
get_element_text for text verification rather than defaulting to screenshots.
Summary by CodeRabbit
Chores
Documentation