Support omp (oh-my-pi) sessions: history import and host detection
Maintainers usually reply within 1 day
@tal32123 is already working on this.
Since Nov 10, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend, developer-experience
Research direction
Read trace/pi.py and plugin/hosts.py, then inspect the existing Pi host history and detection paths. The issue names omp's session directory and log differences, but host detection still needs a discriminator from omp's hook environment. A linked pull request is already open; completion would include importing converted sessions with source mtimes and tests for title-prefixed logs and ignored non-message entries.
Written by the indexing model from the issue text.
Description
Problem. Running under omp (it loads Claude Code plugins and sets CLAUDE_PLUGIN_ROOT), the plugin reports host claude and te history import finds nothing: ClaudeCode.history() only reads ~/.claude/projects, while omp keeps sessions in ~/.omp/agent/sessions/<cwd-folder>/<timestamp>_<id>.jsonl.
The omp log is Pi-style (tree of id/parentId entries, toolCall/toolResult, same usage fields), with two differences:
- the first line is
{"type":"title",...}, sopi_session_header(which only checks entry 0) returns{}; - extra entry types (
custom,custom_message,developer,credential_pin,model_change, ...) that must be ignored.
Proposal.
trace/pi.py: makepi_session_headerscan the first few entries fortype == "session"; havepi_session_to_claudewritetimestampandcwdon user lines (needed byclaude_log_head/ history import).plugin/hosts.py: addOmp(Pi)withkeeps_history = Trueand ahistory()that lists omp's session dir, converting each log withpi_session_to_claudeinto a cache understate_root()(keep the source mtime so the "recent"/"too_old" filters work). Register inHOSTS; addompto--host.- Host detection: pick
omprather thanclaudewhen running under omp (needs a discriminator from omp's hook env; I haven't confirmed which var). - Tests: fixture omp log starting with a
titleline; assert history lists it andpi_prompt_countignores non-message entries.
Verified locally with a minimal patch of 1 + a history() hook on ClaudeCode: te history import --dry-run went from nothing to "2 earlier session(s) would be read", and te status showed +2 from earlier history, 44 prompts. Happy to send a PR for 1, 2, 4 if the approach is acceptable; 3 needs maintainer input.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 344
- Avg merge
- 17h 41m
- Merged PRs (30d)
- 73
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TokenEconomizer
-
trace: Pi's 1-hour cache writes are priced at 1.25x, but billed at 2xPossibly taken @Shizoqua claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/TokenEconomizer#221 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
microsoft/TokenEconomizer#219 ·
Maintainers usually reply within 1 day
-
CommandCode supportOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/TokenEconomizer#205 ·
Maintainers usually reply within 1 day
-
Copilot CLI hooks fail on Windows: command runs under PowerShell, which can't execute te-hookPossibly taken @sykuang claimed this 3 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
microsoft/TokenEconomizer#204 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
microsoft/TokenEconomizer#193 ·
Maintainers usually reply within 1 day
All issues in microsoft/TokenEconomizer
Similar issues
-
documentation type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
add entry to blockOpen
Difficulty 1/5 Under an hour Newbie friendliness 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Possibly taken @0z5a claimed this today. Openneeds-triage
Difficulty 2/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
microsoft/graphrag#2626 · 1 comment ·
Maintainers usually reply within 5 days