Skip to content

[perf] assistant: read live traces incrementally - #539

Merged
FayeSpica merged 6 commits into
ThinkFlowLab:mainfrom
FayeSpica:fix/live-trace-performance
Nov 29, 2026
Merged

FayeSpica merged 6 commits into
ThinkFlowLab:mainfrom
FayeSpica:fix/live-trace-performance

Conversation

@FayeSpica

@FayeSpica FayeSpica commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Read live trace logs by byte cursor in chunks of up to 512 KiB. The viewer processes appended records and stops polling after it drains the final bytes of a finished turn.
  • Preserve the original JSONL download path and ZIP size limit.

Linked issue

No GitHub issue applies.

  • Fixes #N or Refs #N is included, or no issue applies

Labels

type:bug, area:agent, area:performance

  • Labels applied

Test plan

  • Local: npm test (999 passed), 57 targeted Python tests covering conversations, trace reads, citations, reasoning, and job lineage, npm run build, i18n and browser manifest checks.
  • Local production build in headless Chrome: verified UTF-8 and JSONL records split across responses, in-place tool updates, polling shutdown after the final write, and byte-for-byte original ZIP export through the Chinese and English UI.
  • The Release checks browser gate now exercises a synthetic 64 MiB live trace served from disk. It checks the 512 KiB response cap, an idle 0 B response, exact total bytes (the fixture plus its append), and zero further trace requests after completion. It uses byte and request assertions to avoid machine-dependent timing thresholds.
  • Left to CI: hosted Release checks.

Evidence that it works

Replayed the same 72.4 MB try0073 DeepSeek trace in local Chrome against development builds. Five runs per version, alternated on the same machine. Measurements below cover the three-second steady window after the trace was displayed, with no new records appended.

Measurement Before After
Trace response body per idle refresh 72.4 MB 0 B
Longest main-thread long task per steady window 213–323 ms No task of 50 ms or longer observed
Displayed trace rows 672 672
  • Media attached, or N/A because this changes trace retrieval and responsiveness. The browser replay and network measurements capture the effect.

Provider verification

  • No real-provider calls were made. The benchmark replayed a recorded DeepSeek trace. The browser regression used a gated assistant fixture.

Bilingual UI

  • No user-facing copy changed. Both locales were exercised in the export test.

Signed-off-by: Weiming Liao <liaowm5@gmail.com>
@FayeSpica FayeSpica added type:bug Something is broken area:agent Agent runtime, assistant chat and tools area:performance Performance and responsiveness / 性能与响应速度 labels Nov 27, 2026
Signed-off-by: Weiming Liao <liaowm5@gmail.com>
Signed-off-by: Weiming Liao <liaowm5@gmail.com>
@github-actions github-actions Bot added the area:docs Documentation / 文档 label Nov 27, 2026
Signed-off-by: Weiming Liao <liaowm5@gmail.com>
Keep cursor reads and trace path validation for all runtimes, and adapt Pi trace parsing to incremental snapshots.
## summary
Validate the edit lease against the published project while staging
bytes under the upload handle lock. Cover overlapping publication
and upload requests through the HTTP API.
@FayeSpica
FayeSpica merged commit 226edf8 into ThinkFlowLab:main Nov 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent runtime, assistant chat and tools area:docs Documentation / 文档 area:performance Performance and responsiveness / 性能与响应速度 type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants