Skip to content

fix(omp): trim oversized conversations for session capture - #337

Merged
edheltzel merged 7 commits into
mainfrom
feat/omp-capture-trim
Oct 17, 2026
Merged

edheltzel merged 7 commits into
mainfrom
feat/omp-capture-trim

Conversation

@edheltzel

Copy link
Copy Markdown
Owner

What Changed

  • Trim oversized omp captures using a 60% head / 40% tail byte budget, with a truncation marker and dropped-byte warning, within the 25 MiB JSON payload limit.
  • Scrub secrets before sizing and trimming so truncation cannot expose credential fragments.
  • Update capture documentation and regression coverage for oversized text, JSON escaping, and secret redaction.

Risk Assessment

✅ Low: The capture change is bounded, preserves payload limits and secret redaction, and introduces no substantiated defects.

Testing

The production build, focused tests, existing native smoke check, and native omp boundary scenarios passed against an isolated localhost model endpoint. Evidence records the base failure, persisted captures, byte counts, searches, and uninstall behavior. All required children exited successfully and disposable files were removed. This CLI capture change required no screenshots.

  • Live validation: ✅ go - 8 of 8 scenarios driven live against the product
Scenario Result Live Evidence
Complete ordinary omp turns and retain the complete ordered conversation with omp attribution ✅ pass live Native capture outcomes: native-normal; bun run scripts/e2e-omp.ts
Complete a session containing over 25 MiB of tool output and capture its small conversation without tool output or thinking ✅ pass live Native capture outcomes: native-tool-heavy
Capture a serialized payload exactly 25 MiB without truncation ✅ pass live Native capture outcomes: native-exact-25MiB
Exceed the payload limit and retain the 60/40 head and tail with a marker and accurate dropped-byte warning ✅ pass live Native capture outcomes: native-one-byte-over-25MiB and native-oversize-ascii; base reproduction transcript
Capture oversized escaped text and Unicode within the JSON byte limit while preserving characters and searchable tail text ✅ pass live Native capture outcomes: native-escaped-unicode; resume and search readbacks
Place a password across the trimming boundary and retain no credential fragments in captured text ✅ pass live Native capture outcomes: native-secret-at-trim
Resume a trimmed session and capture the newest turn with one active row while discarded middle text remains absent from search ✅ pass live Resume, search, and uninstall readbacks
Uninstall the plugin and complete another native omp turn without changing captured history ✅ pass live Resume, search, and uninstall readbacks
Evidence: Native capture outcomes and persisted-state readbacks
{
  "oracle": "docs/OMP_INTEGRATION.md: 25MiB serialized limit, 60/40 head-tail split, visible marker/warning; fixture input supplies exact text and byte counts independently of implementation",
  "requests": 8,
  "scenarios": [
    {
      "name": "baseline-oversize-ascii",
      "product": "omp 18.11.3 with base extension",
      "assistant": "Native boundary answer.",
      "capture": "skipped",
      "warning": "Working...\nRecall omp capture skipped: payload exceeds 25MiB",
      "live": true
    },
    {
      "name": "native-normal",
      "product": "packed Recall extension in native omp 18.11.3",
      "sessionId": "d1a45854-833a-42e3-a293-fdf5fe528cf5",
      "assistant": "Native boundary answer.",
      "source": "omp",
      "storedUtf8Bytes": 128,
      "envelopeBytes": 353,
      "completeOrderedText": true,
      "live": true
    },
    {
      "name": "native-tool-heavy",
      "product": "packed Recall extension in native omp 18.11.3",
      "sessionId": "615b34f5-5360-44c3-a6ed-9ba4f572eeee",
      "assistant": "Native boundary answer.",
      "source": "omp",
      "storedUtf8Bytes": 95,
      "envelopeBytes": 316,
      "completeOrderedText": true,
      "live": true
    },
    {
      "name": "native-exact-25MiB",
      "product": "packed Recall extension in native omp 18.11.3",
      "sessionId": "716acf86-d827-46c5-8b62-91398990ca6a",
      "assistant": "Native boundary answer.",
      "source": "omp",
      "storedUtf8Bytes": 26214179,
      "envelopeBytes": 26214400,
      "completeOrderedText": true,
      "live": true
    },
    {
      "name": "native-one-byte-over-25MiB",
      "product": "packed Recall extension in native omp 18.11.3",
      "sessionId": "a4bc0027-97d6-41f4-be60-6ab7352411f8",
      "assistant": "Native boundary answer.",
      "source": "omp",
      "envelopeBytes": 26214400,
      "capBytes": 26214400,
      "headJsonBytes": 15728487,
      "tailJsonBytes": 10485658,
      "headRatio": 0.6,
      "droppedUtf8Bytes": 39,
      "markerPresent": true,
      "middleAbsent": true,
      "unicodeWellFormed": true,
      "retainedHead": "HEAD_RETAINED_edge zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
      "retainedTail": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz TAIL_RETAINED_edge\n\nComplete this boundary check.\n\nNative boundary answer.",
      "warning": "Working...\nRecall omp capture truncated: 39 bytes dropped",
      "live": true
    },
    {
      "name": "native-oversize-ascii",
      "product": "packed Recall extension in native omp 18.11.3",
      "sessionId": "915d80af-e8d4-4d79-838f-4cd283c08118",
      "assistant": "Native boundary answer.",
      "source": "omp",
      "envelopeBytes": 26214400,
      "capBytes": 26214400,
      "headJsonBytes": 15728487,
      "tailJsonBytes": 10485658,
      "headRatio": 0.6,
      "droppedUtf8Bytes": 3146101,
      "markerPresent": true,
      "middleAbsent": true,
      "unicodeWellFormed": true,
      "retainedHead": "HEAD_RETAINED_ascii a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ",
      "retainedTail": "b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b  TAIL_RETAINED_ascii\n\nComplete this boundary check.\n\nNative boundary answer.",
      "warning": "Working...\nRecall omp capture truncated: 3146101 bytes dropped",
      "live": true
    },
    {
      "name": "native-escaped-unicode",
      "product": "packed Recall extension in native omp 18.11.3",
      "sessionId": "b4e1597f-18bb-43ab-b421-7b77afd942f1",
      "assistant": "Native boundary answer.",
      "source": "omp",
      "envelopeBytes": 26214394,
      "capBytes": 26214400,
      "headJsonBytes": 15728486,
      "tailJsonBytes": 10485653,
      "headRatio": 0.6000000991831164,
      "droppedUtf8Bytes": 12043646,
      "markerPresent": true,
      "middleAbsent": true,
      "unicodeWellFormed": true,
      "retainedHead": "HEAD_RETAINED_escaped \"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é",
      "retainedTail": "\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂\"\\\n\t\u{0001}é漢🙂 TAIL_RETAINED_escaped\n\nComplete this boundary check.\n\nNative boundary answer.",
      "warning": "Working...\nRecall omp capture truncated: 12043646 bytes dropped",
      "live": true
    },
    {
      "name": "native-secret-at-trim",
      "product": "packed Recall extension in native omp 18.11.3",
      "sessionId": "be5d0682-47f4-40af-a156-e486f5822152",
      "assistant": "Native boundary answer.",
      "source": "omp",
      "envelopeBytes": 26214400,
      "capBytes": 26214400,
      "headJsonBytes": 15728487,
      "tailJsonBytes": 10485658,
      "headRatio": 0.6,
      "droppedUtf8Bytes": 16777131,
      "markerPresent": true,
      "middleAbsent": true,
      "unicodeWellFormed": true,
      "retainedHead": "HEAD_RETAINED_secret xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "retainedTail": " q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q  TAIL_RETAINED_secret\n\nComplete this boundary check.\n\nNative boundary answer.",
      "warning": "Working...\nRecall omp capture truncated: 16777131 bytes dropped",
      "secretFragmentsAbsent": true,
      "live": true
    }
  ]
}
Evidence: Base extension reproduces oversized-capture skip
$ omp --print --model recall-boundary/recall-boundary --no-tools --no-skills --no-rules --no-lsp --no-title --resume ~/.no-mistakes/worktrees/fd32172f1538/01M555QW0R26CKKWJABC6REZ6N/.test-omp-capture/native/7e54789d-ebc5-45ba-99f3-d9f945fd0500.jsonl Complete this boundary check.
exit=0
stdout:
Native boundary answer.

