Skip to content

fix(chat): show the reasoning level an OmO or omp session changed to after its first 64 KB - #279

Merged
devswha merged 1 commit into
devswha:mainfrom
ddotz:fix/omo-thinking-level-past-head
Oct 1, 2026
Merged

devswha merged 1 commit into
devswha:mainfrom
ddotz:fix/omo-thinking-level-past-head

Conversation

@ddotz

@ddotz ddotz commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Change

For omp-family transcripts (OmO, omp, Gajae Code), the composer's "Reasoning …" label is folded from two places:

  • the first 64 KB of the transcript after the last clear (METADATA_HEAD_BYTES);
  • the newest page.

These stores record the level only when it changes (thinking_level_change). A change that falls between those two places is never read. For example, a session started at high and switched to medium keeps showing high. model_change has the same gap, but assistant messages in the page usually hide it.

applyHistoryBoundary already scans every appended line once per file, looking for clear records. That same pass now also keeps the latest model_change and thinking_level_change record with its offsets. metadataHead appends the records that lie after the head and before the page start, in file order:

  • A record that the head cuts in two is taken whole.
  • Records from before a clear stay ignored.
  • No extra bytes are read. The cost is two Buffer.includes checks per scanned line, about +20% CPU on a cold 167 MB transcript (117 → 139 ms) and incremental after that.
  • Codex and Claude transcripts are unchanged. Codex snapshots its settings on every turn, and Claude records the effort on every response.

Validation

  • Reproduced on a fresh clone of main (ef90055), unchanged, with a real 18 MB OmO session file. It starts with thinking_level_change: high at byte 286 and switches to medium at byte 356,197. transcriptPage("omo-transcript", <file>).metadata.reasoning_effort is "high" on main (expected "medium") and "medium" on this branch.
  • New test, run for omp, OmO and gjc, using a model change and a level change placed past the 64 KB head and before the newest page:
    • Both changes are shown, also after forgetTranscriptState().
    • A change inside the page still wins.
    • After a clear followed by more than a page of turns, both reset to null.
    • It fails on main. It also fails if the filter that keeps out records from before the clear is removed.
  • bun run generate:types --check, bun run typecheck, bun run build: pass.
  • bun run test:unit: 728 pass, 1 skip, 0 fail (main: 725 pass, 1 skip, 0 fail).

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
CONTRIBUTING.md — configured

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: df3d3bc9-7a4e-4dad-8072-0cdcfa2d7bc5

📥 Commits

Reviewing files that changed from the base of the PR and between ef90055 and bfc553e.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • server/chat-history.test.ts
  • server/conversation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Reasoning levels and model selections now reflect the latest changes throughout OmO, OMP, and Gajae Code session history, including changes made before the most recent transcript section.
    • Clearing a session now resets its model and reasoning details, even when the latest transcript section begins after the cleared content.

Walkthrough

Non-Codex transcript processing now captures model and reasoning-level changes that occur after the bounded metadata head and before the newest page. Metadata assembly uses these records in transcript order. Tests cover boundary, cache-reset, in-page, and clear behavior.

Changes

Transcript metadata selection

Layer / File(s) Summary
Capture transcript setting records
server/conversation.ts
The reset scan retains the latest valid model and thinking-level records, with their positions, for non-Claude transcripts.
Assemble metadata across page boundaries
server/conversation.ts, server/chat-history.test.ts, CHANGELOG.md
Metadata assembly adds captured settings after the bounded metadata head and before the page start. Tests cover boundary ordering, cache reset, in-page changes, and clear behavior. The changelog records the fix.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: devswha

Merge Risk: ⚪ Minimal · up to bfc55

This fix makes OmO, omp, and Gajae Code sessions show the correct reasoning level after a change past the first 64 KB. No merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main fix: displaying reasoning-level changes for OmO and omp sessions after the first 64 KB.
Description check ✅ Passed The description includes both required sections. It explains the problem, resulting behavior, implementation scope, affected transcript types, regression coverage, performance impact, and validation r…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit 22bb21b into devswha:main Oct 1, 2026
11 checks passed
devswha added a commit that referenced this pull request Oct 1, 2026
Prepares v0.3.41.

- `package.json` and `herdr-plugin.toml` go to 0.3.41.
- The `[Unreleased]` notes move under `[0.3.41] - 2026-10-02`; compare
links added.
- 19 entries that had no PR link get one, with `by @login` for outside
contributors (#262 by @diegolhambi; #255, #277, #278, #279 by @ddotz).

After the merge: `gh workflow run release.yml --ref main -f
version=0.3.41`.
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