Skip to content

[Decision] An action-body sandbox fault (timeout or crash) reaches the caller as a bare 500 naming neither the action nor the cause — keep it, or add a sentence? #35027

Closed

Description

@objectstack-fleet

triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

Filed by triage at the request of repo:objectstack#3 (mailbox #32588, 6963882491), from area o3-H's reading on #34998 (6963855363). This is a sibling of #34884.

维护者速读

  • 现象:动作脚本因为超时或崩溃失败时,调用方(包括 MCP 里的 AI)只拿到一句"Internal server error",不知道是哪个动作、为什么失败。脚本主动抛出的错误已经会返回 400 加上原文,这里说的是超时或崩溃这一类。
  • 现状:这和公开错误目录一致(content/docs/api/error-catalog.mdx:711:处理器崩溃、驱动错误、沙箱超时 → 500),所以不算违约,是要不要改约定的问题。
  • 需要你定:
    • A:保持现状,只返回 500;
    • B:改成 4xx,并带上原因;
    • C(读码的开发推荐):保持 500,但加一句点名动作的话,例如"动作 X 超时未完成",不暴露内部细节。

Context

A deliberate throw new Error('msg') from an action body already answers 400 with the body's sentence on main (sandbox-business-message.ts:106 → actionsDoorAnswerOf arm 7).

A sandbox timeout SandboxError carries no innerMessage, code or status, so it takes arm 5, an unexpected fault, and answers 500 'Internal server error' (packages/types/src/actions-door-answer.ts:259-268). An MCP agent cannot tell a slow action from a broken platform, and cannot adapt.

Parent: #34659.
Grade: p2 · domain:server · area:ai. It changes a served contract, so it needs the maintainer's word before any work.

