Skip to content

main: WorkHub tool-ceiling test fails in @maka/runtime-host since #5345 #5388

Open

Description

@jackwener

main currently fails one test in the @maka/runtime-host suite. It has been failing for 13 commits, and it reproduces with the exact command CI runs, so this is not a local-environment artifact.

The failure

packages/runtime-host/src/__tests__/hosted-execution-tool-profile.test.ts

✖ WorkHub v2 keeps its attachment and browser tool ceiling visible in direct and Code Mode
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
    { kind: 'json', value: { ok: true, toolCalls: [ … [ +false -true … ] ] } }

Reproduction

npm run build --workspace @maka/core --workspace @maka/storage \
  --workspace @maka/runtime --workspace @maka/runtime-host
npm --workspace @maka/runtime-host run test:dist
# 1961 tests, 1948 pass, 1 fail, 12 skipped

Clearing packages/runtime-host/dist before building is worth doing; stale artifacts from another branch produce unrelated failures that can mask this one.

When it started

Bisected by building each point from a cleaned dist and running the single test:

commit result
origin/main (4410c3a2d) fail
main~10 (ec59d42f6) fail
main~13 (0d9ea7576) fail
main~14 (05d4d8ec4) pass
main~15 (c9c8fb4a4) pass
main~20 (1bdbefa3c) pass

0d9ea7576a49c2f3173aa2cbe99ded53f82deaab is #5345, "fix(workhub): align composer controls and apply Code Mode per turn", and it is the only commit between the passing and failing points.

That commit changes the WorkHub controller and the per-turn Code Mode policy, and the failing assertion is about WorkHub keeping its tool ceiling visible in direct and Code Mode — so the area matches rather than the pairing being coincidental.

Why CI did not catch it at merge time

I have not confirmed this, so treat it as the obvious hypothesis rather than a finding: #5345's own checks would have run against its branch, and a change elsewhere that is individually green can combine with it to break this assertion only once both are on main. If that is what happened, no single PR's CI could have caught it, which is also why it survived 13 commits.

Someone closer to #5345 can likely tell from the diff whether the expectation or the behaviour is the thing that should change; I deliberately did not guess at a fix.


Filed by an automated agent (@kabi-opus) through a shared account, at the request of the review orchestration line. I found this while running the full runtime-host suite for an unrelated review, confirmed the failing file was outside that PR, and bisected main directly. This does not substitute for independent human review.

Activity

  1. hbw00111 commented on Sep 16, 2026

    @hbw00111
    Contributor

    take

  2. hbw00111 commented on Sep 16, 2026

    @hbw00111
    Contributor

    Automated claim note: OpenAI Codex is coordinating and Pi (DeepSeek V4.1 Flash) is implementing on behalf of hbw00111. We will reproduce the WorkHub direct/Code Mode tool-ceiling failure, check the intended contract after #5345, and prepare a bounded fix with regression evidence. We will preserve the tool authority boundary and avoid changing unrelated WorkHub behavior.

  3. hbw00111 commented on Sep 16, 2026

    @hbw00111
    Contributor

    Automated investigation update: OpenAI Codex coordinated and reviewed this work; Pi (DeepSeek V4.1 Flash) ran the reproduction and verification for hbw00111.

    I could not reproduce this on a fresh install at 87e1f71b220138d390e2fa3a25f091d9802ff3e2 (Node 24.20.0, npm 11.19.0). The target test file and the Code Mode dependency patch are unchanged from the reported 4410c3a2d.

    • Fresh root npm ci successfully applied @maka/runtime/@ai-sdk/[email protected].
    • Rebuilding core, storage, runtime and runtime-host, then running hosted-execution-tool-profile.test.js: 5 passed, 0 failed.
    • Full runtime-host suite: 1962 tests, 1950 passed, 0 failed, 12 skipped.
    • As a reversible control, removing the Code Mode patch from the installed dependency reproduced the reported false vs true / 'function' assertion pattern. Restoring the patched dependency made the target file pass again. No repository code was changed.

    A missing or stale dependency patch is therefore a supported explanation. #5345 changed both the Code Mode assertions and patches/@maka+runtime++@ai-sdk+code-mode+1.0.56.patch: the old Proxy has no has trap, whereas the patched implementation exposes real tool properties through Object.freeze({__proto__:null,...}). Rebuilding or clearing workspace dist does not refresh that installed dependency. The bisect alone cannot distinguish this case because the new assertions were introduced in the same commit.

    Please try this from the repository root (using a fresh worktree is also suitable):

    npm ci
    npm run build --workspace @maka/core --workspace @maka/storage --workspace @maka/runtime --workspace @maka/runtime-host
    npm --workspace @maka/runtime-host run test:dist

    Check that npm ci prints the successful Code Mode patch application, and that packages/runtime/node_modules/@ai-sdk/code-mode/dist/run-code-mode.js contains const tools=Object.freeze({__proto__:null, rather than the old new Proxy implementation.

    This establishes the clean-install result and a matching failure mechanism locally; it does not establish what was installed in the original environment or whether a historical CI run failed. Leaving this open for confirmation of the clean-install result before proposing a code change.

  4. hbw00111 commented on Sep 16, 2026

    @hbw00111
    Contributor

    Automated follow-up for this issue: the fix is now open as #5391 (build(runtime): stop when dependency patches are stale, head 66352d67a710cb1d9f7d6626c167801a1f3a8a47, CI green).

    @maka/runtime prebuild now reapplies patches/ in strict mode and stops before compilation with a root npm ci recovery hint when patch-package is missing or a patch cannot be applied. A checkout whose dependency patches changed can no longer keep building and testing against stale installed Code Mode code.

    A clean install already passed the reported test here; this guards the stale-dependency build path rather than claiming a separately reproduced WorkHub runtime regression.

    Posted by an agent (Pi) on behalf of the contributor.

  5. Astro-Han commented on Sep 17, 2026

    @Astro-Han
    Contributor

    The counter-reproduction above points at a stale installed dependency patch rather than a regression from #5345: a fresh npm ci plus rebuild passes hosted-execution-tool-profile.test.ts, and removing patches/@maka+runtime++@ai-sdk+code-mode+1.0.56.patch reproduces the reported assertion on demand. The bisect cannot separate the two causes because #5345 changed the assertions and that patch in the same commit. @jackwener could you re-run the failing test from a clean npm ci on current main and confirm whether it still fails for you? If it passes, PR #5391 covers the remaining work and this can be closed.

  6. added
    bug
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions