Skip to content

bug(platform): sandboxes reports Task stopped when the sandbox refuses cancellation #3677

Closed

Description

@yannickmonney

Sandboxes reports Task stopped when the sandbox refuses cancellation

Confirmed at 44e0dcf254975286c0e9dea443b5cd1ca6b23347. Suggested severity: P2.

An administrator is told work has stopped when its cancellation was refused. Work can continue while the administrator relies on the success confirmation.

Reproduce:

  1. Have an administrator open Settings > Sandboxes with a workspace containing a running operation.
  2. Make that operation’s sandbox cancel endpoint return HTTP 503, using a controlled local transport.
  3. Choose the workspace row’s Stop task action. Inspect the app response and notification.

Expected: A refused cancellation must surface a failure or partial result and must not be counted as a successfully cancelled operation.

Actual: The real sandbox client returns false for HTTP 503, but the route ignores the boolean and increments cancelled. The app responds HTTP 200 {cancelled:1}. The actual settings component and write adapter turn that response into the success toast “Task stopped.”

Controls: The same fixture with HTTP 200 {killed:true} returns cancelled=1. A wrong-organization request returns 404 and a developer request 403 without contacting the sandbox. A direct app HTTP 503 response produces the destructive error toast instead of Task stopped. HTTP 200 {killed:false} is also incorrectly counted as 1.

Source:

Observed output: Sandbox503 → app200 {cancelled:1} → Task stopped. Positive cancellation → app200 {cancelled:1}. Foreign404; developer403; application503 → destructive error.

Frozen proof: /Users/yannick/.codex/notes/tale-100-findings/runtime-proof/frozen/batch-01/runtime-api.ts, runtime-api-results.json, runtime-api.log, runtime-ui.test.tsx, runtime-ui.log, with sha256.json. API assertions and all 8 UI/adapter probes passed. Retained fixture database: tale_runtime_proof_20260928_mul1dhlf. The launcher allocates a new database on each replay and does not clean up existing state.

python3 /Users/yannick/.codex/notes/tale-100-findings/runtime-proof/run-runtime-api.py
/Users/yannick/.npm/_npx/22f2fe8d8bc13000/node_modules/.bin/bun x --no-install vitest run --config /Users/yannick/.codex/notes/tale-100-findings/runtime-proof/vitest.config.ts runtime-ui.test.tsx --maxWorkers=1 --testTimeout=30000 --reporter=verbose

Limits: Pinned local execution only. Actual Hono routes, membership checks, SQL and sandbox client parsing run against a newly allocated, retained QA database. Authentication sessions and final HTTP transport are synthetic. Every sandbox/device HTTP call is intercepted and unexpected calls fail; no sandbox, provider, CLI connection, browser, or production action runs. Component probes use actual React components and write adapters, with controlled query responses. This does not claim observed live-process termination or live-device connectivity.

Deduplication: No matching stop-success/refusal root. #3494 is provisioning-failure teardown, not cancellation response. Cached 931 all-state issues and 89-entry ledger checked; Final parent review is recorded below.

Independent parent verification

Independently reran the real-router/PostgreSQL API proof and all 8 component/adapter observation and control tests: both commands exited 0 (UI: 2.89 seconds). Logs: runtime-proof/parent-runtime-api.log and runtime-proof/parent-runtime-ui.log. The API dispatcher recorded zero external requests. Live all-state GitHub searches for sandbox cancel, sandbox metrics duplicate, sandbox developer placements, sandbox capacity unavailable and Add device found no matching root. Checked these five reports against one another and the accepted ledger; stop-result handling, join cardinality, placement redaction, unavailable placement display and enrollment correlation are separate causes.

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

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions