-
Notifications
You must be signed in to change notification settings - Fork 1.8k
add stateful jupyter notebook option and make browser more reliable #199
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
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
self._jupyter_session: LocalJupyterSession | None = None | ||
self._execution_lock: asyncio.Lock | None = None | ||
|
||
if self._execution_backend == "dangerously_use_local_jupyter": | ||
self._execution_lock = asyncio.Lock() | ||
self._jupyter_session = LocalJupyterSession( | ||
connection_file=self._local_jupyter_connection_file, |
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.
Instantiate local Jupyter lock without running event loop
When the Python tool is configured for the new dangerously_use_local_jupyter
backend, the constructor immediately executes self._execution_lock = asyncio.Lock()
. asyncio.Lock
calls get_running_loop
, so constructing PythonTool()
in synchronous code (e.g. in gpt_oss/chat.py
or gpt-oss-mcp-server/python_server.py
) now raises RuntimeError: no running event loop
whenever PYTHON_EXECUTION_BACKEND
is set to this backend. That means the CLI and MCP server crash before they even start when users enable the stateful Jupyter option. The lock should be created lazily inside an async context or via a loop-safe factory so the tool can still be instantiated outside a running loop.
Useful? React with 👍 / 👎.
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.
@codex can you fix it?
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.
Note
To use Codex here, create an environment for this repo.
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.
@codex please try again
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.
Note
To use Codex here, create an environment for this repo.
[deleted comment that was just "Yes 🚀" that might mess with the codex flow] |
functions.browser.search
as opposed tobrowser.search
as long as there is no conflicting function defined.