Skip to content

perf(chat): throttle Super Agent scroll while streaming - #459

Merged
sparkleMing merged 4 commits into
memex-lab:mainfrom
o-mid:perf/chat-scroll-throttle
Sep 16, 2026
Merged

sparkleMing merged 4 commits into
memex-lab:mainfrom
o-mid:perf/chat-scroll-throttle

Conversation

@o-mid

@o-mid o-mid commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Limit automatic Super Agent transcript scrolling to once per 250ms while response tokens stream. Completed replies, agent-stop events, and chat errors force a scroll to the latest content.
  • Keep explicit UI actions and approval requests outside the stream throttle. Previously, an approval request or full-screen toggle inside the throttle window could leave the latest content offscreen after the user interrupted auto-scroll to read history.
  • Add seven widget regression cases using the real dialog, stream subscription, event batcher, and scroll controller: token coalescing at 249/250ms, completed replies, stop, error, approval visibility, full-screen actions, and disposal with buffered events. Inject an event stream and clock only for deterministic tests.

Validation

  • Passed: flutter test --no-pub --reporter expanded test/ui/chat/widgets/chat_scroll_throttle_test.dart test/ui/chat/widgets/chat_scroll_throttle_widget_test.dart test/ui/chat/widgets/agent_chat_dialog_test.dart — 43 tests.
  • Verified that the new approval and full-screen regression tests fail with the original non-stream scroll behavior and pass after the fix.
  • Passed: flutter analyze --no-pub --no-fatal-infos --no-fatal-warnings --no-congratulate — no errors; 157 existing warning/info findings. GitHub CI compares against the current main baseline.
  • Local full-suite execution was blocked by automatic approval review because elevated execution of the entire test tree exceeded the allowed targeted test scope. GitHub Flutter Quality run 35048791208 passed on d752c64b: 0 base/PR test failures and 0 new analyzer issues (161 findings on both base and PR).
  • Merged current main (including perf(timeline): load page attachments in two queries #457) into this branch before final validation.

The advisory AI-review job completed but returned no parseable report; it is not counted as a successful semantic review. The change was reviewed against the event/scroll call sites and verified with the regression tests above.

Batched stream flushes still animated the transcript to the bottom on every frame, which fought keyboard and input chrome.
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

PR AI Review / PR AI 语义预检

中文

  • 风险等级:高风险
  • 需要人工审核:是
  • 黄金链路影响:可能
  • 置信度:high
  • Workflow run:35048790204

AI 语义预检未得到可解析结果,需要 maintainer 人工审核。

影响范围

  • unknown

黄金链路

  • none
  • 说明:Claude Code Action 未产出结构化 JSON,AI 语义预检结果不可用。

风险项

  • high AI review 结果不可用。证据:Claude Code Action structured_output was empty or invalid.。
    建议:检查 Claude Action 日志和模型网关配置后重新运行 workflow。

测试缺口

  • 未发现新的测试缺口。

English

  • Risk level: HIGH
  • Human review required: YES
  • Golden path impact: POSSIBLE
  • Confidence: high
  • Workflow run: 35048790204

AI semantic review did not return a parseable result; maintainer review is required.

Affected Areas

  • unknown

Golden Path

  • none
  • Rationale: Claude Code Action did not produce structured JSON, so the AI review result is unavailable.

Findings

  • high AI review result unavailable. Evidence: Claude Code Action structured_output was empty or invalid..
    Recommendation: Check Claude Action logs and model gateway configuration, then rerun the workflow.

Test Gaps

  • No new test gap was reported.

AI review is advisory. Maintainers should verify the result before merging.

@github-actions github-actions Bot added ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review labels Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

PR Preflight Summary / PR 预检汇总

中文

  • 统一结论:低风险:两个预检均已完成,质量预检通过,可走普通手动合并流程。
  • Policy preflight:低风险。未命中打回或高风险规则。
  • Flutter quality:通过。Analyzer 和 test baseline 均未发现新增问题。
  • PR head:d752c64b7fa95d5b67ead6e22cb9e8de6b90e1f5
  • Policy run:35048790203
  • Flutter run:35048791208

English

  • Combined result: Low risk: both preflights completed and quality passed; use the normal manual merge flow.
  • Policy preflight: LOW RISK. No blocking or high-risk policy signal was found.
  • Flutter quality: PASS. Analyzer and test baselines found no newly introduced issue.
  • PR head: d752c64b7fa95d5b67ead6e22cb9e8de6b90e1f5
  • Policy run: 35048790203
  • Flutter run: 35048791208
PR Policy Preflight / PR 规则预检

PR Policy Preflight / PR 规则预检

中文

  • 判定:低风险
  • 变更文件数:3
  • 变更行数:288
  • Diff 是否截断:false

未发现确定性规则问题。

English

  • Decision: LOW RISK
  • Changed files: 3
  • Changed lines: 288
  • Diff truncated: false

No deterministic policy findings.

PR Flutter Quality / Flutter 质量预检

PR Flutter Quality / Flutter 质量预检

中文

  • 总体:通过
  • Analyzer baseline:通过
  • Test baseline:通过

English

  • Overall: PASS
  • Analyzer baseline: PASS
  • Test baseline: PASS

Flutter Analyzer Baseline

  • Base issues: 161
  • PR issues: 161
  • New issues: 0

No new analyzer issues introduced by this PR.

Flutter Test Baseline

  • Base failures: 0
  • PR failures: 0
  • New failures: 0

No new Flutter test failures introduced by this PR.

@github-actions github-actions Bot added ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review and removed ai: high risk AI review classified the PR as high risk needs human review AI review or policy signals require maintainer review golden path impact AI review found possible impact to a core user flow labels Sep 10, 2026
@o-mid
o-mid force-pushed the perf/chat-scroll-throttle branch from 86b38c3 to 5b1d03d Compare September 10, 2026 08:23
@github-actions github-actions Bot added ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review and removed ai: high risk AI review classified the PR as high risk needs human review AI review or policy signals require maintainer review golden path impact AI review found possible impact to a core user flow labels Sep 10, 2026
@github-actions github-actions Bot added ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review and removed ai: high risk AI review classified the PR as high risk needs human review AI review or policy signals require maintainer review golden path impact AI review found possible impact to a core user flow labels Sep 16, 2026
@sparkleMing
sparkleMing merged commit 60f235c into memex-lab:main Sep 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai: high risk AI review classified the PR as high risk golden path impact AI review found possible impact to a core user flow needs human review AI review or policy signals require maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants