Merge remote-tracking branch 'origin/main' into feat/extend-models-support

This commit is contained in:
Kacper
2025-12-10 15:42:49 +01:00
11 changed files with 263 additions and 382 deletions

View File

@@ -137,8 +137,7 @@ export function useElectronAgent({
let mounted = true;
const initialize = async () => {
// Reset state when switching sessions
setIsProcessing(false);
// Reset error state when switching sessions
setError(null);
try {
@@ -154,13 +153,23 @@ export function useElectronAgent({
console.log("[useElectronAgent] Loaded", result.messages.length, "messages");
setMessages(result.messages);
setIsConnected(true);
// Check if the agent is currently running for this session
const historyResult = await window.electronAPI.agent.getHistory(sessionId);
if (mounted && historyResult.success) {
const isRunning = historyResult.isRunning || false;
console.log("[useElectronAgent] Session running state:", isRunning);
setIsProcessing(isRunning);
}
} else {
setError(result.error || "Failed to start session");
setIsProcessing(false);
}
} catch (err) {
if (!mounted) return;
console.error("[useElectronAgent] Failed to initialize:", err);
setError(err instanceof Error ? err.message : "Failed to initialize");
setIsProcessing(false);
}
};

View File

@@ -123,7 +123,7 @@ export const ACTION_SHORTCUTS: Record<string, string> = {
addFeature: "N", // N for New feature
addContextFile: "F", // F for File (add context file)
startNext: "G", // G for Grab (start next features from backlog)
newSession: "W", // W for new session (in agent view)
newSession: "N", // N for New session (in agent view)
openProject: "O", // O for Open project (navigate to welcome view)
projectPicker: "P", // P for Project picker
cyclePrevProject: "Q", // Q for previous project (cycle back through MRU)