stderr:
Working...
Recall omp capture skipped: payload exceeds 25MiB
Evidence: Updated extension captures oversized text
$ omp --print --model recall-boundary/recall-boundary --no-tools --no-skills --no-rules --no-lsp --no-title --resume ~/.no-mistakes/worktrees/fd32172f1538/01M555QW0R26CKKWJABC6REZ6N/.test-omp-capture/native/915d80af-e8d4-4d79-838f-4cd283c08118.jsonl Complete this boundary check.
exit=0
stdout:
Native boundary answer.

stderr:
Working...
Recall omp capture truncated: 3146101 bytes dropped
Evidence: Resume, search, and uninstall readbacks
{
  "live": true,
  "sessionId": "915d80af-e8d4-4d79-838f-4cd283c08118",
  "latestPrompt": "Remember the final amber garden result.",
  "latestAnswer": "Resumed amber garden answer.",
  "activeRows": 1,
  "oneTruncationMarker": true,
  "originalHeadRetained": true,
  "retainedUnicodeTailSearch": "Found 1 result(s):\n\n[messages#6] [Recall] 2026-10-17\n  HEAD_RETAINED_escaped \"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é漢🙂\"\\ \t\u{0001}é...",
  "droppedMiddleSearch": "No results found.",
  "resumedTailSearch": "Found 1 result(s):\n\n[messages#8] [Recall] 2026-10-17\n  HEAD_RETAINED_ascii a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ...",
  "postUninstallCaptureUnchanged": true,
  "warnings": "Working...\nRecall omp capture truncated: 3146176 bytes dropped"
}