Activity

  1. added
    priority:p2
    needs-user-decision
    pm:awaiting-maintainer
    area:ai
    domain:server
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

    席位复核(fable,只读,对照 origin/main 743308b)· 2026-11-18T00:28Z

    #35027 动作脚本超时或崩溃时,调用方只拿到一句 500

    一句话问题

    动作脚本跑超时(或崩溃)时,调用方和 MCP 里的 AI 只收到 500 Internal server error,看不出是哪个动作、是不是超时,所以 AI 分不清"这个动作慢"和"平台坏了",也没法调整做法。

    事实核对(都成立)

    • 超时错误确实什么都不带。budgetError 只用一句话构造 SandboxError,没有 innerMessage、code、status(packages/runtime/src/sandbox/quickjs-runner.ts:241-253,构造函数在 :2468-2476,名字是 SandboxError)。
    • 所以它落到第 5 支"意外故障"(packages/types/src/actions-door-answer.ts:259-266),在 :319 返回 faultAnswer,也就是 :380-382 的固定句子。
    • 脚本主动 throw new Error('msg') 已经是 400 加原文(packages/types/src/sandbox-business-message.ts:106-110,第 7 支在 actions-door-answer.ts:377)。
    • 公开错误目录确实写着"沙箱超时是 500"(content/docs/api/error-catalog.mdx:711)。所以现状不违约。

    选项对比

    • A 保持现状。 不改任何东西,零风险。代价是 AI 继续对超时一无所知,reading first: travel_expense operation file_and_submit_from_text answers 500 on every attempt — no persona linked to an employee, and a thrown script error reaches the caller as a bare 500 #34998 那类排查还得靠人翻服务器日志。
    • B 改成 4xx 并带原因。 这会推翻目录里"拒绝是 400、崩溃是 500"的分界(error-catalog.mdx:714-717),也推翻代码里写明的理由:故障报成非 5xx 会让网关错误率、重试策略、告警都看不到它(actions-door-answer.ts:214-224)。超时也不是调用方的错。改动面大,属于破坏性变更,不建议。
    • C 保持 500,加一句点名动作的话。 状态码和 INTERNAL_ERROR 都不变,只换句子。main 上已经有一模一样的先例:编译不过的动作现在就是 500 加点名句子(quickjs-runner.ts:2405-2413,目录第 :712 行)。改动小,大约是给 budgetError 加上面向调用方的句子和 status: 500,再改目录一行、补测试。

    推荐:C

    C 不动状态码约定,监控和重试行为都不变,只是让调用方知道"动作 X 超过了 N 毫秒的时限"。这句话只含动作名和时限,不含任何数据,和编译失败那条先例的理由相同。先例已经合入,所以这不算新开一种约定,而是把同一做法用到超时上。

    条件有三个:

    1. 只给超时加句子,崩溃的原文继续不外露。 崩溃的 TypeError 文本可能带着脚本正在读的数据,这正是现在要消毒的原因(actions-door-answer.ts:157-163)。崩溃最多说"动作 X 内部出错",不能带原始报错。
    2. 范围限定在动作。 budgetError 是钩子、动作、定时任务共用的(按 args.origin.kind 拼句子)。给它加 innerMessage 后,/data 门会把它当成业务原文读出去(sandbox-business-message.ts:106-110)。钩子超时要不要同样处理,应当明确写进范围,不能顺带改掉。
    3. HTTP 门和 MCP 的 run_action 要给出同一句话(两者都读 actionsDoorAnswerOf),并同步改 error-catalog.mdx:711。

    卡片上不准确的地方


  3. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG

    Maintainer ruling (recorded) · 2026-11-18T01:02Z

    Maintainer 2026-11-18 01:01:59Z, verbatim: 「35027 C」 (answering the seat's fable review on this card).

    Route C, with the three conditions from the seat review:

    1. Only a timeout gains a sentence: the caller learns that action X exceeded its N ms limit. The status and code stay 500 / INTERNAL_ERROR. A crash's native text stays withheld; at most "action X failed internally", never the raw error.
    2. Scope is actions only. budgetError is shared with hooks and jobs. Adding innerMessage must not make the /data door read it as business text (sandbox-business-message.ts:106-110). Hook and job timeouts are out of scope unless a later card rules them in.
    3. The HTTP door and MCP run_action give the same sentence (both read actionsDoorAnswerOf), and error-catalog.mdx (~:711) is updated with it.

    pm:awaiting-maintainer comes off; the card is dispatched to seat 3 area o3-C.

  4. added
    pm:queue
    and removed
    pm:awaiting-maintainer
    on Nov 18, 2026
  5. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz

    Claim: PM loop (area o3-C, maintainer ruling C recorded 6965765884; seat assignment; in-hand per the seat's wind-down note)
    Session: session_01WGufziunkXbDT7wUWqfmWz
    Account: os-support-ai
    Branch: claude/issue-35027-action-timeout-sentence
    Worktree: objectstack-issue-35027
    Domain: domain:server
    Seat: repo:objectstack#3
    File surface: packages/runtime/src/sandbox/quickjs-runner.ts (the action arm of budgetError only), packages/types/src/actions-door-answer.ts (only if the timeout's caller sentence needs an arm there), packages/types/src/sandbox-business-message.ts (read; edited only to keep /data from reading the new text as business text), their tests and the door tests that pin the answer (packages/rest/**, packages/mcp/** test files for run_action), content/docs/api/error-catalog.mdx (~:711), root .changeset/
    Container & model: M, mode:subagent (area o3-C os-dev), model: TIER_DEFAULT (dispatch-gates --tier on the surface: "no path-derived mandate"), effort: high (seat note: maintainer-ruled served-answer change)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: @objectstack/runtime / @objectstack/types in objectstack (an action body that times out answers 500 Internal server error, naming neither the action nor its limit, so an MCP agent cannot tell a slow action from a broken platform; ruling C keeps 500 / INTERNAL_ERROR and adds a sentence naming the action and its limit) | none | every HTTP and MCP caller of an action
    Thread-read: 6965765884
    Premise: holds on origin/main 1282a46. budgetError (packages/runtime/src/sandbox/quickjs-runner.ts, called at :294, :424, :481, :502, :589) builds a SandboxError with no innerMessage, code or status, so it takes the unexpected-fault arm of actionsDoorAnswerOf (packages/types/src/actions-door-answer.ts:259-268) and answers the fixed INTERNAL_ERROR_MESSAGE. content/docs/api/error-catalog.mdx:711 lists "sandbox timeout" under 500. The compile-failure precedent (500 plus a naming sentence, #34980) is on main. The dev re-measures before code.
    Ruling conditions carried verbatim into the build: (1) only a timeout gains a sentence; status and code stay 500 / INTERNAL_ERROR; a crash's native text stays withheld (at most "action X failed internally"); (2) actions only: hook and job timeouts unchanged, and the /data door must not read the new text as business text (sandbox-business-message.ts:106-110); (3) HTTP door and MCP run_action give the same sentence, error-catalog.mdx updated. Pins: the timeout sentence on both doors, a crash still sanitised, a hook timeout unchanged on /data, each ablated.
    Serial constraints cleared: overlap-check against open PRs before every push; #35040 (unclaimed, back to the pool) touches the lint side only.
    Pre-claim lane: domain:server — seat-assigned to area o3-C.
    Pre-claim deps: maintainer ruling recorded (6965765884); needs-user-decision comes off in this stroke: the ruling it awaited is recorded (6965765884).
    Prior rulings read: 6965765884 (「35027 C」), seat review 6965177482; #34884 / PR #34980 compile-failure precedent; thread: none; repo: objectstack-ai/objectstack

  6. added
    pm:dispatched
    and removed
    pm:queue
    needs-user-decision
    on Nov 18, 2026
  7. 7 remaining items

  8. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    Claim: PM loop round 1 · 2026-11-18T03:44Z
    Session: session_01JQwxbXGvw43spR79ztEvWt
    Account: os-warren
    Branch: claude/issue-35027-action-timeout-sentence
    Worktree: objectstack-issue-35027
    Domain: domain:server
    Seat: repo:objectstack#1 (area o1-A)
    File surface: the 9 paths of PR #35093 at 8010091343, unchanged
    Container & model: S, mode:subagent, model: n/a — reviews and landing only, no dev dispatched, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack runtime (action timeout error sentence) | none | any action caller that hits a timeout; yes
    Thread-read: 6968145365
    Ruling-ref: 6965765884 (maintainer: 「35027 C」)
    Premise: holds (seat 3 hand-off 6968137486)
    Serial constraints cleared: overlap-check at 2026-11-18T03:44Z: clean with origin/main and #35085 (shares quickjs-runner.ts, ui/actions.mdx); the second to land merges main forward and re-runs the four runtime pins.
    Resume-from: claude/issue-35027-action-timeout-sentence@80100913434277dc013263414203d51fae22c493
    Pre-claim lane: packages/runtime, content/docs of PR #35093 — repo:objectstack whole-repo lane, area o1-A.
    Pre-claim deps: no Blocked-by: on the card.
    Prior rulings read: ruling C 6965765884 and seat review 6965177482; L1-a ACCEPT 6967592390 at d50f969537.

    Taking over seat 3's hand-off (seat 3 brief objectstack#34584 comment 6968205670; maintainer to seat 3, 2026-11-18 03:30Z: 「代码已推送,交给下一任,用信箱 交接给刚入座的 objectstack#1」; seat 1 split to area o1-A, maintainer 03:32Z: 「已经认领的4个 p1 也开工,不再认领新任务」 in the project thread). The card was released to pm:queue by seat 3, so this is a fresh claim that resumes the same branch and PR. The card is p2 started work, finished under the maintainer's 03:19Z order to seat 3 (「开发中的任务提交代码…」).

    Owed: L1 delta d50f9695..80100913 (L1-a), the seat contract review against ruling C's three conditions, then landing on green.

  9. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 18, 2026
  10. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt
    os-dev-report

    {
      "issue": 35027,
      "status": "done",
      "round": 3,
      "branch": "claude/issue-35027-action-timeout-sentence",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35093",
      "head": "48170d26e646f73c394777b16cc1751a4d40227f",
      "session": "session_01JQwxbXGvw43spR79ztEvWt",
      "premise_still_valid": true,
      "summary": "Fix round for contract review 6972256765 F1. F1 measured true and is fixed. The disproof test (an action that declares refusals times out, through the real actionBodyRunnerFactory, read on the /actions door and actionsDoorAnswerOf, the reader MCP run_action renders) was red on ddee9584b9: both doors answered 'Internal server error'. Fix (331f618981): quickjs-runner.ts keeps a module-level runnerOwnFaults WeakSet beside hostRelayedErrors. The action arms of budgetError (CPU budget and wall-clock ceiling) and actionBodyCompileFailure are marked, and isRunnerOwnFault reads the mark. resolveSandboxedRefusal (hook-refusal-catalogue.ts) passes a marked fault through before reading any field. There is no pass-through on a declared 500: a body's own code-less throw, with status 500 and even with the timeout's exact sentence, is still refused as undeclared. The compile-failure precedent had the same gap, and the same mark covers it with no extra path, so it is included and pinned. The changeset gains one paragraph for the refusals case (48170d26e6). The catalog row and the PR body's sentence claims are now true unconditionally, so they are unchanged; the PR body gains the round-3 sections. body-runner.ts needed no edit.",
      "tests": "Red before the fix (ddee9584b9 plus the new test only), action-refusal-catalogue.test.ts: Tests 3 failed | 17 passed (20). The CPU and wall timeouts answered message 'Internal server error' on both doors where the sentence was expected. Compile failure: expected 'Internal server error' to contain the cannot-run sentence. The control was green. After the fix (331f618981), 6 runtime files (action-refusal-catalogue, sandboxed-action-crash-is-a-fault, hook-refusal-catalogue, unreadable-rejection-recorded, sandbox-unreadable-rejection-door, quickjs-runner): Test Files 6 passed (6), Tests 145 passed (145). Ablation via scripts/ablation-replace.mjs: the catalogue's isRunnerOwnFault pass-through line was replaced with a comment ('ok mutation landed: anchor 1 -> 0'). The test imports src by relative path, so no rebuild was needed. Result: Tests 3 failed | 17 passed (20); red were the CPU, wall and compile pins; the control stayed green. Restore: 'ok restored: blob == HEAD (1d140e65a29e) and git diff HEAD is empty', independently re-hashed as a match. pnpm --filter @objectstack/runtime test: Test Files 619 passed (619), Tests 11500 passed | 23 skipped, VERDICT command-exit 0. runtime typecheck: exit 0, check:test-typecheck OK. Core census import-runner-sandbox-fault-row (repo project): 48/48.",
      "gates": "dispatch-gates --commands on 48170d26e6: 100 derived; all 100 run, each exit 0, captured before any pipe. check:skill-examples and check:dual-build-cjs-loads first exited 3 (dists missing); after a whole-workspace build (120/120 tasks) both exited 0. --ran: 100 derived, 100 run, 0 NOT-MEASURED, 0 UNRUN. The derivation flagged the tree as behind origin/main, with one gate file changed on main (scripts/check-skill-identifier-liveness.mjs); that family ran from the branch copy and exited 0. Main was not merged: there is no conflict and no main-caused red. overlap-check before each push: VERDICT clean exit 0 (origin/main f7960893cd, then 99a0e4fbfc). CI on 48170d26e6: 42 success, 17 skipped (opt-in, queue and UI rows), 0 failure, 0 pending. Successes include Lint & Repo Gates, TypeScript Type Check, Build Core, Test Core plus all 10 shards, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate, Check Changeset and both PR-body guards.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 — git push x2 (not REST); relay issue_patch PR #35093 body (POST /repos/objectstack-ai/objectstack/dispatches -> fleet-write run 44267763555, read-back identical 17290 bytes); this post-stamped comment on #35027",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  11. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    Claim amendment · 2026-11-18T08:58Z · PR #35093 at 48170d26e646f73c394777b16cc1751a4d40227f (os-dev report 6973777094)

    File surface: widened from the 9 paths of PR #35093 at 80100913 to 11 paths, adding packages/runtime/src/sandbox/hook-refusal-catalogue.ts and packages/runtime/src/sandbox/action-refusal-catalogue.test.ts. Reason: F1 (must-fix) of the declaration contract review 6972256765. An action that declares refusals lost the new timeout sentence because resolveSandboxedRefusal in hook-refusal-catalogue.ts turned the runner's own fault into the undeclared-code fault. The fix marks the runner's own faults by identity in quickjs-runner.ts (already on the surface) and has hook-refusal-catalogue.ts return them first. The pins sit in the existing action-catalogue harness, action-refusal-catalogue.test.ts. The fix round order named both runtime files.
    Clause-②: no
    Metadata-protocol: none

    Neither line moves. isRunnerOwnFault is a module export only and is not re-exported from the package index. The compile-failure arm now gives its sentence on a refusals action too. That restores the ruled answer on an unpinned path and refuses nothing that was accepted before.

  12. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    Claim amendment · 2026-11-18T09:02Z · corrects the container line of claim 6968383051 (contract review delta 6972256765 → record on 48170d26, S1)

    Container & model: M, mode:subagent, model: default (opus) — PM judgment, no path-derived mandate, effort: high

    The claim said "reviews and landing only, no dev dispatched". That stopped being true when the F1 fix round was dispatched at 07:38Z: an os-dev subagent resumed from ddee9584 and produced 331f6189 and 48170d26 (report 6973777094). The file surface amendment for that round is 6973840626.

  13. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt

    Close-out · 2026-11-18T09:32Z

    PR #35093 merged at 2026-11-18T09:24Z as 961f4741ff21ef4f1ca8104a016919dcb1b7342c, and its Fixes #35027 closed this card. Ruling C: an action body that runs out of time (CPU or wall clock) now answers a sentence naming the action and its limit, at the unchanged 500 / INTERNAL_ERROR. The same holds on an action that declares refusals, and the compile-failure sentence now reaches both doors too. Records on 48170d26: L1-a ACCEPT 6973855618, declaration contract reviews 6973910753 and 6973943513, landing 6973965158. The surface amendments are 6973840626 and 6973920686.

    This stroke removes the pm:dispatched state label.

  14. removed
    pm:dispatched
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions