Skip to content

test(checkpoint): measure Postgres storage growth - #5051

Merged
WillemJiang merged 1 commit into
bytedance:mainfrom
Ricky-7-Yan:test/checkpoint-storage-growth
Sep 1, 2026
Merged

WillemJiang merged 1 commit into
bytedance:mainfrom
Ricky-7-Yan:test/checkpoint-storage-growth

Conversation

@Ricky-7-Yan

@Ricky-7-Yan Ricky-7-Yan commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Refs #4189

Why

The retention design in #4189 is intentionally blocked on a protected-set/deletion contract. Current coverage measures memory and SQLite growth, while the production Postgres saver has no equivalent full/delta storage-growth row. That leaves the retention discussion without comparable checkpoint/blob/write evidence across durable backends.

This PR is measurement-only. It does not define a retention policy, delete production history, or claim that any measured row is safe to prune.

What changed

  • bench_channels.py accepts an opt-in postgres backend when TEST_POSTGRES_URI is set and runs it through AsyncPostgresSaver.
  • Every Postgres case uses a unique benchmark thread, verifies warm and reopened materialization, then removes only that temporary thread through the saver's public adelete_thread API.
  • Versioned JSONL schema v2 reports normalized checkpoint_*, blob_*, and write_* row/byte fields for memory, SQLite, and Postgres, while retaining aggregate logical byte fields.
  • SQLite reports zero separate blob rows because SqliteSaver embeds channel values in its checkpoint payload; Postgres reports checkpoint_blobs separately. The docs call out that backend byte encodings are not directly identical.
  • The summarizer includes the new storage fields by default.
  • Unit coverage pins the normalized Postgres queries, URI opt-in, case-scoped shared-backend thread IDs, diagnostic degradation, and memory/SQLite storage shapes. A real Postgres smoke test runs when TEST_POSTGRES_URI is available.

Surface area

  • Frontend UI — page / component / setting / interaction under frontend/
  • Backend API — endpoint / SSE event / request-response shape under backend/app
  • Agents / LangGraph — agent node, graph wiring, langgraph.json, or prompt change
  • Sandbox — docker/ or sandboxed execution
  • Skills — change under skills/
  • Dependencies — new/upgraded entry in backend/pyproject.toml or frontend/package.json (say what it buys us)
  • Default behavior change — changes existing behavior without the user opting in (default model, default setting, data shape)
  • Docs / tests / CI only — no runtime behavior change

Screenshots / Recording

Not applicable; this changes a benchmark and its JSONL output.

Validation

  • pytest tests/test_bench_checkpoint_channels.py tests/test_summarize_checkpoint_channels.py tests/test_delta_channel_checkpointers.py -q — 48 passed, 5 skipped
  • ruff check . — passed
  • ruff format --check . — passed (1,234 files)
  • Controller smoke: memory + SQLite, full + delta, 4 child-process rows, schema v2, failures=0
  • Real Postgres smoke was not run locally because TEST_POSTGRES_URI is not configured; the conditional test remains skipped in that environment.
  • Full offline suite (PowerShell: $env:PYTHONPATH='.;packages/harness;packages/extension-api'; uv run pytest -m "not live" tests/ -q) — 11,993 passed, 128 skipped, 230 failed, 82 errors in 20:17. None of the failures/errors are in the three related test modules; the non-zero cases are retained as current Windows/sparse-checkout environment evidence.

AI assistance

Tool(s) used: Codex

How you used it: Used for issue and repository analysis, implementation assistance, test design, documentation, and validation.

  • I've read and understand every line of this change and take responsibility for it — it's not unreviewed AI output.

@Ricky-7-Yan
Ricky-7-Yan force-pushed the test/checkpoint-storage-growth branch from 69a3492 to 6ffe77d Compare August 26, 2026 17:18
@Ricky-7-Yan
Ricky-7-Yan marked this pull request as ready for review August 31, 2026 15:35
@github-actions github-actions Bot added area:backend Gateway / runtime / core backend under backend/ area:docs Documentation and Markdown only risk:medium Medium risk: regular code changes size/L PR changes 300-700 lines labels Aug 31, 2026
@WillemJiang WillemJiang added this to the 2.1.0 milestone Sep 1, 2026
@WillemJiang
WillemJiang merged commit c56c729 into bytedance:main Sep 1, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Gateway / runtime / core backend under backend/ area:docs Documentation and Markdown only risk:medium Medium risk: regular code changes size/L PR changes 300-700 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants