Repository navigation
feat(ingest): roll OMP session transcripts into the brain - #69
Merged
Merged
Conversation
OMP (oh-my-pi) sessions live at ~/.omp/agent/sessions/<slug>/<ts>_<uuid>.jsonl
and were invisible to the brain — a user who moves their daily driver off
Claude Code stops accumulating memory the day they switch. OMP entries map
onto the same NormalizedSession contract (toolCall -> {id,name,input},
toolResult -> user text, metadata events skipped), so the hourly scanner,
sidecar SHA dedup, redaction, and dual episodic+markdown writes all apply
unchanged; origin is namespaced session.digest.omp.
Parse failures in OMP files are counted and logged rather than swallowed:
silent schema drift would otherwise starve the brain with no signal, the
same failure shape the v0.7.0 audit found for Claude memories.
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
Ingests oh-my-pi (OMP) coding-agent session transcripts into the brain through the same
NormalizedSessionpipeline as Claude Code and Codex. Without this, switching daily-driver agents means memory accumulation stops on switch day.agent/tools/_session_normalize.py—normalize_omp_session(): maps OMP JSONL entry types (session,model_change,messageuser/assistant/toolResult,custom,ttsr_injection) onto the shared contract.toolCall→{id, name, input};toolResult→ user-role text (same convention as Claudetool_result); harness bookkeeping (title,custom_message,ttsr_injection) skipped as metadata.agent/tools/claude_session_digest_adapter.py—iter_omp_sessions()walker; OMP filenames are<timestamp>_<uuid>.jsonlso the source path is stashed for sidecar SHA dedup, same as the Codex walker.agent/tools/digest_cli.py—backfill --sourcegainsomp, defaults toall(bothremoved; verified nothing in launchd/cron/harness referenced it).--omp-rootoverride for testability. Incremental (hourly LaunchAgent) passes the OMP root unconditionally.agent/tools/discover_all_sources.py— tier-2 manifest row for OMP transcripts.Review-driven hardening
A staff-engineer review pass (second model) caught two things, both fixed in this branch:
iter_omp_sessionsnow counts and logs unparseable files (threaded through backfill'slog) — silent schema drift would otherwise starve the brain with no signal, the same failure shape the v0.7.0 audit found for Claude memories.…Z) documented inline.Test plan
test_session_normalize.py(9 new OMP tests: fields, role order, thinking+text concat, toolCall/toolResult mapping, malformed-line tolerance, metadata-only → None),test_session_digest.py(discovery, dual-surface backfill, sidecar dedup),test_digest_budget.py(root-patching isolation fix).~/.omp/agent/sessions:dry-run: would process claude=0 codex=0 omp=5, no errors.