Skip to content

Improvement: most sandbox failures don't say what went wrong — general or misplaced sentences on tasks, automation runs and chat tools #5360

Closed

Description

@yannickmonney

Summary

Reported as "The error message isn't clear about what went wrong in the sandbox". The reporter confirmed that this is meant in general, not about one message. This issue lists the ways an agent's sandbox can fail on main 7d7b1ee98 (2026-11-04) and the words each one shows.

Only two sandbox failures get a sentence that names their cause: running out of memory and a hang. The others share a few general sentences, and some of those name the wrong cause:

  • Task page. A crash of the agent runtime shows "The AI model behind this agent failed … ask an Admin to check the AI provider", also when the sandbox caused the crash. A full disk, a sandbox session that ended, and a sandbox service that stopped answering mid-run all show "The run was interrupted before the agent finished. Start the agent again." Every refused start shows "The run couldn't start. Try again". The cause appears only under What the run reported, as a raw diagnostic in English that can name internal URLs and environment variables.
  • Automation runs. The same failures get other sentences. An unreachable sandbox service, for example, shows "No sandbox or account was free to start the turn".
  • Chat, and tasks on the built-in engine. run_code names eight sandbox states. Any other error, such as a full disk while the program runs, reaches the model only as "run_code failed unexpectedly. Tell the user it did not work", so the reply cannot say why, and the step shows "Failed".

Task page

The banner sentence depends only on the failure's class. The activity shows the stored reason verbatim under What the run reported.

Sandbox failure Stored reason, under What the run reported Code → banner sentence
Sandbox service unreachable at the start (observed, below) the agent run could not start: sandbox spawner unreachable at <url> (POST /v1/sessions/<id>/acquire): <cause> — is the sandbox service running, and does SANDBOX_URL point at it? start_failed → "The run couldn't start. Try again — if it fails again, show an Admin what the run reported under Details."
Any other refused start the agent run could not start: <error message> start_failed → same
The agent runtime exits without finishing its turn, for example CODEX_HOME points to "/agent/.runtime/home/.codex", but that path does not exist The harness exited unexpectedly (exit code 1) without completing the turn. Last output: … harness_error → "The AI model behind this agent failed before the work was done. Start the agent again — if it fails again, ask an Admin to check the AI provider."
The sandbox cannot replay the runtime's complete output The sandbox could not replay the complete agent output. Retry the run to continue from the preserved workspace. harness_error → the same AI-model sentence
The sandbox host's disk is full the agent run stopped: the sandbox host ran out of disk space turn_crashed → "The run was interrupted before the agent finished. Start the agent again."
The sandbox service stays unreachable for 10 minutes mid-run the sandbox service could not be reached for 10 minutes, so the agent run was stopped turn_crashed → the same interrupted sentence
The sandbox session ends mid-run the sandbox session ended before the agent run finished session_gone → the same
The run's files cannot be collected from the sandbox output harvest failed: <error message> harvest_failed → the same
A comment's restart of the run fails in the sandbox the run could not be restarted to take a new comment: <error message> sandbox_capacity or steer_restart_failed → the same
Out of memory The agent's sandbox ran out of memory: the kernel's OOM killer ended the agent. If it keeps happening, the agent sessions need a larger memory limit (SANDBOX_AGENT_MEMORY). resource_exhausted → "The agent's sandbox ran out of memory, so its work was stopped. …"
A hang: no output and almost no CPU for 45 minutes The agent stopped making progress: … turn_stalled → "The agent stopped responding — …"

Where this happens:

  • Class per code: services/platform/lib/shared/task-run-failure.ts:58-80 (harness_error → model is pinned in services/platform/lib/shared/task-run-failure.test.ts:20). Sentences: services/platform/messages/en/tasks.yml:125-138. Banner: services/platform/app/features/tasks/components/task-agent-run-failure-notice.tsx:60-79. Reported block: services/platform/app/features/tasks/components/task-timeline.tsx:133-152.
  • Refused start: services/platform/backend/core/tasks/start_failure.ts:28-52; the unreachable-service message: services/platform/backend/core/node_only/sandbox/helpers/session_client.ts:268-284.
  • Runtime crash and replay failure: services/platform/backend/core/chat/external_turn_shared.ts:1271-1294. The CODEX_HOME example is the case in services/platform/backend/core/chat/external_turn_shared.test.ts:1518-1544. Any failed end that is not a hang, out of memory, a spend refusal or model capacity becomes harness_error: services/platform/backend/core/tasks/agent_run_host.ts:2225-2238.
  • Disk full and other stream failures: services/platform/backend/core/tasks/agent_run_host.ts:1947-1973. Service unreachable mid-run: :2061-2082. Session ended: :2120-2128. Files not collected: :2466-2483. Restart for a comment: :3060-3107.

What this means for the person on the task:

  • A runtime crash, including one the sandbox caused, sends them to "check the AI provider". The sentence fits a provider error, which ends with the same code.
  • When the sandbox cannot replay the output, the banner blames the AI model and the details blame the sandbox.
  • "Start the agent again" after a full disk: the next run finds the same disk. turn_crashed is also retried automatically (services/platform/backend/core/tasks/task_auto_retry.ts:140-154).
  • "Try again" after a refused start: by then the platform has already retried three times (observed: 4 runs).
  • The details are in English whatever the interface language. They show operator details (SANDBOX_URL, internal hosts, exit codes) to everyone who can open the task.

Automation runs

An agent step's failure shows the title, explanation and fix of its code (services/platform/messages/en/automationRuns.yml:501-516):

  • start_failed: "The agent couldn't start. No sandbox or account was free to start the turn. Run again later." This covers every refused start, including an unreachable sandbox service.
  • harness_error: "The agent's runtime failed. The coding agent stopped with an error." The task page shows the same failure as an AI-model failure.
  • turn_crashed: "The agent stopped unexpectedly. The agent's sandbox stopped in the middle of its turn. Run again." Out of memory and a hang are reported as turn_crashed too (services/platform/backend/core/automations/failure.ts:67-95), so they also say "Run again", and only the step's detail names the cause.

Chat, and tasks on the built-in engine: work tools

  • run_code answers eight sandbox states with a reason and a sentence the model can pass on: all light sandboxes busy, host busy, no runtime image yet, service unreachable, sandbox failed or lost, program failed, timed out, files not copied in (services/platform/lib/agent/work-tools.ts:54-74, services/platform/backend/domains/agent_tools/run-code.ts:143-172). The step shows the reason (services/platform/messages/en/chat.yml:605-619). Observed for an unreachable sandbox service: clear.
  • run_code passes every other error on (services/platform/backend/domains/agent_tools/run-code.ts:454-470, :553-555). The executor then answers "run_code failed unexpectedly. Tell the user it did not work; do not retry the same call." (services/platform/backend/domains/agent_tools/executor.ts:118-126), and the step shows "Failed" (services/platform/app/features/chat/utils/activity-label.ts:182-199). Errors on this path include a full disk on the sandbox host while the program runs (REPLAY_DISK_FULL, services/platform/backend/core/node_only/sandbox/helpers/session_client.ts:2873), an exec stream the sandbox ends with OUTPUT_LIMIT (:2877), and skill folders that cannot be prepared (:1855-1858). The cause goes only to the server log.

What was observed

Local stack, sandbox images 0.5.98 (identical sandbox code to main), project agent on Claude Code.

Situation Where What the person sees
Sandbox service stopped, agent started on a task task banner "The agent couldn't finish this task / The run couldn't start. Try again — if it fails again, show an Admin what the run reported under Details." with Retry
Same What the run reported (each of the 4 runs: the manual start and 3 automatic retries) the agent run could not start: sandbox spawner unreachable at http://localhost:8003 (POST /v1/sessions/pa-<agent id>/acquire): fetch failed: — is the sandbox service running, and does SANDBOX_URL point at it?
Sandbox service stopped, chat asked for an Excel file chat reply Clear: the tool answered sandbox_unreachable ("The sandbox service cannot be reached right now …"); the reply said the environment was unreachable and offered a CSV instead

