Skip to content

feat(parser): capture Pi thinking level as reasoning effort - #2503

Merged
mariusvniekerk merged 1 commit into
kenn-io:mainfrom
gadenbuie:feat/pi-effort
Oct 30, 2026
Merged

mariusvniekerk merged 1 commit into
kenn-io:mainfrom
gadenbuie:feat/pi-effort

Conversation

@gadenbuie

Copy link
Copy Markdown
Contributor

Sessions from the Pi agent now show their reasoning effort in AgentsView, the same way Claude and Codex sessions do. Before this, the effort column was always empty for Pi, so the model label in the UI never included the thinking level and effort-based filtering had nothing to match.

What changed

The Pi parser now fills reasoning_effort on assistant messages from two sources:

  1. message.thinkingLevel on the message itself. Pi has written this since v0.99.0.
  2. The most recent thinking_level_change entry, when a message has no inline value. Pi has written these entries since its first releases, so older sessions get an effort value too. Sessions with neither source stay empty.

The inline value wins when both exist. Values are stored exactly as Pi wrote them. Pi types the field as a plain string, so a new level name needs no AgentsView change. off is stored as off. A null thinkingLevel (oh-my-pi can write one) is ignored.

Parser data version 151 reparses the Pi family (Pi, OMP, OMO, Prime Agent, StepCode) in place, so existing archives pick up the new field without a full resync. They share one parser, so they are all in scope. The column already exists in SQLite, the mirrors, the wire format, and the frontend, so there is no schema or UI change.

docs/internal/session-format-sources.md records the source fields and when upstream added them.

Where to look

  • internal/parser/pi.go: currentEffort tracking in the entry loop and applyPiReasoningEffort.
  • internal/db/data_version_scope.go: the version 151 scope.
  • internal/parser/pi_test.go: TestPiParserReasoningEffort.

Limits

  • Effort state is tracked linearly through the file, like the existing model fallback. It is not branch-aware in Pi's session tree.
  • OMP's configured selector (such as auto) is not captured. Only the resolved level is.

@roborev-ci

roborev-ci Bot commented Oct 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (5cee289)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex, 6m5s | Total: 18m24s

@roborev-ci

roborev-ci Bot commented Oct 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (813cf2f)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex, 8s | Total: 3m49s

@roborev-ci

roborev-ci Bot commented Oct 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (cc4e446)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex, 8s | Total: 3m10s

@roborev-ci

roborev-ci Bot commented Oct 30, 2026

Copy link
Copy Markdown

roborev: Combined Review (5a12805)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex, 10s | Total: 3m2s

@mariusvniekerk
mariusvniekerk merged commit e447c92 into kenn-io:main Oct 30, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants