Skip to content

docs(code-interpreter): document create_code_context request_timeout in seconds - #2146

Open
DZH166 wants to merge 1 commit into
e2b-dev:mainfrom
DZH166:codex/ccx-timeout-units-20261112
Open

DZH166 wants to merge 1 commit into
e2b-dev:mainfrom
DZH166:codex/ccx-timeout-units-20261112

Conversation

@DZH166

@DZH166 DZH166 commented Nov 14, 2026 •

Copy link
Copy Markdown

Summary

Sandbox.create_code_context() (both sync and async) documents request_timeout as
"Timeout for the request in milliseconds", but the value is passed straight through
to httpx as timeout=request_timeout or self.connection_config.request_timeout, and
httpx timeouts are in seconds.

A user following the docstring and passing request_timeout=30000 intending 30 seconds
gets a 30,000-second (~8.3 hour) request deadline instead. The milliseconds wording
looks like a copy-over from the JS SDK, where the equivalent parameter is genuinely
requestTimeoutMs. The same Python parameter is already documented in seconds by
run_code in the same classes, and ConnectionConfig.REQUEST_TIMEOUT is
60.0 # 60 seconds.

This PR fixes the two docstring lines (sync + async kept in parity) so the documented
unit matches the actual behavior. No runtime behavior changes.

Validation

  • pytest tests/charts tests/test_format_exception.py — 15 passed (one test,
    test_scatter_chart, requires a live sandbox fixture and errors without real
    credentials; pre-existing and unrelated to this change).
  • Docstring units check (ast-based, red → green): the check asserts every
    :param request_timeout: line in both create_code_context docstrings says
    seconds; it failed on main and passes after this change (logs:
    ccx-timeout-units-red.log / ccx-timeout-units-green.log).
  • ruff check . and ruff format --check . — clean.
  • ty check e2b_code_interpreter — 14 diagnostics, identical to main (verified via
    git stash); this change introduces 0 new diagnostics.
  • git diff --check — clean.

AI assistance

This change was located, prepared, and validated with AI assistance as part of a
community contribution; the analysis above (httpx timeout semantics, run_code
docstring, ConnectionConfig.REQUEST_TIMEOUT default, and JS requestTimeoutMs
naming) was verified against the repository sources before writing the fix.


Devin Review

@DZH166
DZH166 requested a review from mishushakov as a code owner November 14, 2026 19:16
@cla-bot

cla-bot Bot commented Nov 14, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @DZH166 on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check'

@changeset-bot

changeset-bot Bot commented Nov 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7125d94

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T19:18:27.357090Z 7125d94 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TASTE.md review: compliant, 0 violations. Checked T-1/T-2 (sync and async docstrings are both updated), T-44/T-45 (Python request_timeout is in seconds and gets passed straight to httpx timeout=), and T-69/T-71 (reST :param: docstring).

This branch has not been deployed

No deployments
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.

1 participant