Repository navigation
Keep Grok Bot transcripts readable across unmapped entry shapes - #510
Conversation
Hydration rejected the whole replica when one entry lacked an id, carried a role other than user/assistant, had an untyped send-message, named a non-bc delegation peer, or when the roster used a schema other than v4. Discovery reads only the bounded head/tail, so the session listed but every open failed with an untyped GROK_BOT_* error that the desktop probe reports as "Probe could not finish". Unkeyable or duplicate entries are now skipped, unmapped shapes become markers, non-bc peers keep their message without a relationship edge, and an unreadable or newer roster only drops the title. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Session-Id: 400cfb07-41a9-4175-9ae3-935c13b8aa7c
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
[Medium impact] The PR appears safe to merge; the latest change preserves the title check.
|
A roster row that omits both name and title no longer clears the saved title, an unreadable roster path no longer aborts enumeration, and truncation is judged from the native first entry so a skipped malformed tbs0 is not reported as a trimmed window. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Session-Id: 400cfb07-41a9-4175-9ae3-935c13b8aa7c
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Session-Id: 400cfb07-41a9-4175-9ae3-935c13b8aa7c
Problem
Opening a Grok Bot session in the Agent Relay sessions view (
Grok-Bot · Local transcript) fails with Couldn't read this session. Probe could not finish.The session appears in the list because discovery's shallow read only checks the replica header and its bounded head/tail. Hydration, though, parses the full replica and stops on the first entry it can't map: a missing
id, a duplicate id, aroleother thanuser/assistant, asend-messagewith nomessage.type, atoAgent/fromAgentpeer that isn't abc-…cloud agent, or a roster whoseschemaVersionisn't 4. Any one of these fails the whole session with an untypedGROK_BOT_*error. The relay-desktop probe's reader (probe/src/probe/transcript.rs→store.hydrate) has no safe message for that error, so it falls back to the generic text atprobe/src/probe/main.rs:310.The plan's shape table comes from a single Grok Bot 0.70.2 install, so entry shapes that vary between installs or app versions break reads without warning.
Fix
valid_replicanow returns only keyable entries, skipping any entry without a usablekind/id/timestampMsand any repeated id, instead of failing the replica.send-messagewith no type, are each recorded as a session marker.bc-…keeps its message evidence, but no relationship edge is created.Regression fixture
tests/fixtures/grok-bot/replicas/drift-{replica,roster}.jsonholds invented data only. They are not in the corpus manifest, so existing snapshots don't change.grok_bot_unmapped_entry_shapes_and_newer_roster_still_hydratestages them over the complete fixture. Onmainit fails withHydrationFailed("GROK_BOT_INVALID_RECORD: missing/invalid id"); with this change it passes, along with the existing Grok Bot tests.Not verified
Grok Bot isn't installed on the machine this was built on, so the live session
be32c8af-…wasn't replayed. The fix covers every strict check that can fail hydration while discovery still succeeds.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Changes ingest semantics for Grok Bot (skipped entries, markers, roster leniency) which could alter stored transcripts versus strict failure, but scope is limited to that provider.
Overview
Grok Bot hydration no longer aborts the whole session when the local transcript replica or roster drifts from the shapes this adapter was written for.
Replica parsing skips entries missing a valid
kind/id/timestampMsor with duplicate ids instead of returningGROK_BOT_INVALID_RECORD. Unknown message roles andsend-messageentries without atypeare stored as markers rather than errors. Delegation edges are only created forbc-…cloud-agent peers; othertoAgent/fromAgentpeers still contribute message text. Roster files are treated as optional title metadata—unreadable, oversized, or newer-schema rosters no longer block acquire/hydrate, and title updates ignore rows that omitname/title. Truncated-window detection uses the native first replica entry so a skipped malformedtbs0is not misread as a trimmed tail.Regression coverage adds drift fixtures and tests for partial entry shapes, bad rosters, and skipped opening entries.
Reviewed by Cursor Bugbot for commit 774ec09. Bugbot is set up for automated code reviews on this repo. Configure here.
Agent Relay sessions
claudesession400cfb07· opened viagh pr create· last active 2026-10-17