Skip to content

fix(template): preserve millisecond readiness waits - #2135

Open
Elon-Jiang wants to merge 1 commit into
e2b-dev:mainfrom
Elon-Jiang:fix/ready-timeout-milliseconds
Open

Elon-Jiang wants to merge 1 commit into
e2b-dev:mainfrom
Elon-Jiang:fix/ready-timeout-milliseconds

Conversation

@Elon-Jiang

@Elon-Jiang Elon-Jiang commented Nov 13, 2026 •

Copy link
Copy Markdown

wait_for_timeout(1500) and waitForTimeout(1500) currently generate sleep 1, letting a template become ready up to 999 ms before the requested wait. Preserve fractional seconds in both SDKs while keeping the one-second minimum and whole-second command spelling. The shared Python helper covers both sync and async templates.

Fixes #2134.

Template().from_python_image().set_start_cmd("python app.py", wait_for_timeout(1500))
# readiness command: sleep 1.5
Template().fromPythonImage().setStartCmd('node app.js', waitForTimeout(1500))
// readiness command: sleep 1.5

The new regression fails on each unchanged implementation. On macOS arm64, executing the public Python helper's actual shell command for 1,500 ms took about 1.02 s before the fix and 1.63 s afterward. The regression also covers 1,001 ms and 1,234,567 ms. Existing tests retain whole-second and minimum-duration controls.

Validation: Python shared-template tests, 114 passed / 1 skipped; JavaScript template utility tests, 88 passed / 3 skipped; SDK build and repository pnpm run format, pnpm run lint, and pnpm run typecheck passed. Lint emits three existing require-yield warnings in untouched tests. No live cloud-sandbox or provider test was run. The SDK docstrings and changeset describe the precision correction; the documented millisecond unit and minimum stay the same.

Prepared with Codex assistance for investigation, implementation and validation under the contributor's authorization.


Devin Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-13T08:39:19.337040Z 21e4e15 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.

TASTE.md review: no violations found — checked JS/Python parity (T-1, T-2: waitForTimeout/wait_for_timeout emit identical sleep commands, shared Python helper covers sync+async), shell-command composition (T-43), defaults/constants (T-47), and docstrings (T-69–T-71); 0 inline comments.

@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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

waitForTimeout and wait_for_timeout truncate millisecond waits

1 participant