Skip to content

test(agent-core-v2): give the sessionIndex list baseline CI headroom - #2615

Merged
sailist merged 3 commits into
mainfrom
test/sessionindex-baseline-headroom
Aug 5, 2026
Merged

test(agent-core-v2): give the sessionIndex list baseline CI headroom#2615
sailist merged 3 commits into
mainfrom
test/sessionindex-baseline-headroom

Conversation

@RealKai42

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — the problem is explained below.

Problem

The baseline: warm listRecent(limit=20) at 1k vs 10k vs 50k sessions test asserts a wall-clock median below 100ms on shared CI runners. Under runner load the 50k-row list median exceeds the budget and fails unrelated PRs: 100.17ms on a main run (run 30910016839) and 139.55ms on PR #2614. The section comment already states the design intent — numbers are logged for phase-to-phase comparison and only loose complexity budgets should gate CI.

What changed

  • Raised the absolute list tripwire from 100ms to 300ms, ~3x headroom over the worst observed CI median (139.55ms); the same median is ~2ms on an uncontended machine, so a genuine regression still trips the assertion.
  • Left the get / count budgets at 50ms untouched: they measure ~0.8ms even at 50k rows, so they already carry ~60x headroom.
  • Kept the scale-free complexity check (at50k.list < at1k.list * 10 + 50) as the primary regression guard, matching the section design.
  • Updated the comment above the assertions with the rationale and the observed numbers.

Verified locally: the full sessionIndex.test.ts file passes (29/29).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7960f9f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 4, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@7960f9f
npx https://pkg.pr.new/@moonshot-ai/kimi-code@7960f9f

commit: 7960f9f

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7377f277ef

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// tripwire keeps 3x headroom. get/count stay at 50ms: they measure ~1ms
// even at 50k rows. The complexity check is the real guard: 50x the rows
// must not cost ~50x the time.
expect(at50k.list).toBeLessThan(300);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Raise the effective complexity cap as well

When the 1k measurement remains fast but the later 50k measurement is delayed by shared-runner load, the unchanged final assertion is still much tighter than this new 300 ms limit—for example, an at1k.list median of 2 ms caps at50k.list at 70 ms. Thus the cited 100–140 ms CI medians can still fail whenever the load spike affects only the later phase, so this change does not reliably provide the intended headroom; the relative check also needs a noise-tolerant bound or a non-wall-clock complexity signal.

Useful? React with 👍 / 👎.

RealKai42 and others added 2 commits August 5, 2026 01:06
…ot wall clock

The baseline asserted wall-clock medians (list < 300ms, get/count < 50ms)
plus a relative time check — all still load-sensitive on shared CI runners.
Replace every time assertion with behavioral complexity assertions recorded
at the IQueryStore and fs seams: list must be served by bounded pageByColumn
fetches only, get is a single point lookup, count never touches the session
collection, no warm read enumerates session directories, and the per-op work
snapshot must be identical at 1k, 10k, and 50k sessions. Medians are still
logged for phase-to-phase comparison; the retry now absorbs a background
reconcile tick landing inside a counting window.
@sailist
sailist merged commit e7d5a0a into main Aug 5, 2026
14 checks passed
@sailist
sailist deleted the test/sessionindex-baseline-headroom branch August 5, 2026 02:59
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.

2 participants