fix(agent, cli): Gemini bugfixes, add fallback if pty isn't available - #1123
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Publishable packages changed
Add |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe changes strengthen resilience in Gemini response parsing with guarded candidate and parts extraction, early returns for missing data, and expanded browser action name support; and introduce graceful PTY fallback to non-interactive execution when remote PTY initialization fails. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@libs/python/agent/agent/loops/gemini.py`:
- Around line 840-842: The long chained getattr that builds _dbg_parts is
causing Black to fail; break the expression into smaller, Black-friendly
statements by first assigning _dbg_candidates = getattr(response, "candidates",
None) or [], then compute candidate = _dbg_candidates[0] if _dbg_candidates else
None, then content = getattr(candidate, "content", None), and finally set
_dbg_parts = getattr(content, "parts", None) or []; keep the subsequent for p in
_dbg_parts loop unchanged so the logic remains identical but formatted across
multiple lines for Black compatibility.
In `@libs/python/cua-cli/cua_cli/commands/do.py`:
- Around line 1466-1468: When catching _PtyUnavailable, handle the case where
command is empty by invoking the interactive fallback instead of
_cmd_shell_noninteractive; specifically, check if command is falsy in the except
block and call the interactive handler (e.g., _cmd_shell_interactive(...)) with
the same args, otherwise call _cmd_shell_noninteractive(command, args);
reference _PtyUnavailable, command, args, _cmd_shell_noninteractive and
_cmd_shell_interactive to locate and update the except block.
📦 Publishable packages changed
Add |
Summary by CodeRabbit