Skip to content

perf(agent): cap companion LLM work after capture - #448

Merged
o-mid merged 2 commits into
memex-lab:mainfrom
o-mid:perf/cap-agent-concurrency
Nov 5, 2026
Merged

o-mid merged 2 commits into
memex-lab:mainfrom
o-mid:perf/cap-agent-concurrency

Conversation

@o-mid

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

Copy link
Copy Markdown
Collaborator

Summary

  • Local task executor now runs at most two agent-family LLM tasks at once; FTS and other work can still start.
  • Comment, perception, and initiative subscribers wait 20s before becoming runnable so Super Agent capture is not starved.

Test plan

  • flutter test test/data/services/local_task_executor_test.dart test/data/services/global_event_bus_dependency_test.dart
  • Capture a record while another agent turn is running and confirm Timeline stays responsive
  • Confirm companion comment/perception still run after the delay

Keep at most two agent-family tasks running and delay comment/perception/initiative by 20s so Super Agent capture is not starved.
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

PR AI Review / PR AI 语义预检

中文

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

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: 35090382678

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 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

PR Preflight Summary / PR 预检汇总

中文

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

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: d614112ca8cf276ddb9ae97c2eab757de3c00d29
  • Policy run: 35090382731
  • Flutter run: 35090386137
PR Policy Preflight / PR 规则预检

PR Policy Preflight / PR 规则预检

中文

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

未发现确定性规则问题。

English

  • Decision: LOW RISK
  • Changed files: 5
  • Changed lines: 160
  • 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.

@sparkleMing

Copy link
Copy Markdown
Collaborator

Code review against 890ccda4: [P2] Apply the agent-family limit while scanning candidates, not after truncating the candidate list.

At local_task_executor.dart:1013–1024, _findRunnableTasks returns at most slotsAvailable tasks before the agent-family filter runs.

For example, with two agent tasks already running, three global slots remain. If the first three otherwise-eligible pending tasks are also agent-family tasks, all three candidates are discarded. A later FTS/non-agent task is never considered, even though capacity is available. Subsequent polls can repeat this until an agent finishes, contradicting the intended ability for other work to continue.

Please include the remaining agent-family budget in candidate selection, skipping capped tasks while continuing the scan for other runnable work.

The added test leaves only two pending agent tasks ahead of FTS once two agents are active, so it does not cover this case. Please add a regression with at least three eligible pending agent tasks ahead of FTS and assert that FTS starts before either active agent is released. I recommend fixing this before merge. This finding is based on the scheduling code path, not a locally executed reproduction.

@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
@o-mid

o-mid commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

the old test didn't catch this — FTS was still inside the first candidate window, so it got picked before the agent filter ran.

_findRunnableTasks now takes the remaining agent slots and skips capped agent tasks while scanning, so other work (FTS etc) can still start. added a case that fills the cap first, then queues 3 more agents ahead of FTS.

@o-mid
o-mid merged commit 5ecbe4c into memex-lab:main Nov 5, 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