-
Notifications
You must be signed in to change notification settings - Fork 1
fix: VSCode Jupyter Logging #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ects fail on init.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses VSCode Jupyter rendering issues and improves server connection error handling. The main changes disable Rich's Jupyter detection when running in VSCode and remove the alternate screen buffer usage from Live displays, which caused styling problems in Jupyter notebooks. Additionally, the PR introduces a configurable timeout parameter for API requests with a shorter connect timeout for faster failure detection.
- Disables Rich's Jupyter detection in VSCode environments to fix styling issues
- Removes
screen=Truefrom Live displays to prevent rendering problems in Jupyter notebooks - Adds configurable timeout parameter to ApiClient with shorter connection timeout
- Improves error messages to include the actual server URL
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dreadnode/logging_.py | Adds VSCode detection to disable Jupyter mode and fixes import organization |
| dreadnode/optimization/console.py | Removes screen=True parameter from Live display to fix VSCode Jupyter rendering |
| dreadnode/eval/console.py | Removes screen=True parameter from Live display to fix VSCode Jupyter rendering |
| dreadnode/api/client.py | Adds timeout parameter with shorter connect timeout and improves error message formatting |
| dreadnode/main.py | Improves error message to show actual server URL instead of generic message |
| docs/sdk/main.mdx | Updates documentation to reflect improved error message |
| docs/sdk/api.mdx | Documents new timeout parameter and other ApiClient improvements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dreadnode/logging_.py
Outdated
| ) | ||
| ) | ||
|
|
||
| # In vscode juputer, disable rich's jupyter detection to avoid issues with styling |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: "juputer" should be "jupyter".
| # In vscode juputer, disable rich's jupyter detection to avoid issues with styling | |
| # In vscode jupyter, disable rich's jupyter detection to avoid issues with styling |
dreadnode/api/client.py
Outdated
| return f"{response.status_code}: {obj.get('detail', json.dumps(obj))}" | ||
| except Exception: # noqa: BLE001 | ||
| return str(response.content) | ||
| return f"{response.status_code}: {response.content.decode()}" |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The decode() call without explicit encoding or error handling could raise a UnicodeDecodeError. Consider using decode('utf-8', errors='replace') to handle non-UTF-8 responses gracefully, similar to the pattern used elsewhere in the codebase (e.g., in dreadnode/agent/tools/execute.py).
| return f"{response.status_code}: {response.content.decode()}" | |
| return f"{response.status_code}: {response.content.decode('utf-8', errors='replace')}" |
* Some fixes for vscode jupyter styling. Small fix for when server connects fail on init. * Fix pre-commit while I'm here * More pre-commit fixes * refactor(image): Explicitly cast array returns * More pre-commit fixes * Some fixes from co-pilot * Notebook cleanup * Unwind a type change * More type fixes? --------- Co-authored-by: Brian Greunke <briangreunke@pm.me>
Key Changes:
Generated Summary:
timeoutparameter to theApiClientconstructor, defaulting to 30 seconds.timeoutvalue for HTTP requests.cookiesandtimeoutparameters in bothapi.mdxandclient.py.EvalConsoleAdapterandStudyConsoleAdapterclasses to streamline the use of theLivecontext manager, removing thescreenflag.This summary was generated with ❤️ by rigging