Repository navigation
feat(ui): auto-load older external-session transcript on scroll - #105209
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3609beff1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| content = text ? `Thinking\n\n${text}` : "Thinking"; | ||
| } else if (item.type === "toolCall") { | ||
| const label = | ||
| text ?? catalogRawString(item.raw, ["command", "name", "tool", "title", "query"]); |
There was a problem hiding this comment.
Handle nested Claude tool-use raw content
When a Claude Code transcript contains a tool_use block with its command under input.command and no plain text, the provider classifies it as toolCall and forwards the original message.content array as raw (extensions/anthropic/session-catalog.ts:629-640, extensions/anthropic/session-catalog.ts:1418-1427). This lookup only checks top-level object fields, so those Claude tool calls render as just Tool call instead of showing the command/tool name this change is meant to recover; the fallback needs to traverse array/nested raw content or the provider needs to promote that text.
Useful? React with 👍 / 👎.
|
Codex review: found issues before merge. Reviewed July 12, 2026, 5:30 AM ET / 09:30 UTC. Summary PR surface: Source +288, Tests +263. Total +551 across 7 files. Reproducibility: yes. at source level: Claude emits a raw content array for all-tool-use messages, while the changed helper only accepts top-level objects, producing a deterministic incomplete-rendering path. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the generic pagination lifecycle, but have providers emit stable display text for structured transcript items—or add a typed shared normalizer using real Claude and Codex fixtures—so the UI does not interpret undocumented provider-specific raw shapes. Do we have a high-confidence way to reproduce the issue? Yes, at source level: Claude emits a raw content array for all-tool-use messages, while the changed helper only accepts top-level objects, producing a deterministic incomplete-rendering path. Is this the best way to solve the issue? No in its current form; automatic pagination and viewport anchoring are appropriate, but structured rendering must consume the actual provider contract rather than only synthetic top-level object fixtures. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b4a0fc5c57cc. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +288, Tests +263. Total +551 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
…st only on a stalled cursor
d3609be to
6b76947
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b76947131
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!prepended) { | ||
| this.pendingHistoryAnchor = null; | ||
| this.historyAutoLoadBlocked = this.hasOlderMessages(); |
There was a problem hiding this comment.
Preserve the anchor when the last older page loads
When sessions.catalog.read returns the final older page with items but no nextCursor, loadCatalogSession() still prepends those messages and sets pendingHistoryAnchor, but it returns false because the cursor is exhausted. This block then treats that as “nothing prepended” and clears the anchor before updated() can restore scrollTop, so the common end-of-history load can jump the reader away from the message they were viewing instead of preserving the viewport.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
…claw#105209) * feat(ui): auto-load older catalog transcript on scroll with a stable viewport * fix(ui): surface the load-older fallback when auto-load is blocked on a short thread * fix(ui): clamp oversized aggregated tool output in catalog transcripts * fix(ui): stop catalog auto-pagination when an older read makes no progress * fix(ui): continue catalog paging through advancing empty pages; exhaust only on a stalled cursor * fix(ui): detect catalog cursor cycles to bound auto-pagination
Closes #105165
What Problem This Solves
Viewing an external Claude Code / Codex catalog session in the Chat pane, older history sat behind a manual "Load older" button; scrolling up loaded nothing and there was no loading affordance. Tool-call, tool-result, and reasoning items with no plain-text body rendered as an ugly
[Unsupported external session item]placeholder.Why This Change Was Made
Catalog sessions should browse like native ones — scroll up, older messages appear, viewport stays put. This adds auto-load-on-scroll for external (read-only) catalog transcripts and fixes the placeholder rendering. Native-session scroll-back needs server-side history paging work and is tracked separately in #105127.
User Impact
IntersectionObserver, or to retry after a transient failure on a short, non-scrollable thread).rawdata, or are cleanly skipped — no more[Unsupported external session item].Evidence
~/.claude:scrollTopauto-shifted 0 → 5890 to keep the same message in view (no jump).[Unsupported external session item]now rendersTool call/Tool resultwith real content and zero placeholder nodes.ui/src/e2e/claude-sessions.e2e.test.ts): scroll-to-top fires the observer →.chat-history-loadingspinner appears → older page loads →after.scrollTop ≈ before.scrollTop + (after.scrollHeight - before.scrollHeight)(anchoring) → no "Load older" button in auto mode → second scroll-to-top with exhausted cursor triggers no further load.ui/src/pages/chat/chat-pane.test.ts): raw-derived tool-call/tool-result/reasoning mapping; empty unknown item skipped; failed auto-load re-arms only on user scroll; blocked auto-load is recoverable via the fallback'sloadOlderMessages.node scripts/run-vitest.mjs ui/src/pages/chat/...and the catalog e2e pass locally; changed-file oxlint clean;pnpm buildclean (no[INEFFECTIVE_DYNAMIC_IMPORT]); i18n check clean on the rebased branch.