Skip to content

Start teamSizes time budget before Session discovery - #1950

Merged
Fei2411 merged 1 commit into
devfrom
fix/teamsizes-time-budget
Nov 21, 2026
Merged

Fei2411 merged 1 commit into
devfrom
fix/teamsizes-time-budget

Conversation

@Fei2411

@Fei2411 Fei2411 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Issue

No issue; found by Software Factory's scout. Bug: teamSizes in app/src/import.mjs started its time budget only after Session discovery, so with a 1 ms budget a call on 1,000 Sessions still took ~100 ms.

What changed / 改了什么

  • teamSizes creates its clock before sessionDirs(...) discovery, so discovery counts against the budget.
  • If the budget is already spent after discovery, it returns { sessions } (the existing over-budget shape) without measuring sizes.
  • app/test/import.test.mjs: fake-clock regression test (fails before the fix), plus normal and empty-team cases.

Changelog

none

How I checked it / 怎么验证的

  • cd app && npm test: 530 pass, 0 fail, 3 skipped (new regression test failed before the fix)
  • node scripts/build-client.mjs --check (no client change)
  • npm run lint (app has no lint script)
  • Smoke test (no index.js / src/host/ change)
  • Screenshot (no interface change)
  • Leak scan node scripts/scan.mjs: 0 must fix

Checklist / 检查

  • One issue, one subject. / 只做一件事。
  • src/client/ not changed.
  • No keys, tokens or personal data, also in screenshots.
  • No AI tool as author or Co-authored-by.

Agent: Devin (Cognition)


Product Engineer opened this PR for Lulu
Implemented in session Start teamSizes time budget before Session discovery
Review with Devin · Open in Devin Desktop


Discovery ran before the clock started, so a 1 ms budget on 1,000 Sessions still took about 100 ms. Discovery now counts against the budget, and sizes are omitted when it is already spent.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T09:23:51.103411Z e9a907e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@Fei2411 Fei2411 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Reaper review — verdict: pass (head e9a907e)

  • Fix is right: clock is now created before sessionDirs(...), so discovery counts against budget, and an already-spent budget returns { sessions }, the same shape main.mjs already handles for the over-budget case.
  • The fake-clock test fails on origin/dev and passes here (checked by swapping in dev's import.mjs); node --test test/import.test.mjs in app/: 31 pass, 0 fail.
  • Non-blocking: sessionDirs is synchronous, so a slow discovery still runs to the end before the budget check; the call returns without sizes but is not cut short. That's fine for this fix.
  • PR body has the Agent: Devin (Cognition) line; template filled.
  • Overlaps: no other open PR touches app/src/import.mjs or app/test/import.test.mjs.

Written by Devin

@Fei2411
Fei2411 merged commit 870d02a into dev Nov 21, 2026
15 checks passed
@Fei2411
Fei2411 deleted the fix/teamsizes-time-budget branch November 21, 2026 09:39
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.

1 participant