From c3eb9cad22366d6ef5f7bff2414fe50b38d3f769 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Thu, 3 Dec 2026 10:18:44 +0100 Subject: [PATCH] docs: the review items of #859 that go on top - docs/chat-view-plan.md still said a Docker case with working hooks updates only at the start and end of a turn; since hostTranscriptPath() maps the container path to the host's copy, it gets mid-turn updates. - The captureIntentPrompt comment said only hook-fed sessions have a transcript watcher; statusline reports and full reads start one too. The third item (the SSE header count) needs no change on the merged tree: master already had 164 constants under a header that said 163, and with transcript:update the header's 165 is right. Co-Authored-By: Claude Opus 5.5 --- docs/chat-view-plan.md | 13 ++++++++----- src/web/server.ts | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/chat-view-plan.md b/docs/chat-view-plan.md index 315d9798..50eb103b 100644 --- a/docs/chat-view-plan.md +++ b/docs/chat-view-plan.md @@ -135,11 +135,14 @@ The chat view also listens for these events: `transcript:complete` does not help here. It fires only for a `result` row, and an interactive Claude transcript has none. -A Docker case whose hooks do reach the server gets no mid-turn updates. Its hook reports the -transcript's path inside the container, which the host cannot open. The watcher -keeps that path, so the full read starts no second one. Such a session refetches on -`session:working` and `session:idle` alone, and so updates only at the start and end -of each turn. +A Docker case reports the transcript's path inside the container +(`/home/agent/.claude/projects/...`), which does not exist on the host. The case mounts the +host's `~/.claude/projects` at that folder, so `hostTranscriptPath()` +(`claude-conversation-report.ts`) maps the reported path to the host's copy before the +watcher starts, and such a session gets the same mid-turn `transcript:update` events as a +local one. A reported path outside that folder, or one with a `..` segment, is kept as +reported. The host cannot open it, so that session refetches on `session:working` and +`session:idle` alone and updates only at the start and end of each turn. ## How the user sends a prompt diff --git a/src/web/server.ts b/src/web/server.ts index 6fb22d07..8fe3e121 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -1550,8 +1550,9 @@ export class WebServer extends EventEmitter { /** * Read My Mind intent capture: fold one transcript user prompt into the * case's intent profile (docs/readmymind-plan.md). Opt-in via - * `readMyMindEnabled` (default OFF) and claude-only; the mode gate is - * belt-and-braces since only hook-fed sessions have a transcript watcher. + * `readMyMindEnabled` (default OFF) and claude-only. The mode gate is needed: + * a transcript watcher is started by hook reports, statusline reports and a + * full transcript read (the chat view), not only for hook-fed Claude sessions. */ private async captureIntentPrompt(sessionId: string, text: string): Promise { const session = this.sessions.get(sessionId);