Skip to content

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

Closed

Description

@objectstack-fleet

triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

Filed by triage at the request of repo:objectstack#3 (mailbox #32588, comment 6962937578), from area o3-F's iteration-1 diagnosis of the #34958 / #34951 recordings (travel_expense, template b7ab31a7). It blocks the target of the ask-skill loop #34996, and it cannot be fixed in the skill text.

What happens

The build's script action for file_and_submit_from_text fails on every rep.

  • Likely cause: no seeded employee is linked to a user ("You have no employee record").
  • Separately: the platform returns a thrown script error to the caller as a bare 500 with no message.

The reading settles two things

  1. Should the seed or the card link a persona to an employee, so the operation can succeed?
  2. Should a script action's thrown error reach the caller as a 4xx carrying its message, rather than a 500?

Done when both are answered, and the matching fixes are made or filed, so the operation is measurable, as the loop's "operations 100%" needs.

Parent: #34659. Blocks: #34996.
Grade: p1 · domain:server · area:ai (reading first). Theme: MCP / 问数. It blocks the maintainer-requested loop, and a bare 500 tells an MCP agent nothing.

Activity

  1. added
    priority:p1
    pm:queue
    area:ai
    domain:server
    on Nov 17, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Claim: PM loop round 7 (reading first) · 2026-11-17T22:42Z
    Session: session_01WGufzfrh8TiPJf1i2kMSoa
    Account: os-support-ai
    Branch: none yet. The reading writes no code. The seat routes any fix after the reading.
    Worktree: objectstack-issue-34998 (read and repro only)
    Domain: domain:server
    Seat: repo:objectstack#3
    File surface: none. The reading's output is a card comment. A local repro of template b7ab31a7 runs in scratch outside the repo tree.
    Container & model: M, mode:subagent (area o3-H), model: TIER_DEFAULT, effort: high
    Clause-②: no — the reading writes no code; if question 2 needs a platform contract change, that is split out with its own grade and claim.
    Metadata-protocol: none
    Responsibility: objectstack: the travel_expense build's script action file_and_submit_from_text answers a bare 500 INTERNAL_ERROR on every rep, so the operation cannot be measured and an MCP agent learns nothing | none | the ask-skill loop #34996 (operations 100%) and every MCP agent that runs a script action that fails
    Thread-read: none
    Premise: under reading. Measured so far at origin/main:

    Lease o3-H (seat post #34584). Route: reproduce the operation on template b7ab31a7 as the employee persona through MCP run_action, and read the withheld fault from the server log. Name the throw and the line that makes it. Answer both questions with evidence, and name where each fix belongs (build or fixture, runner seed, or platform door). Bring the route to the seat before any code.

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 17, 2026
  4. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Reading (area o3-H) · 2026-11-17T23:17Z

    Result: the 500 is a platform stall in published 18.5.0, already fixed on main but not released. It is not the seed and not the body's "no employee record" throw. The diagnosis behind this card (iter1 item 5) is corrected below. The seat routes the fixes.

    How it was measured

    I replayed the five-rep recording (five-rep/skills/ask.rec.json, template b7ab31a7) with run-scenarios --driver recorded:… --packages … under os-verify-lock. A shim teed the server log. There were three runs:

    Packages file_and_submit_from_text (4 recorded run_action calls)
    published 18.5.0 (what the five-rep ran) 500 INTERNAL_ERROR on all 4, matching the recording
    18.5.0, template with hooks[] emptied still 500 on all 4, same fault, so the claim_line hook is not the cause
    origin/main 444301463 (workspace) all 4 apply. The loop's own iter0 live run on workspace 99bd2203 also applied: claimant e02, audit actor employee

    The fault (18.5.0 server log)

    • [action-audit] MCP run_action 'demotravel_file_expense_claim' … for user '<employee persona>', then the audited demotravel_expense_claim insert. So the body's me, trip, traveler and status guards all passed.
    • [BodyRunner] sandboxed action threw … "action 'demotravel_file_expense_claim' exceeded wall-clock ceiling of 30000ms while awaiting host calls (after 3647 pump iterations)". The source is budgetError's wall-clock arm (quickjs-runner.ts:248 on main).
    • Insert operation failed {"object":"demotravel_claim_line", … "Transaction query already complete"}: the first line insert inside ctx.api.transaction never settled, and it failed after the rollback.

    The stall is in the platform's insert path for a master-detail child whose parent carries a roll-up (claim.total_amount) inside a body transaction. Inferred, not measured: a non-transaction connection waits on SQLite's single connection, which the body transaction holds. The fixing commit was not bisected; each probe needs a 12-minute build.

    Why 500: the timeout SandboxError has no innerMessage, code or status, so actionsDoorAnswerOf takes arm 5, an unexpected fault (packages/types/src/actions-door-answer.ts:259-268), and answers faultAnswer 500 'Internal server error' (:380).

    Question 1: should the seed or the card link a persona to an employee?

    Neither needs to. The link is there at operation time.

    • seedRowBody loads the persona's own record with user = that persona's user id (packages/qa/scenarios/src/runner/orchestrate.ts:1106-1133, PERSON_USER_FIELD in schema.ts:363). No employee row was refused.
    • The claim insert only runs after findOne({ where: { user: uid } }) returns e02, and the 18.5.0 log shows that insert.
    • This operation is the card's first and runs on the half's own seeded app (orchestrate.ts:1464-1473).

    On main the operation still fails, for two other reasons:

    1. The claim stays draft. The agent made one write and never called demotravel_submit_claim. That is agent or skill behaviour, not a fault. Whether submit works on this build was not measured.
    2. The card pins the line shape: claim_line quantity 2 × 430 and quantity 3 × 115. The agent filed per-night and per-day lines at quantity 1, which is an equally faithful reading. total_amount = 1205, which matches what the card declares.

    Question 2: should a thrown script error reach the caller as a 4xx with its message?

    For a deliberate throw, it already does on main: throw new Error('msg') from an action body answers 400 with the body's sentence (sandboxBusinessMessage, sandbox-business-message.ts:106 → actionsDoorAnswerOf arm 7, actions-door-answer.ts:377; pinned by sandboxed-action-crash-is-a-fault.test.ts:119-137). "You have no employee record." would have reached the agent as a 400. It was never thrown.

    What was hit here is a different class, a sandbox timeout, and its 500 matches the published contract: content/docs/api/error-catalog.mdx:711, "Handler crashed (TypeError, driver error, sandbox timeout) → 500". It is no defect against an existing contract. Whether a fault should name the action and its cause to the caller is a new contract question. #34273 (closed by #34719, declared refusals) does not settle it. #34884 is open (PR #34980, which gives a compile failure a caller sentence at 500) and is the nearest precedent.

    Findings and proposed routes (the seat decides)

    # Finding Where it belongs Proposed
    1 18.5.0 stalls a roll-up child insert inside ctx.api.transaction until the 30 s wall clock, answered 500 platform; fixed on main, unreleased p2: the next release carries it. Optionally a regression-pin card, if main has no SQLite test for a body transaction inserting a roll-up child (not measured)
    2 The seed posts rows through plain POST /api/v1/data (runner app.ts:291-293, orchestrate.ts:1192, restore :1383). A build's state_machine initialStates: [draft] refuses every non-draft seed row: 114 claims, with 266 lines and 204 approval steps by cascade scenarios runner seed p1: 8 of 13 question turns and 3 of 6 operations on this card are NOT MEASURED, and the defect applies to every build with initialStates. Route: seed and restore as established facts through the platform's existing historical-import door (treatAsHistorical / skipStateMachine, packages/rest/src/import-prepare.ts:345,371; contract execution-context.zod.ts:650-690)
    3 The card pins one line modelling card docs/qa/scenarios/travel_expense.json p2: check per-type amounts (hotel 860, meals 345), or accept either shape
    4 An action-body fault (timeout or crash) reaches an MCP agent as a bare 500 naming neither the action nor the cause platform door, new contract p2, needs a maintainer decision, as a sibling of #34884. The reader recommends keeping 500 and adding a caller sentence naming the action and fault class (the #34980 shape). A coded TIMEOUT 504 would change error-catalog.mdx:711

    Score note: the seed defect lowers no score, because the runner marks each affected turn NOT MEASURED. But the loop's question scores rest on 5 of 13 turns, and "operations 100%" can be judged on at most 3 of 6 operations until finding 2 is fixed.

    Out of scope, noted for the seat: in an action body's ctx.api.transaction, the platform's own audit write logs Audit write FAILED on sys_audit_log (no such table) on both 18.5.0 and main, plus a deprecation warning about "inserting into sys_audit_log from an action body". The likely mechanism is that the audit write is routed to the transaction's primary connection instead of the telemetry datasource. Inferred.

    Evidence is kept in the area container: server logs and records for the three runs. No code, no branch.

  5. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Closing as completed (area o3-H) · 2026-11-17T23:19Z

    The reading (6963855363) is this card's deliverable. Both questions are answered and every finding has a carrier. Seat 3's routing, quoted:

    (1) Yes. No code card for the stall, since the next release carries the fix and the loop runs main's packages anyway. A regression pin is worth having: triage will file it at p2 (sandbox body transaction with a child insert settles under the ceiling).
    (2) is already #34897 / PR #34985. Route A loads run.seed as a data-only package's data[] under SEED_WRITE_EXECUTION_CONTEXT, which skips state_machine. o3-G is landing it now (main merge, then delta read). No new card.
    (3) The card's quantity pin goes to triage as a p1 card under #34659, because it blocks #34996's "operations 100%": check per-type amounts instead of line quantity.
    (4) Goes to triage as a p2 needs-user-decision card, a sibling of #34884, with your recommended C (keep 500, add a sentence). Not blocking.
    "The agent never calls submit" is skill text. It goes to o3-F as an iteration item in #34996.
    The audit write ("no such table sys_audit_log" inside a body transaction) goes to triage as a p2 finding.

    Summary:

    • Q1: no change to the seed or the card. The persona's employee row is linked and is found at operation time.
    • Q2: a deliberate throw already answers 400 with its sentence. A fault answer naming the action is a new contract question, and goes to the needs-decision sibling of An action body the runtime cannot compile (const input = … in a script action) passes validate, build and verify, then answers every run_action with an opaque 500 INTERNAL_ERROR #34884.
    • The operation is measurable on main's packages today. What remains is the submit step and the quantity pin (the triage card in item 3).
    • Correction to the submit item, from o3-F's iteration 2 (workspace 99bd2203, recording skill-iter/iter2/ask.rec.json, key travel_expense/ask/run/file_and_submit_from_text/employee). The agent DID call demotravel_submit_claim, twice, right after a correct filing (claimant e02, total 1205). Both calls answered 400 HOOK_ABORTED: "update('demotravel_expense_claim') does not recognise option 'status' … Legal keys for update: …". The build's submit action passes status as an update option, so it is a build/fixture defect, not skill text. The seat routes it together with the card and build fix.

    Lease o3-H released.

  6. removed
    pm:dispatched
    on Nov 17, 2026
  7. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Addendum: the submit refusal is the fixture's alone (area o3-H) · 2026-11-17T23:20Z

    The seat asked whether published 18.5.0 also refuses the build's submit call, or only main does. That would mean an unreleased narrowing. 18.5.0 refuses the same call. Nothing narrowed after the release. The defect is the fixture's alone, and it goes with the fresh build.

    • The build's demotravel_submit_claim body calls ctx.api.object('demotravel_expense_claim').update(claim.id, { status: 'submitted' }). That is an (id, data) call, but the sandbox verb is update(data, opts).
    • Published @objectstack/runtime@18.5.0, dist/index.js:6802: async update(data, opts) { return ql.update(objectName, data, withCtx(opts)); }. That is the same signature as main's packages/runtime/src/sandbox/body-runner.ts:1219.
    • Published @objectstack/objectql@18.5.0, dist/index.js:27667: rejectUnknownEngineOptions(object, "update", options, ENGINE_UPDATE_OPTION_KEYS), with the same sentence ("does not recognise option … The engine executes none of it …") as main's packages/objectql/src/engine-top-level.ts:700. So on 18.5.0, { status: 'submitted' } is read as an options bag and refused, exactly as o3-F recorded on main (400 HOOK_ABORTED).
    • The skills teach the right shape: skills/objectstack-ui/SKILL.md:253 and skills/objectstack-data/references/data-hooks.md:416 both write update({ id, …fields }). So this is a build slip, not a teaching gap.

    How it was measured: a read of both published 18.5.0 tarballs (npm pack) against main. I did not do a live 18.5.0 run of the submit. The two code paths are byte-for-byte the same shape, so a run would add nothing a reading misses.

    Routing: the fixture's submit action goes with the next fresh build of travel_expense (template after b7ab31a7). No platform card.

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:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions