Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🔍 Badge omits Assistant-only history
The Past sessions badge counts only exited Terminal sessions. Saved Assistant-only entries can populate the flyout while its trigger shows no count.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
| session, | ||
| })), | ||
| ...pastSummaries.map((summary) => ({ | ||
| ...pastSummaries.filter((summary) => !summary.harnessSessionId || !assistantByStudio.has(summary.harnessSessionId)).map((summary) => ({ |
There was a problem hiding this comment.
🟡 Archived Terminal history disappears
A matching Assistant entry makes pastRows remove a transcript-only Terminal summary. No registry session provides another Terminal action, so its transcript becomes unreachable.
Learn more
Terminal history can exist only as a SessionSummary, without a corresponding registry session. The mixed-row filter removes that summary whenever Assistant history has the same Studio session ID. AssistantHistoryPane only receives a Terminal action when state.sessions contains that ID, so this case has no remaining route to the Terminal transcript.
Example: A swept Terminal session has summary harnessSessionId: "studio-a", while retained Assistant history also has harnessSessionId: "studio-a". The merged list shows only the Assistant row. Opening it offers no “View Terminal history” button because studio-a is absent from state.sessions.
Recommended fix: Preserve the matching SessionSummary on the merged Assistant row and provide an action that opens reviewPastSession(summary). Do not rely solely on registry sessions when deciding whether mixed Terminal history exists.
Was this helpful? React with 👍 or 👎 to provide feedback.
| if (authority && authority === assistantAuthorityKey()) { | ||
| setAssistantHistory((prev) => ({ authority, unavailable, entries: [ | ||
| ...new Map([ | ||
| ...(prev.authority === authority ? prev.entries.filter((entry) => !assistantCwds.has(entry.cwd)) : []), | ||
| ...assistantEntries, | ||
| ].map((entry) => [entry.harnessSessionId, entry])).values(), | ||
| ] })); |
There was a problem hiding this comment.
🟡 Partial-history warning clears prematurely
A successful narrow loadHistory replaces unavailable after an earlier directory failed. Stale entries from that failed directory then remain without an incomplete-history warning.
Learn more
Assistant entries are merged per successfully refreshed directory, but failure state is stored as one boolean for only the latest call. Failed directories retain their previous entries because they are absent from assistantCwds. A concurrent or later load for another directory can then set unavailable to false without refreshing the failed directory.
Example: The history menu loads /a and /b; /b fails, so its old rows remain and the warning appears. The dead-session pane then loads /a successfully. That second call writes unavailable: false, hiding the warning even though /b still contains stale, unverified rows.
Recommended fix: Track Assistant history failures per cwd under each authority. Clear a cwd's failure only after that cwd succeeds, and derive assistantHistoryUnavailable from whether any currently retained/requested cwd remains failed.
Was this helpful? React with 👍 or 👎 to provide feedback.
| const part = z.discriminatedUnion("type", [ | ||
| z.object({ | ||
| id, | ||
| type: z.literal("text"), | ||
| text: z.string().max(4000), | ||
| truncated: z.boolean(), | ||
| }), | ||
| z.object({ | ||
| id, | ||
| type: z.literal("tool"), | ||
| callId: id, | ||
| name: z.string().max(256), | ||
| status: z.enum(["pending", "running", "completed", "error"]), | ||
| input: z.string().max(512), | ||
| output: z.string().max(512).nullable(), | ||
| error: z.string().max(512).nullable(), | ||
| startedAt: timestamp.nullable(), | ||
| completedAt: timestamp.nullable(), | ||
| truncated: z.boolean(), | ||
| }), | ||
| z.object({ | ||
| id, | ||
| type: z.literal("file"), | ||
| name: z.string().nullable(), | ||
| mime: z.string(), | ||
| }), | ||
| z.object({ id, type: z.literal("omitted"), nativeType: z.string() }), | ||
| ]); | ||
| const recordSchema = z.object({ | ||
| schemaVersion: z.literal(1), | ||
| reconstructed: z.literal(true), | ||
| revision: count.positive(), | ||
| binding: z.object({ | ||
| harnessSessionId: id, | ||
| cwd: z.string(), | ||
| conversationId: z.string().regex(/^ses_[A-Za-z0-9_-]{1,128}$/), | ||
| }), | ||
| capturedAt: z.string().datetime(), | ||
| turnCount: count, | ||
| messageCount: count, | ||
| limitations: z.array(z.string()), | ||
| turns: z.array( | ||
| z.object({ | ||
| id, | ||
| incomplete: z.boolean(), | ||
| messages: z | ||
| .array( | ||
| z.object({ | ||
| id, | ||
| role: z.enum(["user", "assistant"]), | ||
| parentId: id.nullable(), | ||
| createdAt: timestamp, | ||
| completedAt: timestamp.nullable(), | ||
| parts: z.array(part), | ||
| }), | ||
| ) | ||
| .min(1), | ||
| }), | ||
| ), | ||
| }); |
There was a problem hiding this comment.
Primary change type
Problem and motivation
Assistant sessions need a readable saved record in existing Studio history, including when the session never had a Terminal vendor ID. Grouping by directory would hide distinct sessions.
Summary and scope
Display Assistant public transcripts through the existing history and transcript styles, group mixed entries only by exact Studio ID, and preserve independent Terminal history. Mark reconstructed/shortened/incomplete content, collapse recorded tools, support Back, and fence late history and End results across account/navigation changes. Opening the pane performs no native operation.
Related work
Related issue: https://linear.app/sapiom/issue/SAP-3292
Depends on #1007. Native stack target: main. Uses the approved Assistant lifecycle flow; verified Resume and Continue actions follow separately.
Validation
Tests and documentation
Browser cases cover mixed and Assistant-only history, missing/foreign records, delayed account/navigation changes, Back and zero native calls. Tests use mocked server/native transport; they do not replace integrated acceptance. Updated assistant-history.md. Increment:811 changed lines including tests/docs/changeset; pr:size is absent.
Compatibility and release impact
Security
AI assistance
Checklist
Review evidence
These images show disposable browser fixture states before and after an explicit user action, not a historical pre-implementation baseline. They do not establish native execution or an installed activated release.
No baseline feature-before was captured. This is the resulting read-only reconstructed history view: