Skip to content

enh: providers - #18

Merged
echarles merged 5 commits into
mainfrom
enh/providers
Aug 20, 2026
Merged

enh: providers#18
echarles merged 5 commits into
mainfrom
enh/providers

Conversation

@echarles

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings August 20, 2026 16:24
@echarles
echarles merged commit 2ed3ef7 into main Aug 20, 2026
2 of 6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

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 expands the Code Sandboxes surface around “providers” by adding a central provider/credential registry, enhancing remote-provider session behavior (Kaggle batch sessions + Kaggle live sessions + Modal stateful sessions), and standardizing the Jupyter variant name to jupyter-server across the library, CLI, docs, examples, and tests.

Changes:

  • Introduces code_sandboxes.providers to describe each provider’s requirements, availability, and environments for cataloging/UX use.
  • Renames the canonical Jupyter variant string from jupyter to jupyter-server and updates call sites/docs/tests accordingly.
  • Adds stateful execution improvements: Modal gets a persistent “driver” process; Kaggle gets batch-session replay and an opt-in live persistent-kernel mode via a dataset “bus”.

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_sandboxes.py Updates Jupyter variant enum expectation and sandbox class name.
tests/test_models.py Updates Jupyter variant enum expectation.
tests/test_modal_session.py Adds subprocess-based tests validating Modal driver session semantics.
tests/test_manage.py Updates manager coverage for jupyter-server.
tests/test_kernel_client_compatibility.py Adds protocol/signature compatibility tests against jupyter_kernel_client.
tests/test_kaggle_session.py Adds tests for Kaggle batch session replay/sentinel trimming.
tests/test_kaggle_live.py Adds end-to-end-ish tests for Kaggle live dataset bus behavior using fakes.
tests/test_jupyter_server.py Renames test imports/fixtures from JupyterSandbox to JupyterServerSandbox.
tests/test_factory.py Updates factory tests for the renamed Jupyter server variant/class.
tests/test_cli_repl.py Updates CLI REPL tests to use jupyter-server.
examples/repl/Makefile Renames jupyter target to jupyter-server; adds Kaggle live/batch GPU targets.
examples/repl/kaggle_sandbox_example.py Adds KAGGLE_LIVE and KAGGLE_GPU flows and clarifies batch session behavior.
examples/repl/jupyter_server_sandbox_example.py Updates example to use variant="jupyter-server".
examples/exec/monty_sandbox_example.py Aligns output formatting with shared exec example helper.
examples/exec/modal_sandbox_example.py Improves example output semantics and validates error-path behavior.
examples/exec/Makefile Renames jupyter target to jupyter-server.
examples/exec/kaggle_sandbox_example.py Improves readability by printing code first; aligns output conventions.
examples/exec/jupyter_server_sandbox_example.py Renames variant to jupyter-server and updates example commentary.
examples/exec/google_colab_sandbox_example.py Aligns output conventions with shared exec helper.
examples/exec/exec_common.py Refactors example helper to print code + normalized results consistently.
examples/exec/eval_sandbox_example.py Aligns output conventions with shared exec helper.
examples/exec/docker_sandbox_example.py Aligns output conventions with shared exec helper.
examples/exec/datalayer_sandbox_example.py Aligns output conventions with shared exec helper.
docs/docs/sandboxes/kaggle.mdx Documents batch sessions (replay) and opt-in live mode tradeoffs.
docs/docs/sandboxes/jupyter-server.mdx Updates docs to reference JupyterServerSandbox and jupyter-server variant.
docs/docs/sandboxes/index.mdx Updates canonical variant list and module import examples.
docs/docs/index.mdx Updates variants table to jupyter-server.
docs/docs/examples/index.mdx Updates example link to jupyter server example path.
docs/docs/comparison/index.mdx Updates variant list string to jupyter-server.
docs/docs/cli/management.mdx Updates manager usage examples/table for jupyter-server.
docs/docs/cli/index.mdx Updates CLI supported variants and variant-specific behavior section.
docs/docs/api-reference/index.mdx Updates API reference to list jupyter-server as supported variant.
code_sandboxes/providers.py Adds provider registry, requirement checks, availability + catalog helpers.
code_sandboxes/models.py Renames SandboxVariant.JUPYTER value to jupyter-server.
code_sandboxes/modal_sandbox.py Adds persistent session driver + new Modal environments; updates var get/set messaging.
code_sandboxes/manage.py Renames Jupyter manager and updates manager mapping + normalization.
code_sandboxes/kaggle_sandbox.py Adds batch session replay and opt-in live session mode.
code_sandboxes/kaggle_live.py Adds dataset-bus transport and live agent kernel implementation.
code_sandboxes/kaggle_execute.py Renames internal prefixes/slugs for code-sandbox naming consistency.
code_sandboxes/jupyter_server_sandbox.py Renames class to JupyterServerSandbox and updates variant/env metadata.
code_sandboxes/cli.py Updates CLI defaults and variant handling for jupyter-server.
code_sandboxes/base.py Updates factory/list_environments dispatch to jupyter_server.
code_sandboxes/version.py Bumps version to 1.0.10.
code_sandboxes/init.py Exports JupyterServerSandbox and provider registry symbols.
Suppressed comments (1)

code_sandboxes/base.py:387

  • Sandbox.list_environments() no longer recognizes the legacy variant="jupyter" spelling after the rename to jupyter-server. If any callers still pass "jupyter" (there are in-repo examples), this will now raise ValueError instead of listing the Jupyter server environments. Consider accepting both spellings here for backward compatibility.
        if variant_value == "jupyter_server":

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread code_sandboxes/base.py
Comment on lines +289 to 295
# In one normal form, as every dispatcher here reads it: the value of
# a variant may carry a dash — `jupyter-server` — and callers type
# either spelling.
variant_value = (
variant.value if isinstance(variant, SandboxVariant) else variant
).replace("-", "_")

Comment on lines +559 to +562
else:
# Only a snippet that completed joins the session — see the batch
# path, which records under the same condition.
self._record_session(code)
Comment on lines +128 to +132
def read() -> list[SandboxEnvironment]:
from .base import Sandbox

return Sandbox.list_environments(variant=variant)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants