Record memory storage size after successful consolidation (#45956)

## What changed

Emit a `codex.memory.storage_bytes` histogram after successful phase-two consolidation, including runs with no workspace changes. Sum regular-file sizes recursively from filesystem metadata, excluding `.git` entries and symbolic links. Stop the phase-two duration timer before measuring storage.

## Testing

Add coverage for both memory versions, nested files, UTF-8 byte counts, Git metadata exclusion, and Unix symbolic links, including broken links and directory loops. Extend the workspace baseline reset test to verify the remaining storage size.

GitOrigin-RevId: 9170c34d656728897790decd2e2cabb38a81836f
This commit is contained in:
jif authored and copyberry committed 2026-09-16 14:49:24 +00:00
1 parent 4701aa4b42
commit 6500c1f844
5 files changed
+102 -3

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
pub(crate) const MEMORY_STARTUP: &str = "codex.memory.startup";
pub(crate) const MEMORY_STORAGE_BYTES: &str = "codex.memory.storage_bytes";
pub(crate) const MEMORY_PHASE_ONE_JOBS: &str = "codex.memory.phase1";
pub(crate) const MEMORY_PHASE_ONE_E2E_MS: &str = "codex.memory.phase1.e2e_ms";