diff --git a/backend/src/services/git-operations.ts b/backend/src/services/git-operations.ts index 6a7b6b0a..18e29b20 100644 --- a/backend/src/services/git-operations.ts +++ b/backend/src/services/git-operations.ts @@ -4,7 +4,7 @@ import path from 'path' async function hasCommits(repoPath: string): Promise { try { - await executeCommand(['git', '-C', repoPath, 'rev-parse', 'HEAD']) + await executeCommand(['git', '-C', repoPath, 'rev-parse', 'HEAD'], { silent: true }) return true } catch { return false diff --git a/backend/src/services/repo.ts b/backend/src/services/repo.ts index ffbf7f12..af1601e1 100644 --- a/backend/src/services/repo.ts +++ b/backend/src/services/repo.ts @@ -10,7 +10,7 @@ import path from 'path' async function hasCommits(repoPath: string): Promise { try { - await executeCommand(['git', '-C', repoPath, 'rev-parse', 'HEAD']) + await executeCommand(['git', '-C', repoPath, 'rev-parse', 'HEAD'], { silent: true }) return true } catch { return false @@ -22,13 +22,13 @@ async function safeGetCurrentBranch(repoPath: string): Promise { const repoHasCommits = await hasCommits(repoPath) if (!repoHasCommits) { try { - const symbolicRef = await executeCommand(['git', '-C', repoPath, 'symbolic-ref', '--short', 'HEAD']) + const symbolicRef = await executeCommand(['git', '-C', repoPath, 'symbolic-ref', '--short', 'HEAD'], { silent: true }) return symbolicRef.trim() } catch { return null } } - const currentBranch = await executeCommand(['git', '-C', repoPath, 'rev-parse', '--abbrev-ref', 'HEAD']) + const currentBranch = await executeCommand(['git', '-C', repoPath, 'rev-parse', '--abbrev-ref', 'HEAD'], { silent: true }) return currentBranch.trim() } catch { return null diff --git a/backend/src/utils/process.ts b/backend/src/utils/process.ts index 16717549..2c6cc1c0 100644 --- a/backend/src/utils/process.ts +++ b/backend/src/utils/process.ts @@ -1,15 +1,24 @@ import { spawn, type ChildProcess } from 'child_process' import { logger } from './logger' +interface ExecuteCommandOptions { + cwd?: string + silent?: boolean +} + export async function executeCommand( args: string[], - cwd?: string + cwdOrOptions?: string | ExecuteCommandOptions ): Promise { + const options: ExecuteCommandOptions = typeof cwdOrOptions === 'string' + ? { cwd: cwdOrOptions } + : cwdOrOptions || {} + return new Promise((resolve, reject) => { const [command, ...cmdArgs] = args const proc: ChildProcess = spawn(command || '', cmdArgs, { - cwd, + cwd: options.cwd, shell: false }) @@ -25,7 +34,9 @@ export async function executeCommand( }) proc.on('error', (error: Error) => { - logger.error(`Command failed: ${args.join(' ')}`, error) + if (!options.silent) { + logger.error(`Command failed: ${args.join(' ')}`, error) + } reject(error) }) @@ -34,7 +45,9 @@ export async function executeCommand( resolve(stdout) } else { const error = new Error(`Command failed with code ${code}: ${stderr || stdout}`) - logger.error(`Command failed: ${args.join(' ')}`, error) + if (!options.silent) { + logger.error(`Command failed: ${args.join(' ')}`, error) + } reject(error) } }) diff --git a/frontend/src/components/message/MessageThread.tsx b/frontend/src/components/message/MessageThread.tsx index 32e42a7d..116fc52f 100644 --- a/frontend/src/components/message/MessageThread.tsx +++ b/frontend/src/components/message/MessageThread.tsx @@ -47,6 +47,11 @@ export const MessageThread = memo(function MessageThread({ opcodeUrl, sessionID, hasInitialScrolledRef.current = false userScrolledUpRef.current = false lastMessageCountRef.current = 0 + lastScrollTimeRef.current = 0 + if (scrollRAFRef.current) { + cancelAnimationFrame(scrollRAFRef.current) + scrollRAFRef.current = null + } }, [sessionID]) const scrollToBottom = useCallback((force = false) => { diff --git a/frontend/src/pages/SessionDetail.tsx b/frontend/src/pages/SessionDetail.tsx index 8b5e91f7..99727682 100644 --- a/frontend/src/pages/SessionDetail.tsx +++ b/frontend/src/pages/SessionDetail.tsx @@ -170,7 +170,7 @@ const { currentPermission, pendingCount, dismissPermission } = usePermissionRequ />
-
+
{opcodeUrl && repoDirectory && (