Skip to content

Desktop: defer built-in engine titles until the foreground run settles - #4072

Merged
ashhart merged 5 commits into
ashhart:mainfrom
AIflow-Labs:codex/fix-3606-defer-local-thread-title
Nov 20, 2026
Merged

ashhart merged 5 commits into
ashhart:mainfrom
AIflow-Labs:codex/fix-3606-defer-local-thread-title

Conversation

@AIFlowML

@AIFlowML AIFlowML commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

A new Desktop conversation used to start a background title request on the built-in TensorFold engine before starting its first foreground run. The title now starts after the foreground run settles successfully and releases its engine lease. Cancelling the run or renaming the conversation while it is running prevents the deferred request. Custom providers keep their existing title timing.

Checks on this head

  • Head commit: 6138ef456fe8f0467f5f5ebd7b9e5639d5e731ea.
  • Lean checker: 168 inherited findings on both base and head, zero new. Contributor preflight and git diff --check passed.
  • Focused regression: With a held stream, the real Desktop host requested the title before releasing the foreground engine lease on base. On this head it starts the title after release, preserves manual renames and cancellation, and leaves custom-provider timing unchanged. The controller and network response are synthetic.
  • Desktop on M5 Max, Node 22.23.3: npm test passed 892/892 test files on this tree. Typecheck, build, mobile verification and the private-leak check passed.
  • Native on M5 Max: zig fmt --check build.zig zig passed. zig build test test-golden -Dcpu=apple_m1 -j8 --summary all passed 921/921 steps and 15,518 tests, with 136 skipped and zero unexpected golden differences on the native input tree at the pinned base. The live-main merge check includes newer unrelated native changes.
  • CI: 13 hosted checks passed and two scheduled-only jobs skipped. Linux zig-b failed one existing native benchmark-routing assertion with exit 2. The workflow tested synthetic merge 4890e89b9aea23fe70034eeeb2235f53bb9bffa7 over 5d43ad587548644983f40cf61d18d11ccc9436f1. That exact diff is limited to the three Desktop TypeScript files. On Linux x86-64 with Zig 0.17.0, zig build -Dfixed-cpu test-benchmark-routing-host passed 30/30 on both trees. The test-server-cpu replay had identical counts on both trees (1,659 passed, 15 skipped, one failed), with a different failure in the config fixture under umask 002, tracked in Serve config host test fails under a group-friendly umask #4113. With umask 022, the full Linux server CPU suite passed on both trees (5/5 build steps, 1,655 tests passed and 15 skipped on each run). The hosted routing failure has not reproduced locally.
  • Coverage: The host fixture checks request order. The M5 Max measurement below covers one prompt. Packaged Windows and Linux Desktop UI and the reported M1 Max device remain untested.

Follow-up Metal measurement

On an M5 Max with 128 GiB, the published 1.2.10 Metal engine served the reporter's pinned Qwen3.8-27B and DFlash2 revisions (22d8d538154e0e5b6f8dcb1fcc74a60a0798104c and 50307d4c4cde6860d4eee73e2547cd786fe8e8a4). I alternated three runs per arm at context 8,192 and two configured streams, with the same 600-token greedy counting request and zero cached prompt tokens. In the overlap arm, the 24-token title request was sent first. In the deferred arm, it was sent after the foreground reply.

All six foreground replies produced the same token hash, reported min_rows=16, and used 59 draft rounds. Median foreground decode was 164.7 tok/s with overlapping HTTP requests and 167.9 tok/s when deferred. The M5 engine queued each overlapping title for 3.58–3.90 seconds. The reported draft-width collapse did not reproduce on this M5 Max arm, so the evidence for the PR remains the Desktop request-order regression. The title test request reached its token cap while thinking, so this run measured timing and order only.

Receipt

N/A. This changes when Desktop requests a conversation title. The patch is confined to Desktop host scheduling.

Checklist

  • Title, head and receipts agree.
  • The same production-path regression fails on base and passes on head.
  • Comments follow repository limits.
  • Public author and committer identity and privacy checks passed.

Igor Lessio - AIFLOW LABS

@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thanks @AIFlowML. The request-order regression is clear and the fix keeps the title off the engine until the foreground run settles, with renames, cancellation and custom providers untouched. Your follow-up arm is honestly reported: the draft-width collapse did not reproduce there, so the landed evidence is the order fix itself, which stands on its own.

It applies cleanly to today's main. The head checks are the last thing we watch; nothing is needed from you.

  • Synthena

@ashhart
ashhart force-pushed the codex/fix-3606-defer-local-thread-title branch from 6138ef4 to c2ac507 Compare November 20, 2026 08:27
@ashhart
ashhart merged commit 632dac4 into ashhart:main Nov 20, 2026
2 of 16 checks passed
ashhart added a commit that referenced this pull request Nov 20, 2026
@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thank you @AIFlowML. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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.

2 participants