Skip to content

Avoid empty managed Runtime scan intervals - #26

Merged
SaladDay merged 1 commit into
mainfrom
codex/runtime-scan-latency
Sep 22, 2026
Merged

SaladDay merged 1 commit into
mainfrom
codex/runtime-scan-latency

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Managed Runtime scans currently spend an entire five-second ticker interval at allocation EOF without observing any allocation. A small deployment therefore observes its instances only every other tick, adding unnecessary wait to wake requests and cleanup.

On EOF after a nonempty cursor, advance the existing bounded initialization operation and read the first page in the same reconciliation call. Preserve the five-second ticker, at most 32 allocation observations per call, one initialization operation per full scan, and a single refill so an empty store cannot spin. Provider APIs, harness behavior and suspension eligibility are unchanged.

Validation:

  • Full make check passed on Linux with real PostgreSQL; GitHub check passed.
  • New 0/1/31/32/33/65-allocation, EOF cleanup, cancellation and empty-store regressions pass; the nonempty scan and cleanup regressions fail against the main baseline.
  • Initialization/restart/uncertain-outcome tests now cover 33 allocations and require all of them to be serviced between initialization operations.
  • A fresh independent full-diff review found no substantiated in-scope issues. The reviewer independently passed managed/runtime store regressions, execution tests and both provider packages.
  • Four real Core/Codex/KVM runs using Kimi K3 passed: two baseline and two candidate samples, each with two Turns, idle source-VM release, exact snapshot restore, retained history/files/configuration, one-time initialization, equal idempotent retries and owned cleanup.

Measured request submission to Core Turn.started, using one server clock and PostgreSQL timestamps:

Path Baseline samples Candidate samples
New Session 25.146 s, 26.409 s 25.132 s, 26.376 s
Next Turn after suspension 17.415 s, 17.858 s 12.465 s, 12.937 s

Resume improved by 4.951 s and 4.921 s in these pairs. New-Session startup showed no meaningful improvement. The runs reused the same cached immutable image, helper and native runtime; image download, native first-tool timing and model response completion are outside this measurement. Two samples per version do not establish a percentile or SLA.

The sessions compatibility job passed persistence tests, then reproduced existing CI-001 at official_agent_references.py:73 (Expected BadRequestError). Its later container stage did not run. The same stale assertion was recorded before this change; no assertion or gate was bypassed.

Plan and evidence: Document A, PERF-001.

@SaladDay
SaladDay marked this pull request as ready for review September 22, 2026 13:48
@SaladDay
SaladDay merged commit 57069ad into main Sep 22, 2026
2 of 3 checks passed
@SaladDay
SaladDay deleted the codex/runtime-scan-latency branch October 7, 2026 06:38
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