mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-15 10:59:32 +01:00
fix(edit-history): remote reads get time for their size, follow CLAUDE_CONFIG_DIR, keep the conversation after /clear
Review findings on the remote edit history: - A forward read may carry 13 MiB and "Load older" 29 MiB; the flat 30 s read timeout cut those off below ~1 MiB/s. The timeout now adds the transfer time at 256 KiB/s (remoteEditSourcesTimeoutMs). It ends a hung read, it does not cut a slow one. - The transcript lookup looked only under $HOME/.claude. It now uses an absolute CLAUDE_CONFIG_DIR of the ssh command's environment, else $HOME/.claude, for both the projects and the live sessions/<pid>.json. A value set only in .zshrc stays invisible (the lookup is a plain sh); documented, and the panel's remote no-transcript note says so instead of promising the next prompt (a remote host sends no hooks). - After a remote /clear claudeSessionId stays the launch id, so once the remote claude exited the lookup fell back to the cleared conversation and the panel flipped back. The sync now hands the lookup the stored conversation, tried right after the live one (remoteTranscriptIds). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c4ba14235f
commit
0a6a877415
10 files changed
+169
-36
No files matched your search
+15
-8
@@ -137,7 +137,7 @@ import { probePathKind } from '../utils/bounded-path-probe.js';
|
||||
import { defaultDockerWorkspaces } from './routes/git-status-routes.js';
|
||||
import { composerIsEmpty, plainFrame } from '../session-submit-verifier.js';
|
||||
import { detectUsageLimitPause } from '../usage-limit-patterns.js';
|
||||
import { EditHistorySync } from './edit-history-sync.js';
|
||||
import { EditHistorySync, remoteTranscriptIds } from './edit-history-sync.js';
|
||||
import { EditHistoryStore } from '../edit-history-store.js';
|
||||
import { probeLocalPaths, readClaudeEditSources, resolveClaudeTranscript } from '../edit-history-local-source.js';
|
||||
import { remoteLocateClaudeTranscript, remoteProbePaths, remoteReadClaudeEditSources } from '../remote-files.js';
|
||||
@@ -362,15 +362,22 @@ export class WebServer extends EventEmitter {
|
||||
* A local session's main transcript is the one the transcript watcher follows (hook-reported
|
||||
* path), or, before the first hook after a restart, a lookup under the session's claude
|
||||
* config dir. A remote session sends no hooks: its host is asked over ssh for the transcript
|
||||
* the pane's claude writes (remote-files.ts), and is never woken for it.
|
||||
* the pane's claude writes, else the stored conversation's (`remoteTranscriptIds`), and is
|
||||
* never woken for it (remote-files.ts).
|
||||
*/
|
||||
private readonly editHistorySync = new EditHistorySync({
|
||||
transcriptPath: (session) => {
|
||||
const ids = [session.claudeSessionId || session.id, session.id];
|
||||
return session.remote
|
||||
? remoteLocateClaudeTranscript(session.remote, ids, remoteTmuxLocation(session.remote, session.id))
|
||||
: resolveClaudeTranscript(this.transcriptWatchers.get(session.id)?.getPath(), ids, session.claudeConfigDir);
|
||||
},
|
||||
transcriptPath: (session, storedTranscriptId) =>
|
||||
session.remote
|
||||
? remoteLocateClaudeTranscript(
|
||||
session.remote,
|
||||
remoteTranscriptIds(session, storedTranscriptId),
|
||||
remoteTmuxLocation(session.remote, session.id)
|
||||
)
|
||||
: resolveClaudeTranscript(
|
||||
this.transcriptWatchers.get(session.id)?.getPath(),
|
||||
[session.claudeSessionId || session.id, session.id],
|
||||
session.claudeConfigDir
|
||||
),
|
||||
readSources: (session, mainPath, requests, budget, opts) =>
|
||||
session.remote
|
||||
? remoteReadClaudeEditSources(session.remote, mainPath, requests, budget, opts)
|
||||
|
||||
Reference in new issue
Block a user