Skip to content

feat(parser): capture Posit Assistant reasoning effort - #2505

Merged
mariusvniekerk merged 4 commits into
kenn-io:mainfrom
gadenbuie:feat/posit-assistant-effort
Nov 2, 2026
Merged

mariusvniekerk merged 4 commits into
kenn-io:mainfrom
gadenbuie:feat/posit-assistant-effort

Conversation

@gadenbuie

@gadenbuie gadenbuie commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds support to AgentsView for recording the reasoning effort of Posit Assistant sessions. The model effort shown next to each message in the UI, and stored in the SQLite archive and its mirrors, is now filled in for these sessions. Before this change, effort showed for Claude, Codex, Command Code and (in #2503) Pi, but Posit Assistant messages always showed none.

This follows the Pi work in #2503 and has the same shape: a parser change, a data-version scope, tests, and a format note. No schema, wire format, API or frontend change is needed, because messages.reasoning_effort and its rendering already exist.

What the format stores

Each assistant line in lm-messages.jsonl carries the effort the request used at message.providerOptions.providerMetadata.positai.thinkingEffort.

  • It is a plain string. The writer's schema allows off, minimal, low, medium, high, xhigh and max. Model-specific levels such as adaptive are also honored.
  • The writer resolves the user's preference against the selected model's supported levels first, so the stored value is the effective level.
  • It can change between messages in one session.
  • It is omitted for models without thinking support and for logs written before the field existed.

What changed

  • internal/parser/posit_assistant_provider.go: assistant messages copy positai.thinkingEffort into ReasoningEffort, verbatim. off is stored as off. A missing field leaves it empty. User, system and tool messages never carry effort.
  • internal/db/db.go and internal/db/data_version_scope.go: data version 158, scoped to AgentPositAssistant. Existing archives reparse those sources in place; session and source identities do not change. Positron is a separate agent and is not affected.
  • internal/parser/posit_assistant_provider_test.go: TestPositAssistantProviderReasoningEffort, a table test covering the inline value, verbatim storage (off, xhigh, adaptive), a mid-session change, an absent field, no carry-over from an earlier message, and non-string values.
  • internal/sync/posit_assistant_effort_upgrade_test.go: an upgrade regression test. It stamps a Posit Assistant session at version 157 with empty effort, then checks that a sync fills in the effort in place, keeps the session ID, file path and file hash, and leaves another agent's session alone.
  • docs/internal/session-format-sources.md: a "Reasoning effort" entry in the Posit Assistant section with the source paths, introduction commit and release, and the data-version note.

Limits and tradeoffs

  • No fallback. Unlike Pi, there is no settings event to fall back on. conversation.json stores metadata.model.thinkingEffort, but only as the latest preference for the whole conversation, and it was introduced in the same Posit Assistant change as the per-message field. Using it would add nothing for older sessions and would misreport mid-session changes. Older sessions keep an empty effort.
  • Verbatim values. AgentsView does not validate or normalize the string, so new levels the writer adds will show up without a code change.
  • No incremental path. The Posit Assistant parser re-reads the whole file on each sync, so there is no cursor state to keep in step.

Where to look

The extraction is three lines in positAssistantFillAssistant. Most of the review effort belongs on the upgrade test and the format note.

@roborev-ci

roborev-ci Bot commented Oct 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (8bf8762)

Verdict: Changes require fixes for 1 finding.

Medium

  • internal/db/db.go:618; internal/db/data_version_scope.go:39: Upgrading a version-150 archive to 152 encounters undeclared version 151, causing ScopedDataVersionProviders to return nil and trigger a full archive rebuild. This unnecessarily reparses every provider, including for users without Posit Assistant sessions, and breaks existing in-place upgrade tests.

    Fix: Use version 151 consistently or declare the skipped version's scope. Add an upgrade regression test verifying that Posit Assistant sessions are reparsed while unaffected sessions remain current and preserved in place.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex, 1m21s | Total: 28m44s

@gadenbuie
gadenbuie force-pushed the feat/posit-assistant-effort branch from 8bf8762 to 42bb306 Compare October 28, 2026 15:29
@gadenbuie

This comment has been minimized.

@gadenbuie
gadenbuie marked this pull request as draft October 28, 2026 15:31
@roborev-ci

roborev-ci Bot commented Oct 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (42bb306)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex, 4m32s | Total: 13m45s

@mariusvniekerk

Copy link
Copy Markdown
Collaborator

yeah pr stacks are not across forks yet :(

@gadenbuie
gadenbuie force-pushed the feat/posit-assistant-effort branch from 42bb306 to 8ed4858 Compare October 30, 2026 21:19
@roborev-ci

roborev-ci Bot commented Oct 30, 2026

Copy link
Copy Markdown

roborev: Combined Review (8ed4858)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security), codex (test-value) | Synthesis: codex, 11s | Total: 4m14s

@gadenbuie
gadenbuie marked this pull request as ready for review October 30, 2026 22:10
@mariusvniekerk mariusvniekerk self-assigned this Nov 1, 2026
@mariusvniekerk
mariusvniekerk force-pushed the feat/posit-assistant-effort branch from 8ed4858 to 8660c65 Compare November 1, 2026 20:42
@roborev-ci

roborev-ci Bot commented Nov 1, 2026

Copy link
Copy Markdown

roborev: Combined Review (8660c65)

Verdict: Changes require fixes for 2 findings.

High

  • internal/sync/posit_assistant_effort_upgrade_test.go:72: The fixture downgrades only Posit Assistant while leaving gptme at the current data version. The sync-count and gptme assertions therefore cannot detect broken promotion of unaffected sessions or accidental inclusion of gptme in the upgrade scope.

    Fix: Stamp both sessions and PRAGMA user_version at 160. Preserve the effort-restoration and identity checks, and verify that the unaffected session is promoted without reparsing.

Medium

  • internal/sync/posit_assistant_effort_upgrade_test.go:79: The regression test deterministically fails because previousVersion is 157, so the scope assertion checks upgrade 158, which affects AgentOMP, while expecting AgentPositAssistant. The Posit Assistant upgrade is registered at 161.

    Fix: Set previousVersion and the fixture's PRAGMA user_version to 160 so the assertion and reopen exercise the 160-to-161 upgrade.


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

The Posit Assistant effort capture is data version 161 after the rebase
onto main, because main used versions 158 to 160 for OMP and Antigravity
CLI repairs. The upgrade test still started from version 157. It asked
which providers the 157 to 158 step reparses, got OMP, and failed on
every Go test job.

The test now starts from version 160, so it checks the step that belongs
to this change. The format note now names version 161 as well. The
repository's mdformat hook also rewrapped some earlier paragraphs in that
note; their wording is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Nov 1, 2026

Copy link
Copy Markdown

roborev: Combined Review (de09e23)

Verdict: Changes require fixes for 1 finding.

Medium

  • internal/sync/posit_assistant_effort_upgrade_test.go:72: The unaffected-agent portion of the upgrade test leaves gptme at version 161 while downgrading only Posit Assistant. Consequently, gptme never qualifies for promoteUnaffectedSessions, and removing promotion entirely would still pass the sync-count and gptme-version assertions.

    Fix: Keep the Posit Assistant restoration and identity checks. Either remove the gptme fixture and its assertions, or stamp both sessions at version 160 and verify that reopening promotes gptme to 161 before SyncAll, which must still sync only Posit Assistant.


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

@mariusvniekerk
mariusvniekerk merged commit 9d0fbdb into kenn-io:main Nov 2, 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