Pipeline

Updates from git push no-mistakes

⏭️ **Intent** - skipped

Step was skipped.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 8 of 8 scenarios driven live against the product
Scenario Result Live Evidence
Complete ordinary omp turns and retain the complete ordered conversation with omp attribution ✅ pass live Native capture outcomes: native-normal; bun run scripts/e2e-omp.ts
Complete a session containing over 25 MiB of tool output and capture its small conversation without tool output or thinking ✅ pass live Native capture outcomes: native-tool-heavy
Capture a serialized payload exactly 25 MiB without truncation ✅ pass live Native capture outcomes: native-exact-25MiB
Exceed the payload limit and retain the 60/40 head and tail with a marker and accurate dropped-byte warning ✅ pass live Native capture outcomes: native-one-byte-over-25MiB and native-oversize-ascii; base reproduction transcript
Capture oversized escaped text and Unicode within the JSON byte limit while preserving characters and searchable tail text ✅ pass live Native capture outcomes: native-escaped-unicode; resume and search readbacks
Place a password across the trimming boundary and retain no credential fragments in captured text ✅ pass live Native capture outcomes: native-secret-at-trim
Resume a trimmed session and capture the newest turn with one active row while discarded middle text remains absent from search ✅ pass live Resume, search, and uninstall readbacks
Uninstall the plugin and complete another native omp turn without changing captured history ✅ pass live Resume, search, and uninstall readbacks
  • bun install --frozen-lockfile --ignore-scripts with worktree-local HOME, TMPDIR, and BUN_INSTALL.
  • bun run build with the isolated environment.
  • bun test tests/omp-integration.test.ts with disposable Recall paths.
  • bun run scripts/e2e-omp.ts with the isolated environment.
  • bun ~/.no-mistakes/evidence/01M555QW0R26CKKWJABC6REZ6N/native-boundaries.ts drove native omp sessions, compared the base extension, and checked persisted capture text and byte counts.
  • bun ~/.no-mistakes/evidence/01M555QW0R26CKKWJABC6REZ6N/native-resume-search.ts drove resume, public CLI searches, and post-uninstall capture checks.
  • Removed disposable data, dependencies, and build outputs; confirmed no disposable processes remained.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Keep the head 60% and tail 40% of the 25 MiB stdin budget, with a marker, so a long session is still captured.
A linear shrink by JSON overflow dropped quote-heavy sessions to the marker. Search the text byte budget instead.
A head/tail cut can split a secret off its key. Scrub the joined text with the canonical write-safety guard before measuring the payload.
Binary search escaped prefix sums instead of re-serializing the payload on every probe.
A 100MiB branch must not allocate prefix arrays. Scan escaped lengths from each end and serialize the payload once.
Escaped-length budgeting already fits. Keep one skip if the serialized payload still exceeds 25MiB.
@edheltzel
edheltzel merged commit 2eda0ab into main Oct 17, 2026
3 checks passed
@edheltzel
edheltzel deleted the feat/omp-capture-trim branch October 17, 2026 15:16
edheltzel added a commit that referenced this pull request Oct 17, 2026
* feat(omp): trim oversized session_stop captures instead of skipping

Keep the head 60% and tail 40% of the 25 MiB stdin budget, with a marker, so a long session is still captured.

* fix(omp): binary-search capture trim so escaped text is not marker-only

A linear shrink by JSON overflow dropped quote-heavy sessions to the marker. Search the text byte budget instead.

* fix(omp): scrub conversation text before capture trim

A head/tail cut can split a secret off its key. Scrub the joined text with the canonical write-safety guard before measuring the payload.

* fix(omp): scan capture text once before the head/tail trim

Binary search escaped prefix sums instead of re-serializing the payload on every probe.

* fix(omp): stream the capture trim instead of allocating prefix sums

A 100MiB branch must not allocate prefix arrays. Scan escaped lengths from each end and serialize the payload once.

* fix(omp): drop the capture trim recut

Escaped-length budgeting already fits. Keep one skip if the serialized payload still exceeds 25MiB.

* no-mistakes(document): Clarify omp capture trimming and payload limits

---------

Co-authored-by: Atlas-Key <296298943+Atlas-Key@users.noreply.github.com>
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