Repository navigation
FW6-CHAT: local chat-transcript overlay for claude panes - #98
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AI Lead integration fixes on FW6-CHAT (adversarial review): - a mid-append torn tail no longer fails the newest page (count excludes it; corrupt interior lines become skipped stubs, indices stay aligned) - toolUseResult dropped entirely (never rendered; carries Bash stdout and Edit diffs); all non-metadata strings now consume a 32KB entry budget, scanner token cap lowered 64MiB -> 8MiB - CP transcript source field is a passthrough string, not an enum, so a future agentd value cannot 5xx the route Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…417c) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds end-to-end Claude transcript capture: agentd reads and sanitizes JSONL transcripts, the control plane exposes them through an authenticated endpoint, and the dashboard renders paginated transcript entries in a responsive chat overlay with fallback behavior. ChangesTranscript command and agent capture
Control-plane and dashboard flow
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant TerminalOverlay
participant ControlPlane
participant Agentd
participant ClaudeTranscript
TerminalOverlay->>ControlPlane: POST session transcript request
ControlPlane->>Agentd: dispatch capture_transcript
Agentd->>ClaudeTranscript: resolve and read JSONL page
ClaudeTranscript-->>Agentd: sanitized entries
Agentd-->>ControlPlane: paginated result
ControlPlane-->>TerminalOverlay: transcript response
TerminalOverlay->>TerminalOverlay: format and render chat lines
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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.
🧹 Nitpick comments (1)
apps/dashboard/src/components/terminal/TerminalHistoryOverlay.tsx (1)
120-174: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winSilent fallback on chat-fetch failure loses diagnostic signal.
The catch block folds the expected
no_transcriptcase and unexpected failures (network errors, 5xx, auth issues) into the same silentonClose()fallback with no logging. This is consistent with the documented fallback design, but real failures become indistinguishable from "no transcript available," making regressions hard to diagnose in production.🔍 Proposed fix to add diagnostic logging
} catch { if (generationRef.current !== generation) return; + if (process.env.NODE_ENV !== 'production') { + console.warn('Chat transcript fetch failed; falling back to app-scroll.'); + } onScrollModeResolved('app-scroll'); onClose(); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/dashboard/src/components/terminal/TerminalHistoryOverlay.tsx` around lines 120 - 174, Update the inner catch around fetchChatPage in loadInitial to log unexpected chat-fetch failures before applying the existing fallback. Preserve the silent onClose behavior for the expected no_transcript case, while emitting diagnostic details for network, server, authentication, and other unexpected errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/dashboard/src/components/terminal/TerminalHistoryOverlay.tsx`:
- Around line 120-174: Update the inner catch around fetchChatPage in
loadInitial to log unexpected chat-fetch failures before applying the existing
fallback. Preserve the silent onClose behavior for the expected no_transcript
case, while emitting diagnostic details for network, server, authentication, and
other unexpected errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5e62977c-ed4c-487d-b271-37de442fb7b6
📒 Files selected for processing (27)
agents/agentd/cmd/agentd/main.goagents/agentd/cmd/agentd/main_transcript_test.goagents/agentd/cmd/agentd/transcript.goagents/agentd/internal/commands/executor.goagents/agentd/internal/protocol/command.goagents/agentd/internal/ws/protocol_fixtures_test.goapps/dashboard/src/components/TerminalView.tsxapps/dashboard/src/components/terminal/TerminalHistoryOverlay.tsxapps/dashboard/src/components/terminal/terminalScrollMode.tsapps/dashboard/src/components/terminal/transcriptFormatter.test.tsapps/dashboard/src/components/terminal/transcriptFormatter.tsapps/dashboard/src/hooks/useTerminalTouchScroll.test.tsapps/dashboard/src/lib/api.tspackages/ac-schema/src/command.tspackages/ac-schema/src/enums.tspackages/ac-schema/tests/core-workflows.test.tspackages/ac-schema/tests/protocol-fixtures.test.tsservices/control-plane/src/routes/sessions.tsservices/control-plane/tests/transcriptRoute.test.tsservices/control-plane/tests/transcriptSchema.test.tstasks/2026-07-21-fw6-chat-brief.mdtasks/frontend-ux-handoffs/fw6-chat.mdtasks/frontend-ux-log.mdtests/fixtures/protocol/commands-dispatch-capture-transcript.jsontests/fixtures/protocol/commands-result-capture-transcript.jsontests/journeys/controlPlaneMock.tstests/journeys/fw6-focus.journey.spec.ts
Device finding 6c: claude panes on remote wheel scrolling stayed slow with viewer-side redraw tearing (delivery itself verified working — the physics can't be tuned away). Owner-locked fix: serve claude-code's own on-disk session history locally.
What changed
capture_transcriptagent command: agentd retainstranscript_pathfrom claude hook events per session (with cwd-derived newest-mtime fallback) and serves newest-first entry pages from the JSONL. Containment is symlink-resolved before comparison and bounded to~/.claude/projects; non-regular files rejected; entries sanitized (toolUseResult dropped, 32KB per-entry string budget, 8MiB scanner cap); torn mid-append tails tolerated.POST /v1/sessions/:id/transcript(operator role, audited). Old agentd → HTTP 200ok:falseso the dashboard degrades gracefully.chatmode: claude panes render the formatted transcript (❯user, plain assistant, dim tool one-liners) with the same native scrolling, bottom anchoring, and unlimited load-older paging codex panes have.no_transcriptfalls back to the FW6-ALT wheel path.Review chain
Rollout
agentd binaries must roll on both hosts after deploy (deploy order is safe by construction).
🤖 Generated with Claude Code
Summary by CodeRabbit