Repository navigation
Conversation
…Command GetDefaultReadyCommand previously hard-coded three customer template IDs to use a 120 s wait instead of the standard 20 s. This made the function untestable, was a security concern (customer IDs in source), and blocked the TODO to make the timeout user-configurable. Changes: - Add StartCmdTimeout time.Duration to TemplateConfig; zero means the built-in default (20 s) is used, preserving backward-compat for every existing build request that omits the field. - Change GetDefaultReadyCommand(templateID string) to GetDefaultReadyCommand(startCmdTimeout time.Duration) and remove the three hardcoded IDs. - Update the sole call-site in builder.go to pass the new field. Migration: the three previously hard-coded templates should add an explicit ready_cmd (e.g. "sleep 120") to their build configuration so their 120 s wait is preserved. Closes e2b-dev#3349
ValentaTomas
force-pushed
the
main
branch
2 times, most recently
from
July 25, 2026 22:53
5aad415 to
d71980e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GetDefaultReadyCommandhard-codes three customer template IDs to extend the default ready-wait from 20 s to 120 s:This is a security concern (customer IDs in source), makes the function untestable, and blocks the TODO to make the timeout user-configurable.
Fixes #3349.
Solution
StartCmdTimeout time.DurationtoTemplateConfig. Zero (the zero value) means "use the built-in default (20 s)", preserving backward-compatibility for every existing build request that omits the field.GetDefaultReadyCommand(templateID string)→GetDefaultReadyCommand(startCmdTimeout time.Duration)and remove the three hardcoded IDs.builder.goto passppb.Config.StartCmdTimeout.StartCmdTimeoutis intentionally left un-wired from the proto/API in this PR so the diff stays minimal. A follow-up can expose it asstart_cmd_timeout_secinTemplateConfig.Migration
The three previously hard-coded templates should add an explicit
ready_cmdto their build configuration (e.g.ready_cmd: "sleep 120"in theire2b.toml) so their 120 s wait is preserved after this change.Test plan
go build ./packages/orchestrator/pkg/template/...passesready_cmdand nostart_cmdstill usessleep 0start_cmdand noready_cmdusessleep 20StartCmdTimeout: 120*time.Secondusessleep 120/cc @jakubno @dobrac @ValentaTomas @arkamar @tvi Looking forward to your code review.