mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 22:53:08 +00:00
Fix: Restore views properly, model selection for commit and pr and speed up some cli models with session resume (#801)
* Changes from fix/restoring-view * feat: Add resume query safety checks and optimize store selectors * feat: Improve session management and model normalization * refactor: Extract prompt building logic and handle file path parsing for renames
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { useState, useCallback, useRef, useEffect } from 'react';
|
||||
import { useAppStore } from '@/store/app-store';
|
||||
import type { PhaseModelEntry } from '@automaker/types';
|
||||
import { useElectronAgent } from '@/hooks/use-electron-agent';
|
||||
import { SessionManager } from '@/components/session-manager';
|
||||
|
||||
@@ -46,8 +45,6 @@ export function AgentView() {
|
||||
return () => window.removeEventListener('resize', updateVisibility);
|
||||
}, []);
|
||||
|
||||
const [modelSelection, setModelSelection] = useState<PhaseModelEntry>({ model: 'claude-sonnet' });
|
||||
|
||||
// Input ref for auto-focus
|
||||
const inputRef = useRef<HTMLTextAreaElement>(null);
|
||||
|
||||
@@ -57,10 +54,12 @@ export function AgentView() {
|
||||
const createSessionInFlightRef = useRef(false);
|
||||
|
||||
// Session management hook - scoped to current worktree
|
||||
const { currentSessionId, handleSelectSession } = useAgentSession({
|
||||
projectPath: currentProject?.path,
|
||||
workingDirectory: effectiveWorkingDirectory,
|
||||
});
|
||||
// Also handles model selection persistence per session
|
||||
const { currentSessionId, handleSelectSession, modelSelection, setModelSelection } =
|
||||
useAgentSession({
|
||||
projectPath: currentProject?.path,
|
||||
workingDirectory: effectiveWorkingDirectory,
|
||||
});
|
||||
|
||||
// Use the Electron agent hook (only if we have a session)
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user