[codex] Add durable cache spool#1
Merged
Merged
Conversation
This was referenced May 21, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a durable JSONL spool in front of the HypAware Iceberg cache so live sources no longer commit every
appendRows()call as a tiny Iceberg append.What changed
appendRows()now durably appends batch envelopes to per-table JSONL spool files.--refresh autoqueries debounce cache flushes for 2 minutes and print a cache freshness message to stderr when pending rows are skipped.--refresh alwaysandhyp query refreshforce pending spool rows into Iceberg before query.bytes_writtenaccounting now uses snapshot metadata instead of scanning every file underdata/.Why
The previous path wrote directly to Iceberg for every cache append. Event sources like gascity and ai-gateway often append one row at a time, producing many tiny Parquet files and metadata commits. The old byte accounting also scanned the full Iceberg data directory on every append, making writes get slower as file count grew.
Validation
git diff --checknode --checkon changed JS filesnpm run smoke -- cache_spool_batchingnpm run smoke -- cache_query_debouncenpm run smoke -- cache_roundtripnpm run smoke -- ai_gateway_passthroughnpm run smoke -- gascity_attach_writes_partitionnpm run smoke -- otel_listener_writes_rowsnpm run smoke -- sink_export_drivernpm run smoke -- local_parquet_exportnpm run smoke -- central_forward_outboxnpm run smoke -- blob_sink_parquet_local_fsnpm run smoke -- gateway_codex_capturenpm run smoke -- gateway_claude_capture