Skip to content

fix: pin the Desktop engine to 1.2.8 - #4545

Open
mvanhorn wants to merge 5 commits into
ashhart:mainfrom
mvanhorn:fix/4429-desktop-engine-pin
Open

mvanhorn wants to merge 5 commits into
ashhart:mainfrom
mvanhorn:fix/4429-desktop-engine-pin

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

What this changes

When a user asks the affected model to read a file in a Desktop development build, the chat displays the model’s tool-call markup and the file is never read. Desktop stages engine 1.1.0 by default on macOS ARM64. That version passes the affected model’s tool call through as chat text, so Desktop receives no structured call to execute.

The Desktop engine manifest now pins 1.2.8 and uses the matching macOS ARM64 archive name, extraction root, release URL, and SHA-256 checksum. The packaging test checks all five fields, adding coverage for the archive name and extraction root.

./tools/zig/host_tests_test.py could not run in this environment for the TensorFold change (./tools/zig/host_tests_test.py is not executable).
js_tests ran no targeted tests.
./tools/zig/host_tests_test.py could not run because the file was not executable.
The Git whitespace check produced no recorded diagnostics.
npm run verify:mobile has no recorded output or exit status.
repo_lint appears three times with no recorded output or exit status.
The Linux Zig host test command has no recorded suite result.
The macOS Zig host test script has no recorded suite selection or result.

ruff check . has no recorded output or exit status.
zig fmt --check build.zig zig has no recorded output or exit status.
No test was run with the TensorFold change reverted, because no test was named as covering the reported bug, so none is shown to catch this bug.
The changed spec app/scripts/package-checks.test.mjs did not run here: no test runner for it was available.

Fixes #4429

Checks on this head

Not applicable to this change.

Receipt

Not applicable to this change.

Checklist

  • The title and description match the head commit, including the receipt and the stack.

  • New tests fail before the change, pass after it, and skip cleanly without their dependency.

  • Comments and docstrings are one line. No measurements or history in the source.

  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.

  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.

  • No precision traded for speed. If the bits change, the description says which sums change and why.

  • Decode and prompt processing are no slower than main at one stream and the widest admitted; with --drafter, no slower than without it, greedy and sampled

AI was used for assistance.

The Desktop engine manifest now pins 1.2.8 and uses the matching macOS
ARM64 archive name, extraction root, release URL, and SHA-256 checksum.
The packaging test checks all five fields, adding coverage for the
archive name and extraction root.

Fixes ashhart#4429
@AIFlowML

Copy link
Copy Markdown
Contributor

I independently checked 550fde882d3f7cab6464968aa5de345cd98723ad on macOS ARM64 with Node 24.22.1. It trial-merges cleanly into 311749c0.

  • From app/, node --test scripts/package-checks.test.mjs passed with the lockfile's KaTeX 0.19.0 present in node_modules. Running the same new test with main's 1.1.0 manifest failed at the pin assertion, as expected.
  • node scripts/fetch-engine.mjs, with TENSORFOLD_ENGINE_ARCHIVE pointing to the official 1.2.8 ARM64 archive, verified the pinned digest and staged 24 files. The staged build/engine/bin/tensorfold-native --version reported 1.2.8. The published asset digest matches the manifest.

This covers the manifest regression and actual archive staging. The Desktop model round trip reported in #4429 was outside this run. Official release

Igor Lessio - AIFLOW LABS

@ashhart

ashhart commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Thanks @mvanhorn, the checksum, archive name and root match the v1.2.8 release, and the pin is the right fix for #4429.

The desktop job shows what else moves with it. Six tests fail on this head. Two of them (model-revisions.test.ts, room-worker-effort.test.ts) fail on main too and aren't yours. The other four are the benchmark's:

  • benchmark/receipt.test.ts: "This benchmark requires the bundled TensorFold 1.2.8 engine."
  • benchmark/controller.test.ts, storage.test.ts and service-integration.test.ts follow from the same refusal.

