Skip to content

Conversation

@monoxgas
Copy link
Contributor

@monoxgas monoxgas commented Nov 19, 2025

Key Changes:


Generated Summary:

  • Added a new timeout parameter to the ApiClient constructor, defaulting to 30 seconds.
  • Updated API client initialization to use the specified timeout value for HTTP requests.
  • Enhanced documentation to reflect the new cookies and timeout parameters in both api.mdx and client.py.
  • Improved error messages in the Dreadnode class to explicitly mention the server name in connection failures.
  • Minor modifications in the EvalConsoleAdapter and StudyConsoleAdapter classes to streamline the use of the Live context manager, removing the screen flag.
  • Introduced a check to disable Jupyter detection in VSCode for the logging console, preventing styling issues.

This summary was generated with ❤️ by rigging

@monoxgas monoxgas requested a review from Copilot November 19, 2025 19:43
@dreadnode-renovate-bot dreadnode-renovate-bot bot added area/docs Changes to documentation and guides type/docs Documentation updates and improvements labels Nov 19, 2025
Copilot finished reviewing on behalf of monoxgas November 19, 2025 19:46
Copy link
Contributor

Copilot AI left a 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=True from 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.

)
)

# In vscode juputer, disable rich's jupyter detection to avoid issues with styling
Copy link

Copilot AI Nov 19, 2025

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".

Suggested change
# 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

Copilot uses AI. Check for mistakes.
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()}"
Copy link

Copilot AI Nov 19, 2025

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).

Suggested change
return f"{response.status_code}: {response.content.decode()}"
return f"{response.status_code}: {response.content.decode('utf-8', errors='replace')}"

Copilot uses AI. Check for mistakes.
@dreadnode-renovate-bot dreadnode-renovate-bot bot added the area/github Changes made to GitHub Actions label Nov 19, 2025
@dreadnode-renovate-bot dreadnode-renovate-bot bot added the area/pre-commit Changes made to pre-commit hooks label Nov 19, 2025
@dreadnode-renovate-bot dreadnode-renovate-bot bot added the area/examples Changes to example code and demonstrations label Nov 19, 2025
@monoxgas monoxgas merged commit ccac0d7 into main Nov 21, 2025
8 checks passed
@monoxgas monoxgas deleted the fix/vscode-jupyter-logging branch November 21, 2025 20:32
mkultraWasHere pushed a commit that referenced this pull request Dec 3, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Changes to documentation and guides area/examples Changes to example code and demonstrations area/github Changes made to GitHub Actions area/pre-commit Changes made to pre-commit hooks type/docs Documentation updates and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants