fix: harden MCP statement output surface#777
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces memory-safe output capturing and rejects backslash meta commands in the MCP execute_statement handler. Specifically, it adds an mcpOutputCapture helper to truncate output exceeding 1MB and updates the handler to reject meta commands like shell execution, output redirection, and teeing. Additionally, it refactors progress bar initialization to only instantiate when a TTY is available, preventing progress bar output from corrupting non-TTY streams (such as MCP). Comprehensive tests have been added to verify these behaviors. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Code Metrics Report📊 View detailed coverage report (available for 7 days)
Details | | main (ec3190b) | #777 (aec0bd4) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 73.1% | 73.1% | +0.0% |
| Files | 87 | 87 | 0 |
| Lines | 7814 | 7840 | +26 |
+ | Covered | 5715 | 5736 | +21 |
+ | Code to Test Ratio | 1:1.3 | 1:1.3 | +0.0 |
| Code | 18201 | 18256 | +55 |
+ | Test | 24473 | 24564 | +91 |
- | Test Execution Time | 1m39s | 1m42s | +3s |Code coverage of files in pull request scope (54.8% → 56.2%)
Reported by octocov |
Summary
Tests