The cause is app/electron/agent/engine/benchmark/version.ts:5: the local benchmark only accepts the engine versions whose receipts were reviewed (1.0.12 and 1.1.0). With a 1.2.8 pin, Desktop's benchmark would refuse every run. Newer engines' receipts also carry fields the strict parser rejects. And since engine 1.3.0, tensorfold info prints a startup budget line instead of memory floor (#4407), which the app's parser and cluster admission need to read before the pin can go past 1.2.x.

We have that follow-on work ready on our side: the reviewed versions, the receipt fields, the info-line parsing and drafter rows for #4407, and a pin to the current release. Unless you'd like to take it further yourself, we'll carry your commit into one PR with those changes, with you as its author, and close this one in its favour. Either way is fine; just say which you prefer.

  • Synthena

The benchmark version gate only listed 1.0.12 and 1.1.0 as reviewed, so
the 1.2.8 pin made every live benchmark receipt fail validation. Add
1.2.8 to the reviewed set, and have the fake benchmark engine and the
receipt test read the current version from build/engine.json instead of
hard-coding 1.1.0.
@eXsoR65

eXsoR65 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Fact-checked the pin at head 6880cda7a, and ran the red desktop CI to ground — the failure is inherited from main, not caused by this PR.

Manifest (all five fields): app/build/engine.json now reads version 1.2.8, archive tensorfold-1.2.8-macos-arm64.tar.gz, root tensorfold-1.2.8-macos-arm64, url …/releases/download/v1.2.8/tensorfold-1.2.8-macos-arm64.tar.gz, sha256 7b7977d7b6a2c723e10217378cf026eac1f925c4895d3b1fe1194d695c8e0df2 — the checksum independently re-matched against the published v1.2.8 .sha256 release asset, and the archive name/root/URL all match the actual release assets. package-checks.test.mjs now asserts all five fields (archive name and extraction root added); version.ts exports BENCHMARK_ENGINE_VERSION from the manifest with 1.2.8 in the reviewed versions; receipt.test.ts/fake-benchmark.mjs are consistently manifest-driven. The remaining 1.1.0 strings are intentional (historical reviewed version + the invalid 1.1.0-preview mutation).

CI differential — four runs, identical failure set. All at step "Desktop security and runtime tests", all 900/902 passed with the same 2 failures:

Run Result
This PR's CI run 45024996386 — desktop (macOS) and desktop-linux 900/902, same 2
Main's newest completed app.yml run 44945867366 @ 31c24d895 — both platforms 900/902, same 2
Local replica at PR head 6880cda7a 900/902, same 2
Local replica at current main 52b136276 900/902, same 2

The two failures are byte-identical across all four (same pass/fail stream):

  1. electron/agent/engine/model-revisions.test.ts:50 — "the selected immutable revision stays installed", 'ok' !== 'installed'
  2. electron/main/host/room-worker-effort.test.ts:80 — "Reviewed worker import ../../../shared/bot-policy"

These are the same assertions main has failed since Nov 20 (also documented on #4376). Neither test imports anything this PR touches, and main's app/ tree is unchanged since the merge-base 34af03a12 — the whole app diff between this PR and main is exactly the PR's five files. Every test this PR changes passes, locally and in the PR's own CI on both platforms; all other PR CI jobs passed too.

Local replica method: exact CI pin per .github/workflows/app.yml — node v22.23.2 (checksum-verified), npm ci --ignore-scripts in app/ and mobile/, npm test (= test:agent), CI env replicated; run at both heads.

So from our side: the pin is correct and verified against the release, the new packaging coverage does what it says, and the red CI is main's pre-existing test:agent failure — nothing blocking here.

— eXsoR65's AI agent (DeepSeek Harness): read-only fact-check plus a local CI replica on eXsoR65's Linux machine; eXsoR65 authorized this comment before posting.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Thanks for laying that out. Since the newer receipt fields, the #4407 info-line parsing and the pin to the current release are already ready on your side, please carry both commits here into your PR and close this one in its favour.

@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks @mvanhorn for updating the Desktop engine pin and for keeping the packaging checks aligned with it.

One receipt compatibility change is needed before this can merge. TensorFold 1.2.8 writes settings.kv_cache, plus finish_reason and route on every benchmark sample. For models whose thinking can't be turned off, it also writes settings.thinking_mode. Desktop's exact-key receipt validator rejects all four, and the updated fake receipt omits them, so its passing scenarios don't represent a real 1.2.8 receipt.

With the bundled 1.2.8 engine, an ordinary managed local benchmark will therefore fail receipt validation instead of saving a result. Please accept these fields in the validator and add them to the fake and receipt fixtures.

  • Synthena

Validate the optional cache, thinking, finish reason, and route fields
while keeping older receipts readable and rejecting unknown keys.
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Done in 4193639. The receipt validator now accepts settings.kv_cache, settings.thinking_mode, and finish_reason and route on each sample. Unknown keys are still rejected, and 1.0.12 and 1.1.0 receipts still validate. The fake benchmark and the receipt fixtures now write all four fields, so the passing scenarios match a real 1.2.8 receipt.

Under Node 22, the receipt, controller, storage and service-integration benchmark tests pass, along with package-checks. Typecheck adds no new errors over the base, and git diff --check is clean.

@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thanks @mvanhorn for updating the engine pin and adding the new receipt fields. Three compatibility cases still need small fixes:

  • Natural stops: parseBenchmarkReceipt still requires every successful sample to have 256 tokens. Please also accept the new receipt format's natural-stop case: sampled output ending with a stop reason after at least 128 tokens but fewer than the requested total. A 177-token regression should verify protocol completeness and retained delivery aggregates, alongside negative boundary cases.
  • Route semantics: please require chat samples to use the chat-completions endpoint and require every sample of one fixture to keep the same route throughout the run. Negative tests for those two cases should sit beside the existing unknown-route and historical-receipt coverage.
  • Flash Next model information: the pinned engine prints a startup budget rather than a memory floor for Flash Next. Please accept that form in both parseInfoOutput and cluster admission. The startup total already includes weights, prompt planes and selectors, KV/state, keepalive and runtime reserve, so use it directly without adding weights or the cold-pack budget again. Real-output fixtures for both parsers should retain the legacy memory-floor path as well.

These changes would keep the new pin compatible with valid natural stops, native routing rules and cached Flash Next loading.

  • Synthena

Accept 1.2.8 natural-stop samples (finish_reason stop, at least 128 and
fewer than the requested tokens), require chat samples on the
chat-completions route and one route per fixture, and read the Flash
Next startup budget in parseInfoOutput and cluster admission without
adding weights again. The legacy memory-floor path is unchanged.
@mvanhorn

Copy link
Copy Markdown
Contributor Author

Updated in 4792271:

  • Natural stops: parseBenchmarkReceipt accepts an ok sample whose finish_reason is stop with at least 128 and fewer than the requested tokens. receipt.test.ts adds a 177-token case for protocol completeness and the delivery aggregates, plus boundary cases at 127 tokens, a short sample without stop, and length below the total.
  • Routes: chat samples must use /v1/chat/completions, and each fixture keeps one route through the run. The negative cases sit next to the unknown-route and historical-receipt ones.
  • Flash Next: parseInfoOutput and cluster admission in native-adapter.ts read the startup budget: line and use its total as is, without adding weights or the cold-pack budget. The legacy memory floor: branch is kept, not priced is refused, and cli.test.ts and native-adapter.test.ts carry fixtures for both forms.

@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thanks @mvanhorn. The 1.2.8 manifest, archive/root URL and checksum fields are aligned, and the Flash Next startup-budget handling now does what was requested in both parsing and cluster admission. The sampled 177-token regression, delivery aggregates, route-consistency checks and legacy fixtures are useful additions.

A few protocol cases still need tightening before this can land:

  • A natural stop is valid only for sampled community-v2 output. receipt.ts:94-95 currently also accepts a greedy or community-v1 short ok sample. Please add both negative cases.
  • Current v2 samples must all carry route; deleting the field from every sample currently passes. Please keep absent routes only for the historical protocol and test uniform omission.
  • Successful v2 samples need a non-null finish_reason, even at the full requested token count. The current positive test at receipt.test.ts:12-14 accepts null and should become a negative case.
  • Managed v2 runs need kv_cache of bf16 or fp8; null belongs to attached runs. The managed-null positive in the same test should also change.
  • The browser demo still reports engine 1.1.0 at app/src/lib/mock/engine.ts:59, and the onboarding and engine-details components display it. Please derive that current version from the engine manifest so the preview stays aligned with future pin changes.

The PR applies cleanly on main.

  • Synthena

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Updated in e59fa61:

  • Natural stops: a short ok sample with finish_reason: stop is accepted only on sampled (temperature 1) community-v2 output. receipt.test.ts adds negative cases for a greedy short stop and a community-v1 short stop.
  • Routes: current v2 receipts must carry route on every sample; uniform omission is now a negative case, and a community-v1 receipt without route or finish_reason still parses.
  • finish_reason: current v2 ok samples need a non-null value even at the full token count. The null positive at lines 12-14 is gone, and null or missing finish_reason are negative cases.
  • kv_cache: since receipts stay managed: true only, a null or missing kv_cache is now rejected and only bf16 or fp8 pass. The managed-null positive became a negative case.
  • Browser demo: src/lib/mock/engine.ts reads its version from build/engine.json, and engine-ipc.test.ts asserts the demo snapshot matches the manifest.

@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thanks @mvanhorn, this is in good shape, and all five points from our last review are done:

  • Natural stops: a short stop now counts only for sampled community-v2 output, with negative cases for a greedy short stop and a community-v1 short stop.
  • Routes: current v2 receipts must carry route on every sample. A uniform omission fails, and historical receipts still parse without it.
  • finish_reason: a successful v2 sample needs a non-null value even at the full token count. The old null positive is now a negative case.
  • kv_cache: only bf16 or fp8 pass for a managed run. Null and missing values are rejected.
  • The browser demo now takes its engine version from build/engine.json, with a test that keeps the two in step.

It also merges cleanly with today's main.

Because this changes the engine every Desktop build ships, the last step is a run of the real app with the pinned engine. Please check three things:

If you can run those in a development build on an Apple-silicon Mac, please post what you see.

Thanks again for sticking with this through several rounds.

  • Synthena

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop dev app pins engine 1.1.0, causing model tool calls to render as text

4 participants