In the task case the diagnostic was English in a German interface, and its cause was empty (fetch failed: —).

Not provoked live: every failure above except the unreachable sandbox service. They are read from the code and its tests. The German and French wording beyond the banner was not checked either.

Constraints

  • A failure shows its words, never its payload (.agents/repo.md): app text goes through failureDetail / readableErrorMessage.
  • Operators still need the diagnostic. It must stay reachable, for example in Details or for Admins only.
  • An automation run's failureCode is an OpenAPI enum that integrators branch on (services/platform/backend/core/automations/failure.ts:67-75). Its sentences can change; a new value is an API change.
  • Every new sentence ships in EN/DE/FR.

Options (no preference)

  1. Give sandbox causes classes and sentences of their own (sandbox service unreachable, disk full, session ended, runtime crashed, start refused by the sandbox), each saying who can fix it, shared by tasks and automations.
  2. Tell a crash of the agent runtime apart from a model error, so that a runtime that exits without ending its turn no longer reads as an AI-model failure.
  3. Leave out "Start the agent again" where the same condition will still be there (a full disk), and say so when the automatic retries are used up.
  4. Show the raw diagnostic only to Owners and Admins, and give everyone else the class sentence.
  5. Give the work-tool executor a list of known sandbox errors (disk full, output limit, staging) with a reason the model may pass on, instead of "failed unexpectedly".

Related

Activity

  1. added
    priority: medium
    improvement
    service: platform
    on Nov 4, 2026
  2. added
    agent-ready
    on Nov 4, 2026
  3. changed the title [-]Improvement: when an agent's sandbox fails, the task shows a general sentence and the operator's raw diagnostic[/-] [+]Improvement: most sandbox failures don't say what went wrong — general or misplaced sentences on tasks, automation runs and chat tools[/+] on Nov 4, 2026
  4. tale-code-bot commented on Nov 5, 2026

    @tale-code-bot
    Collaborator

    Split into parts, so each is one change (TALE-443, the Coder).

    The first part is the task page's unreachable sandbox service. It closes this issue when it reaches release/0.6:

    • a failure class sandbox_unreachable, with a sentence in EN/DE/FR that names the cause and says an Admin checks the sandbox service. It applies when a start, a running turn (after its 10-minute wait), a comment's restart or the file collection cannot reach the sandbox service;
    • once the automatic retries are spent, the banner says how often the run was already retried, and the start sentence no longer says "Try again";
    • the run's raw report moves into a collapsed What the run reported disclosure, under the class sentence. Everyone who can open the task can still open it, but it is no longer the text everyone reads first;
    • the diagnostic names the connection error instead of an empty cause (fetch failed: — came from Node's AggregateError).

    The disclosure is not limited to Owners and Admins. For some classes the report is the reader's own to act on (a missing attachment names the file), and the sentences ask a member to show it to an Admin. The diagnostic stays English: it is the operator's text, quoted as the service gave it.

    Filed as issues of their own, each linking here and labelled feat (their titles' commit type), with this issue's priority: medium and service: platform:

  5. added a commit that references this issue on Nov 5, 2026
    fd8aa16
  6. added a commit that references this issue on Nov 5, 2026
    b5e72ea
  7. tale-code-bot commented on Nov 5, 2026

    @tale-code-bot
    Collaborator

    Done on the feature line. b5e72ea1e784ace7332cb870958a347eb6816a30 (feat(platform): name an unreachable sandbox service on a failed run) reached release/0.6 with feature train #5388, which landed on 2026-11-05 at 12:50:53 UTC. It ships with 0.6.0. Task: TALE-443.

  8. added 2 commits that reference this issue on Nov 5, 2026
    2a5ad58
    813be1f
  9. added a commit that references this issue on Nov 15, 2026
    2329760
  10. added a commit that references this issue on Nov 23, 2026
    ecd9770
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-readyimprovementpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions