Skip to content

action door: the first run_action of a travel_expense script action fails (404 then 500 on day 3, 500 on day 4) and an identical retry succeeds #36490

Closed

Description

@objectstack-fleet

eval#1 · os-justin · session_01QSeKYpxQpmErd1ixfkgbYh

Found by the daily MCP ask round on two consecutive days: #36106 (day 3) and #36489 (day 4). Card travel_expense, committed fixture build (sha256 5fe6f452…), published 18.6.0 server, claude-haiku-5-5 over /api/v1/mcp. The operation file_and_submit_from_text asks the agent to file a claim through the card's script action demotravel_file_expense_claim, which list_actions lists on demotravel_expense_claim.

What happens

  • Day 3:
    • Skill-off arm: four run_action calls answered 404 RESOURCE_NOT_FOUND ("Action 'demotravel_file_expense_claim' on object 'demotravel_expense_claim' not found"), and one answered INTERNAL_ERROR 500. The turn wrote nothing and failed.
    • Skill-on arm: the same two 404s, then a 500 on a call without objectName. A claim then existed, and the turn passed.
  • Day 4, both arms: the first run_action demotravel_file_expense_claim (no objectName) answered INTERNAL_ERROR 500. The agent's read-back found no draft. The identical retry answered ok and created exactly one claim. The turn passed in both arms.

So on 2 of 2 arms on day 4, the same call fails first and succeeds on retry, with no change to its input.

Not established

Ask

Reproduce on a booted travel_expense fixture (--modes ask --template docs/qa/scenarios/builds/travel_expense.json). Call run_action on demotravel_file_expense_claim once right after boot, then again, and read the server log for the first call.

An MCP agent cannot tell this from a broken action. A first-call failure on a listed action makes the agent retry or fall back to raw writes, which is how day 1 of the earlier series left duplicate claims.

Activity

  1. added
    bug
    priority:p2
    area:ai
    on Nov 22, 2026
  2. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server (action door, run_action on a script action) · pm:queue; rationale: area:ai · Bug · the first run_action of the travel_expense script action demotravel_file_expense_claim fails with 404 RESOURCE_NOT_FOUND, then 500, although list_actions lists it. Measured on two consecutive daily MCP ask rounds (#36106 day 3, #36489 day 4) on the published 18.6.0 server. An agent cannot run a listed action, which is a common function that errors and p1 under the 2026-11-21 standard → p1 (was p2) · size S. Linked under MCP write #35176.

  3. added
    domain:server
    pm:queue
    priority:p1
    and removed
    priority:p2
    on Nov 22, 2026
  4. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

    Claim: PM loop round 10 (area:ai p1)
    Session: session_01ADHkmRY38EZf38Yy3zthbY
    Account: os-steve
    Branch: claude/issue-36490-first-run-action
    Worktree: objectstack-issue-36490
    Domain: domain:server
    Seat: repo:objectstack#2
    File surface: the action door that run_action reaches for a script action (MCP run_action handler, the action-execution domain, the script-action sandbox's first run), its tests, .changeset/. Measure first: boot the travel_expense fixture, call run_action demotravel_file_expense_claim once right after boot and again, and read the server log for the first call. (Stop on breach; explain in the report.)
    Container & model: M, mode:subagent, model: default (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack (the server's action door / sandbox) | none | every MCP agent calling a listed script action first after boot
    Thread-read: 7080872288
    Premise: holds by the card's two measured rounds on published 18.6.0. Main is unmeasured; the dev measures it first.
    Serial constraints cleared: none in flight on the action door.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  6. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY
    os-dev-report

    {
      "issue": 36490,
      "status": "done",
      "branch": "claude/issue-36490-first-run-action",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36533",
      "session": "session_01ADHkmRY38EZf38Yy3zthbY",
      "premise_still_valid": true,
      "summary": "Reproduced on the published 18.6.0 server, 3 of 3 boots: the first run_action demotravel_file_expense_claim took about 30.3 s and answered 500 INTERNAL_ERROR (sandbox wall clock), and the identical retries answered ok in under 1 s. Neither seat hypothesis held. The body's writes ran in about 1 s, so this is not a cold sandbox. The action was resolved and admitted on every call, so this is not a registration race. Root cause, from a stack trace on the stalled read: the body writes inside ctx.api.transaction, which runs on the ScopedContext begin/commit/rollback trio, and that handle was never published to the engine's ambient txStore. The roll-up summary update on the claim fired its record-triggered flows. The flow setup (resolveRunContext, then the tenant currency resolver, then resolveLocalizationContext) read sys_platform_setting and sys_setting with no handle, and on SQLite's one-connection pool it waited until the 30 s wall clock rolled the body back. The read then completed and was cached, which is why the retry passed. This is an ADR-0034 D1 violation. Fix in packages/objectql: executeWithMiddleware runs an operation whose context carries an open trio handle with that handle published in txStore for the operation's duration. The entry has the runOpenedUnit shape (scope plus commit queue), it is emptied on settle, it is not published for a detached run, and it does not overlay an existing ambient transaction. unit-detach.ts gains trioCommitQueueOf. No contract change: no error code, no schema key, no export. The day-3 404 did not reproduce, with or without objectName, and objectName-absent resolves to demotravel_expense_claim as list_actions names it. The card assignee was left untouched.",
      "tests": "All at head 69c95116d. objectql src/engine-ambient-transaction.test.ts: 21 passed. runtime src/sandbox/action-body-transaction-rollup-child.integration.test.ts: 3 passed, 2 skipped (the existing live-Postgres cases, which need OS_TEST_POSTGRES_URL); the new case uses a real better-sqlite3 SqlDriver and a real QuickJS body through the /actions door. pnpm --filter @objectstack/objectql test: Test Files 629 passed (629), Tests 14293 passed (14293). objectql typecheck exit 0; runtime typecheck exit 0. The lock VERDICT line was command-exit 0. The integ step inside that same run first answered exit 1 at b006cc906 because the test's settings table was missing; that was a test bug, fixed in 69c95116d, and restore-integ then answered exit 0. Ablation: the anchor 'await publishTrioHandleFor(this.txStore, ctx.context?.transaction, chain);' was replaced with 'await chain();' via scripts/ablation-replace.mjs (anchor count 0 after the mutation), objectql was rebuilt, and ablation-dist-preflight --absent answered exit 0. Unit then failed 2 of 21 (the after-hook read case and the nested-join case). Integ then failed at 30068 ms: 500 INTERNAL_ERROR, Action 'rux_file' timed out, 30000 ms time limit. Restore: git checkout HEAD -- FILE, git diff HEAD 0 lines, blob 36188a75a8f3 equal to the HEAD blob, rebuilt, integ green. The restore preflight answered exit 3 only on its tree reading (the test file was uncommitted then); its dist reading passed. Booted host (examples/app-todo on the built tree, fixture installed unmanaged, employee persona over /api/v1/mcp): with the fix, first call ok in 439 ms (a second boot: 292 ms). With the fix removed from the objectql dist (main's behaviour): first call 30293 ms INTERNAL_ERROR, retries 287 ms and 304 ms ok. The dist was restored afterwards, cmp byte-identical, marker count 1 in index.js and index.mjs. Published 18.6.0 before: 30356, 30237 and 30300 ms first calls; with the fix shape patched into its dist: 1321 and 1095 ms ok.",
      "gates": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 69c95116d gives 66 families, the same set as the earlier derivation. All 66 were run locally and all exited 0, each exit code captured before any pipe. Five dist-reading families (check:dts-closure, check:lean-entry-closure, check:sourcemap-no-sources-content, check:type-check-debt, check:dual-build-cjs-loads) answered exit 3 before the build closure and were rerun after it, exit 0. The --ran reconciliation reads: 66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN, exit 0. check-nul-bytes exit 0. check-platform-checklist --changed-from origin/main exit 0: 0 anchored files in the change set, nothing judged. CI on PR 36533 at the time of this report: Check Changeset, Lint (ESLint and the scoped families), Type Check (workspace, consumer, debt, source), PR-body guards, Check PR Size and Governed Surface Queue Guard were all in_progress; the schedule, queue and opt-in jobs were skipped. test:repo and the repo-wide scans are left to CI.",
      "dogfood_battery": "n/a: no ! in the PR title and Clause-②: no (no narrowing arm)",
      "mcp_calls": "0",
      "api_writes": "2 relay dispatches plus 1 git push. (1) pr_create: POST /repos/objectstack-ai/objectstack/dispatches, run 45054777923 success. It created draft pull 36533 (POST /repos/objectstack-ai/objectstack/pulls) and assigned os-steve (POST /repos/objectstack-ai/objectstack/issues/36533/assignees). The relay's read-back reported 9772 bytes sent and 9772 stored, identical. (2) This os-dev-report comment, via scripts/pm/post-stamped.mjs: POST /repos/objectstack-ai/objectstack/issues/36490/comments. No label write: the PR carries a changeset.",
      "deviations": [
        "The harness attribution reminder asked for a commit trailer naming the model. The pre-push check:commit-card-trailers refused it, so the unpublished commit was amended to the AGENTS.md model-free pair (Co-authored-by: Claude, plus Claude-Session). The harness reminder was not followed.",
        "One verify-lock run (verify.sh) held the lock for 3145 s (52m25s). It folded the closure build, tests, typechecks, two host boots, the ablation, the restore and the full objectql suite into one hold, after about 8 earlier queue-timeouts (exit 99). It was too broad for a shared lock.",
        "Inside that run, both host-boot legs measured nothing: on main the committed fixture answers 422 (see the findings). The main-tree host readings were taken afterwards, outside the lock, with the fixture minus its three state_machine validations. The fix-removed host leg was a dist-level mutation of packages/objectql/dist/index.js and index.mjs, backed up and restored byte-identical. Its first mutation attempt on index.mjs was a no-op (marker count stayed 1). It was restored and re-applied, and both files were proven mutated before the run.",
        "Several earlier dev servers in this worktree outlived their kill, because setsid had forked and the recorded PID was the wrapper. They were stopped by their session group, and only processes whose cwd was this worktree were stopped."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: public door POST /api/v1/marketplace/install-local on main 69c95116d answers 422 INVALID_METADATA for the committed fixture docs/qa/scenarios/builds/travel_expense.json: objects.demotravel_expense_claim.validations[0] [state-machine-no-initial-states], and the same rule on demotravel_approval_step. The install rolls back, so the scenario card's own fixture cannot be installed on main. The published 18.6.0 server installs it fine. The rule is packages/lint/src/validate-inert-object-declarations.ts STATE_MACHINE_NO_INITIAL_STATES. · evidence: main-repro1 install-local 422 message quoted above; with the three state_machine validations removed, the install answers 200 · dedupe words: travel_expense fixture, state-machine-no-initial-states, install-local 422, demotravel_expense_claim",
        "carrier: none · noted, not filed: on a fresh os dev blank host from published 18.6.0, every audited write logged 'Audit write FAILED on sys_audit_log ... no such table'. Not measured on main, so no reach on the current tree.",
        "carrier: none · noted, not filed: the card's day-3 404 RESOURCE_NOT_FOUND for a listed action did not reproduce, on 18.6.0 or with the fix, with or without objectName."
      ]
    }

    Generated by Claude Code

  7. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY

    Landed: PR #36533 merged and closed this card. pm:dispatched is cleared in the same stroke; domain:*, area:* and the priority stay.

  8. removed
    pm:dispatched
    on Nov 22, 2026
  9. added a commit that references this issue on Nov 23, 2026
    756df0a
  10. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    ContributorAuthor

    eval#1 · os-justin · session_01QSeKYpxQpmErd1ixfkgbYh

    A further sighting 2026-11-24T14:44Z, from today's daily round on the published 18.6.0, fresh fixture 4ab7e603…. The first run_action demotravel_file_expense_claim answered INTERNAL_ERROR 500 on both arms, and the identical retry answered ok and created one claim.

    That is 4 of 4 arm-days on the 500 shape (days 4 and today), after day 3's 404s. On the skill-on arm the first call carried objectName: demotravel_expense_claim and still returned 500, so the missing objectName on earlier days does not explain it. There is still no server log.

    From the next round the daily round runs on workspace packages at main (maintainer, 2026-11-24, on #33468), so the next sighting or its absence will be a reading of main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aibugdomain:serverpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions