fix: project-scope terminal, file browser, agent execution, and heartbeat monitor
- TerminalService: use per-project instance map instead of destructive singleton - File browser: thread projectId through API functions, hooks, and components - Workspace file editor: pass projectId to read/write operations - Agent heartbeat: guard execution with project scope validation - Agent runs/stop: validate heartbeatMonitor matches scoped project - CLI dashboard/serve: pass rootDir to heartbeatMonitor via server options - Add getRootDir() to HeartbeatMonitor for scope comparison Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@@ -16,10 +16,12 @@ interface UseWorkspaceFileBrowserReturn {
|
||||
*
|
||||
* @param workspace - The workspace identifier ("project" or task ID)
|
||||
* @param enabled - Whether fetching is enabled
|
||||
* @param projectId - Optional project ID for multi-project scoping
|
||||
*/
|
||||
export function useWorkspaceFileBrowser(
|
||||
workspace: string,
|
||||
enabled: boolean,
|
||||
projectId?: string,
|
||||
): UseWorkspaceFileBrowserReturn {
|
||||
const [entries, setEntries] = useState<FileNode[]>([]);
|
||||
const [currentPath, setCurrentPath] = useState<string>(".");
|
||||
@@ -57,6 +59,7 @@ export function useWorkspaceFileBrowser(
|
||||
const response: FileListResponse = await fetchWorkspaceFileList(
|
||||
workspace,
|
||||
currentPath === "." ? undefined : currentPath,
|
||||
projectId,
|
||||
);
|
||||
|
||||
if (!cancelled) {
|
||||
@@ -79,7 +82,7 @@ export function useWorkspaceFileBrowser(
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [workspace, currentPath, enabled, refreshKey]);
|
||||
}, [workspace, currentPath, enabled, refreshKey, projectId]);
|
||||
|
||||
return {
|
||||
entries,
|
||||
|
||||
Reference in New Issue
Block a user