fix: predict_click returns None for zero coordinates (x=0 or y=0)#1401
fix: predict_click returns None for zero coordinates (x=0 or y=0)#1401kuishou68 wants to merge 1 commit into
Conversation
…ua#1400) Zero coordinates (x=0 or y=0) are valid click positions but were being treated as falsy in the truthiness check. Replace with explicit None check. Signed-off-by: cocoon <54054995+kuishou68@users.noreply.github.com>
|
@kuishou68 is attempting to deploy a commit to the Cua Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Summary
Fixes a bug in
AnthropicHostedToolsConfig.predict_clickwhere coordinates with a value of0were silently discarded due to a Python truthiness check.Problem
When a model predicts a click at the leftmost column (
x=0) or topmost row (y=0) of the screen,0evaluates as falsy in Python, causing the condition to fail and the method to returnNoneinstead of the valid(0, y)or(x, 0)coordinates.Fix
This correctly treats
0as a valid coordinate value while still guarding against missing keys.Files Changed
libs/python/agent/cua_agent/loops/anthropic.py— line 1950: replace truthiness check withis not NoneCloses #1400
Signed-off-by: cocoon 54054995+kuishou68@users.noreply.github.com
Summary by CodeRabbit