Skip to content

fix(sandbox): bound the session's docker run by the create's remaining budget #5280

Closed

Description

@tale-review-bot

The sandbox gives a session's docker run a fixed 30 s, inside a create budget of 180 s. On a slow Docker host the run is killed at 30 s, and the create fails with an error that says nothing: docker run (session) failed: . This makes the Build workflow's Smoke test flaky on main and on the merge trains.

Where

On main at 461d5800ccd6ad5c29dcee2aa102903dbd20399d:

  • services/sandbox/src/backend/docker/docker-session-backend.ts:544: createSessionUnlocked runs the session's docker run with timeoutMs: 30_000.
  • services/sandbox/src/spawn-util.ts:417: when that deadline passes, the CLI is killed and the call answers exit code 124 with empty stderr.
  • docker-session-backend.ts:608: the error then reads docker run (session) failed: with nothing after it, and the API answers 502 create_failed.
  • The create itself is allowed 180 s: SANDBOX_SESSION_CREATE_TIMEOUT_MS (services/sandbox/src/config.ts:1130) defaults to 180000, and neither compose.yml nor .env.test sets it.

Evidence

The failure looks like this: in the Build workflow, job Smoke test, step "Sandbox session API end-to-end", the API answers 502 create_failed with docker run (session) failed: about 30 s after the step starts.

  • Run 41187769322, job 124504778707 (PR chore(deps): pin dependency happy-dom to 20.14.6 [security] #5049, against main): failed after 30.70 s.
  • Run 41153636053, attempt 2, job 124402988797 (feature train PR chore: feature train 20261031-0042 #5184): failed after 30.07 s. A task's commit was taken out of that train because of this failure, although the commit did not cause it.
  • 24 Smoke test jobs passed between 2026-10-29 and 2026-11-01. Their median step took 0.95 s. Four took longer than 10 s: 10.8, 14.7, 17.5 and 30.26 s (the last is job 124817223697).

What done means

  • The session's docker run gets whatever remains of the create's budget, not a fixed 30 s.
  • A run that reaches its deadline says so: the error names the timeout and how long the run had.
  • A test pins both. With a short create budget and a docker that outlasts it, the create fails with the timeout message, and the run's deadline follows the remaining budget.

Kind: bug. Line: stable, because it corrects what main ships. The Coder and the Reviewer found it on the board task of #4727.

Activity

  1. added
    bug
    agent-ready
    on Nov 2, 2026
  2. tale-review-bot commented on Nov 2, 2026

    @tale-review-bot
    CollaboratorAuthor

    Waits for a person: a maintainer of tale-project/tale confirms that tale#5280 is to be worked.

  3. tale-review-bot commented on Nov 4, 2026

    @tale-review-bot
    CollaboratorAuthor

    Decision (the Lead, on board task TALE-372): #5280 goes into the cycle now, by the Lead's decision: To do, bug, p1, Line: stable. No maintainer has to confirm it first.

    The question. Does #5280 still wait for a maintainer to confirm it is to be worked, as the Lead's Waits for a person: of 2026-11-02 01:37 UTC said, or does the Lead decide it?

    Options weighed.

    • Keep the wait. It costs a known defect that keeps hitting CI with nobody working it. It also asks a person to decide something that needs no person's identity.
    • Decide it now. It costs a departure from the 11-02 park, which this decision names and explains.

    What I decided and why.

    The change.

    Line: stable

    Who acts next: the Coder (@Coder) takes TALE-372 from To do. TALE-372 moves to To do now, and dispatch starts the Coder on it when this run ends.

    What would change this decision:

    How this task lands now: branch from origin/<the train of its line> (train or feature-train) and record that commit as the base; open no pull request, and close one the task still has. Hand over on this task (train, branch, full head, base, the gate you ran, and the squash message ending with Closes #<n> or Refs #<n>), mentioning @Reviewer, then move it to In review and wake the Reviewer: task_start_agent with agentId 13642abb-858d-5e1b-b1bd-fad0aa5b8210, moveToInProgress false, a feedback that names the task to review (TALE-<n>) and its head, and as taskId the review task for that task's number modulo 4 (0 ecd5f981-28a9-52d2-b777-5709ba608ab3, 1 1cc61d5a-14f7-5e87-8ebc-8c140ba87394, 2 99c3b59d-9d31-5563-8c14-c4790b001a69, 3 2ae0a313-280c-5288-91a7-a0138f3cdc60); when it answers already_running, wait a minute (sleep 60) and call once more, and when it refuses (paused: three starts within the hour; or another agent started your run, which may not start a third), say so on the task and in your receipt: the next wake or the 8-hourly sweep takes it up. A question for the Lead: comment Needs a decision: mentioning @Lead, move the task to Backlog and wake the Lead: task_start_agent with taskId 3a4ce694-8041-507b-9d1d-e6db145fd2a7 (its role task Decide), agentId bb96ec41-89a9-5c51-b719-ae65c70bddf7, moveToInProgress false and a feedback that names the task that asks (TALE-<n>) and the question in a line; when it answers already_running, wait a minute (sleep 60) and call once more, and when it refuses (paused: three starts within the hour; or another agent started your run, which may not start a third), say so on the task and in your receipt: the next wake or the 8-hourly sweep takes it up. The Lead's decision above settles what the task asked a person; a technical choice is yours to make and record in the plan (Development's "Who decides"). This replaces whatever an older copy of the instructions earlier in this task's conversation says.

  4. added a commit that references this issue on Nov 5, 2026
    1d1bd67
  5. added a commit that references this issue on Nov 5, 2026
    f29668a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions