redirect error prints to stderr to avoid corrupting MCP stdio transport#98
redirect error prints to stderr to avoid corrupting MCP stdio transport#98MatthewKhouzam wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe PR adds a ChangesError Output Redirection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 (2)
tsp/tsp_client.py (2)
186-186: ⚡ Quick winMisleading error message.
The error message says "get trace failed" but this is in the
fetch_experimentmethod. Since you're already modifying this line, consider correcting the message to "get experiment failed".📝 Proposed fix for error message clarity
- print("get trace failed: {0}".format(response.status_code), file=sys.stderr) + print("get experiment failed: {0}".format(response.status_code), file=sys.stderr)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tsp/tsp_client.py` at line 186, In the fetch_experiment function update the stderr print so the error text correctly reflects the operation: change the message from "get trace failed" to "get experiment failed" while keeping the status code (response.status_code) and file=sys.stderr intact so the log remains informative.
667-667: ⚡ Quick winCopy-paste error in error message.
The error message says "post extension failed" but this is in the
delete_configurationmethod. Since you're already modifying this line, consider correcting the message to "delete configuration failed".📝 Proposed fix for error message clarity
- print("post extension failed: {0}".format(response.status_code), file=sys.stderr) + print("delete configuration failed: {0}".format(response.status_code), file=sys.stderr)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tsp/tsp_client.py` at line 667, The error log in delete_configuration mistakenly says "post extension failed"; update the message in the delete_configuration method to accurately reflect the operation by changing the printed string to "delete configuration failed" (keep including the response.status_code as before) so the print call correctly reads that the delete configuration request failed; locate the print in delete_configuration and replace the misleading text only.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tsp/tsp_client.py`:
- Line 186: In the fetch_experiment function update the stderr print so the
error text correctly reflects the operation: change the message from "get trace
failed" to "get experiment failed" while keeping the status code
(response.status_code) and file=sys.stderr intact so the log remains
informative.
- Line 667: The error log in delete_configuration mistakenly says "post
extension failed"; update the message in the delete_configuration method to
accurately reflect the operation by changing the printed string to "delete
configuration failed" (keep including the response.status_code as before) so the
print call correctly reads that the delete configuration request failed; locate
the print in delete_configuration and replace the misleading text only.
arfio
left a comment
There was a problem hiding this comment.
I did not see any other places where this change was required, so this change looks good to me!
What it does
Removes STDout to allow mcps to work
How to test
Run it.
Follow-ups
Will add a flag for stdout.
Review checklist
Summary by CodeRabbit