Repository navigation
Conversation
[perf] agent: answer a wait group with one query (ThinkFlowLab#449) The agent waited for generation one job at a time. Each poll issued its own job.get request (954 across the traced run in ThinkFlowLab#449), read the whole project snapshot, and emitted a separate tool record. job.status answers up to 50 jobs from one snapshot and can wait server side for terminal states, so one call covers a whole wait group. The group is resolved once when the wait starts and stays frozen, so a job that settles mid-wait is still named in the answer with its errorDetails and recovery rather than disappearing. An empty group answers with a note instead of reading as success. A long wait costs one CLI process per 60 s window instead of one per second, and read-only queries no longer hold the turn's execution slot. Discovery no longer costs one process per command: capabilities merges the registered parser with the typed command models (56 commands), and project show --summary returns identities and revisions instead of every record body, including reference and editor-document identities so an edit can start from it. Measured on the same fixture: 14 jobs in one poll tick cost 180.6 ms and 14 snapshot reads before, 14.0 ms and 1 read after; command discovery drops from 33 CLI calls to 1; the project summary payload drops from 176,840 to 57,237 bytes. These are server calls, snapshot reads and payload sizes, not CLI process counts.
Redivesue
force-pushed
the
feat/446-stage-1-structure-first
branch
from
November 24, 2026 04:53
9b50c44 to
68b0103
Compare
3 of 5 tasks
Opening or switching a canvas waited for every node's media, including hidden nodes, before the workspace became interactive. Project the canvas from the opened snapshot and keep a stable asset source in node media fields. Object URLs are resolved only where media is displayed or read, so they no longer enter the document, undo history or save baseline. Saving compares asset identity, so a late media read cannot change a binding. Return text with open-canvas, show loading and failed states per node, and check reference-catalog files against its one snapshot. Refs ThinkFlowLab#446
Redivesue
force-pushed
the
feat/446-stage-1-structure-first
branch
from
November 24, 2026 05:01
68b0103 to
d369be5
Compare
Owner
Author
|
Superseded by ThinkFlowLab#485, which merged both stages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage 1 of 2 for progressive canvas loading (ThinkFlowLab#446). Opening or switching a canvas no longer waits for every node's media.
opendirector-asset://<projectId>/<assetId>). Object URLs are resolved only where media is displayed or read, so they stay out of the document, undo history and save baseline.open-canvasreturns text bodies, so hidden text, copy and export do not depend on a later read.reference-catalogchecks files against its one snapshot instead of replaying history for each asset.Stage 2 (independent, prioritised node media) is a separate pull request that builds on this one.
Linked issue
Labels
type:feat,area:canvas,area:performance.Test plan
Local, on this commit (rebased onto
8258d4b0):tsc --noEmit,check:i18n,check:browser-locale,check:browser-manifestandpre-commit run --from-ref mainpass.canvas_progressive_load(both languages, 3 of 3 runs),canvas_switch,structured_editors,editor_save,timeline_workflow(includes a real MP4 export),canvas_cropandlocal_output_deliverypass.Not run or not passing:
A dialog obscures the canvas. It fails the same way onmain.Left to CI: the repository's pull request checks.
Evidence that it works
Node states on this commit, in English and Chinese: one media read is held open, one fails, one has loaded, and the text node arrived with the canvas. After Retry, the failed node recovers on its own.
Six-direction switch benchmark on three heavy fixtures: A image-heavy (180 nodes, 0.67 GiB of assets), B video-heavy (89 nodes, 2.05 GiB), C mixed with editors (116 nodes, 0.97 GiB). Apple M2, 16 GiB, macOS 26.5. Browser runtime: Chrome 158 headless against the source server. Desktop: the packaged Electron 45 app.
Per direction: 4 warm-up switches excluded, then 10 measured switches. Values are median / P90 in ms, nearest-rank. "Usable" means the target title is shown, the workspace is not busy or inert, and every visible node is mounted. "Content" means every in-viewport image is decoded, video has
readyState >= 2, audio>= 1, and text is rendered. The driver uses CDP without the Network domain, because with it Chromium keeps every response Blob until the browser closes.Measured on
52102ed0(base) and this change before the rebase (9b50c442). The rebase adds three upstream commits that do not touch canvas open or media reads. The CI fixes after measurement only change how an editor probes a saved asset's size and how the browser test seeds its fixture.¹ The stage 1 desktop C↔B run stopped at switch 9 of 24, so these rows have 3 and 2 measured samples. See Known limitations.
Click feedback P90 is at most 31 ms with stage 1 (67 ms on base), within the 100 ms budget. Usable median is within 500 ms in every direction. Usable P90 misses the 1000 ms budget for A→C in both runtimes at this stage; stage 2 brings it under.
Cold open after a server restart, usable median: A 15339 → 2066 ms (browser) and 8250 → 1418 ms (desktop); B 7289 → 1269 and 3630 → 719; C 4033 → 1481 and 3487 → 878.
Peak Blob storage during a run drops from 1.0–2.8 GiB on base to 0.7–1.4 GiB, because hidden nodes are no longer read and text arrives with
open-canvas. Base also logged failed side requests (409 onassistant/draft, timed-outtool-tasksreads) in every run; stage 1 logged none outside the stopped run.Known limitations
storage_busylock timeout. In the stage 1 desktop C↔B run, six of C's media reads and one runtimes read got 409storage_busyabout 15 s after C opened, which matches the catalog lock timeout. As onmain, each media read at this stage replays the project's history under the catalog lock, so a burst of reads on a project with many commits can queue past 15 s. Those nodes stayed on "Could not load media" until Retry.storageRequestandCreationClient.openalready retrystorage_busy, buttransientReadFailuredoes not, somainhas the same gap; there the read error is swallowed and the node shows no media. Stage 2 removes the per-read replay, which shortens the lock holds, but does not close the retry gap.mainthe workspace stays inert until every node's media has loaded, so it cannot switch during that period at all.Provider verification
Bilingual UI
zh-CNanden-USare updated together. The progressive loading browser test runs in both languages.