mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-15 02:49:33 +01:00
fix: keep a remote session's fix plan authoritative (release review, #722)
#722 stopped handing a remote session's workingDir to the Ralph tracker, which also left isFileAuthoritative false for remote sessions only. That flag is what keeps the output-based completion guessers off, and it is true for every local session with a working directory, so a remote loop could end, and mark every todo done, on a prose line such as "All tasks completed" while a local one cannot. setRemoteWorkingDir() records the path without reading or watching the local disk, so the fix plan stays authoritative as for a local session; the file still reaches the tracker only through fix-plan/read, over ssh. The test pins both, and fails on the previous head. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
593b2eb2ea
commit
1ad9db7606
5 files changed
+73
-15
No files matched your search
@@ -248,6 +248,20 @@ export class RalphFixPlanWatcher extends EventEmitter {
|
||||
this.startWatchingFixPlan();
|
||||
}
|
||||
|
||||
/**
|
||||
* Record a REMOTE session's working directory (a path on the remote host) without reading or
|
||||
* watching it: the local disk holds nothing of it. The fix plan stays authoritative exactly as for a
|
||||
* local session, so the output-based completion guessers stay off (they are off for every session
|
||||
* with a working directory); the file reaches the tracker only through an explicit import
|
||||
* (`POST .../fix-plan/read`, which reads it over ssh).
|
||||
* @param workingDir - The session's working directory on the remote host
|
||||
*/
|
||||
setRemoteWorkingDir(workingDir: string): void {
|
||||
this.stopWatchingFixPlan();
|
||||
this._workingDir = workingDir;
|
||||
this._fixPlanPath = join(workingDir, '@fix_plan.md');
|
||||
}
|
||||
|
||||
/**
|
||||
* Load @fix_plan.md from disk if it exists.
|
||||
* Called on initialization and when file changes are detected.
|
||||
|
||||
@@ -717,6 +717,15 @@ export class RalphTracker extends EventEmitter {
|
||||
this.fixPlanWatcher.setWorkingDir(workingDir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Record a remote session's working directory without touching the local disk (see
|
||||
* `RalphFixPlanWatcher.setRemoteWorkingDir`): the fix plan stays authoritative, as for a local session.
|
||||
* @param workingDir - The session's working directory on the remote host
|
||||
*/
|
||||
setRemoteWorkingDir(workingDir: string): void {
|
||||
this.fixPlanWatcher.setRemoteWorkingDir(workingDir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load @fix_plan.md from disk if it exists.
|
||||
*/
|
||||
|
||||
+9
-3
@@ -2068,9 +2068,15 @@ export class WebServer extends EventEmitter {
|
||||
|
||||
// Set working directory for Ralph tracker to auto-load @fix_plan.md (not supported for external CLIs).
|
||||
// A remote session's workingDir is a path on the remote host, and the watcher reads and
|
||||
// fs.watch()es it on the LOCAL disk, so it is skipped there too.
|
||||
if (!isExternalCliMode(session.mode) && !session.remote) {
|
||||
session.ralphTracker.setWorkingDir(session.workingDir);
|
||||
// fs.watch()es it on the LOCAL disk, so a remote session only records the path: the fix plan stays
|
||||
// authoritative as for a local session (keeping the output-based completion guessers off), and its
|
||||
// file is read over ssh only on an explicit import (fix-plan/read).
|
||||
if (!isExternalCliMode(session.mode)) {
|
||||
if (session.remote) {
|
||||
session.ralphTracker.setRemoteWorkingDir(session.workingDir);
|
||||
} else {
|
||||
session.ralphTracker.setWorkingDir(session.workingDir);
|
||||
}
|
||||
}
|
||||
|
||||
// Start watching for new images in this session's working directory (if enabled globally and per-session).
|
||||
|
||||
Reference in new issue
Block a user