Release CS: stage-batch3 — 4-PR low-risk batch (v0.51.121) — state.db merge / display counts / compression marker / Windows launcher#2813
Merged
Conversation
…merge
Two bugs combined to cause historical messages to vanish from the WebUI
after a session was continued in a later conversation.
**Bug 1 — missing `id` in state.db SELECT (models.py)**
`get_state_db_session_messages()` did not include the `id` column in its
SELECT, so every row got a `("legacy", ...)` merge key instead of
`("message_id", ...)`. The timestamp gate in
`merge_session_messages_append_only()` explicitly exempts `message_id`-keyed
rows from its "skip if older than newest sidecar message" rule, but
legacy-keyed rows are unconditionally dropped. With a session that has any
new sidecar messages (max_sidecar_timestamp == today), all older state.db
rows were silently discarded.
Fix: include `id` when the column is present so rows get proper
`("message_id", ...)` keys and survive the timestamp filter.
**Bug 2 — always reads active profile's state.db, not the session's (models.py + routes.py)**
`get_state_db_session_messages()` always called `_active_state_db_path()`,
which returns the currently-active profile's database. Sessions belonging to
a different profile (e.g. `jump`) were read from the wrong state.db, returning
either no rows or unrelated ones.
Fix: add an optional `profile` parameter; when supplied, resolve the path via
`_get_profile_home(profile)` with a fallback to the active path if the
profile-specific db does not exist. The call-site in `routes.py` now reads
`session.profile` and passes it through.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er (#1952) PR #2783 by @Koraji95-coder — squashed from 3 commits (initial PR + Copilot review fixes + agent-dir validation). CHANGELOG entry merged into stamp commit.
…isk batch) Cherry-picked PRs: - #2788 (Carry00) — state.db merge: include id column + per-profile reads - #2797 (ai-ag2026) — align messaging session display counts (raw->merged) - #2803 (simjak) — compression marker strict predicate (no tool output) - #2783 (Koraji95-coder) — native Windows start.ps1 + README community link
This was referenced May 24, 2026
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.
Release CS — v0.51.121 — stage-batch3 — 4-PR low-risk batch
Third batch from the May 24 sweep. Four contributor PRs that are mechanical, well-tested, and pre-cleared by Opus advisor:
api/models.pystate.db readerprofile=param + missingidcolumn fixapi/routes.pymessaging-session branchapi/compression_anchor.py+ streamingstart.ps1(new) +README.mdCherry-picks
#2783 was squashed from 3 contributor commits (initial PR + Copilot review fixes + agent-dir validation). CHANGELOG entry merged into stamp commit.
Defensive fix folded into #2788
Test
test_issue1436_context_indicator_load_path.pymocksSession.load()returning a MagicMock whose.profileattribute is also a MagicMock. The contributor's originalif profile:was truthy on the mock and tried to resolve it throughapi/profiles._resolve_profile_home_for_name(), which rejects non-strings. Tightened the guard toisinstance(profile, str) and profile:— defensive against any caller that didn't read the docstring. Folded into the contributor's commit viagit rebase --autosquash.Pre-Opus gate
ast.parseon all touched .pyOpus advisor verdict
What's NOT in this batch