mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 10:43:08 +00:00
refactor: Enhance session management and error handling in AgentService and related components
- Improved session handling by implementing ensureSession to load sessions from disk if not in memory, reducing "session not found" errors. - Enhanced error messages for non-existent sessions, providing clearer diagnostics. - Updated CodexProvider and OpencodeProvider to improve error handling and messaging. - Refactored various routes to use async/await for better readability and error handling. - Added event emission for merge and stash operations in the MergeService and StashService. - Cleaned up error messages in AgentExecutor to remove redundant prefixes and ANSI codes for better clarity.
This commit is contained in:
@@ -80,7 +80,7 @@ export function createWorktreeRoutes(
|
||||
'/merge',
|
||||
validatePathParams('projectPath'),
|
||||
requireValidProject,
|
||||
createMergeHandler()
|
||||
createMergeHandler(events)
|
||||
);
|
||||
router.post(
|
||||
'/create',
|
||||
@@ -126,7 +126,12 @@ export function createWorktreeRoutes(
|
||||
requireValidWorktree,
|
||||
createListBranchesHandler()
|
||||
);
|
||||
router.post('/switch-branch', requireValidWorktree, createSwitchBranchHandler(events));
|
||||
router.post(
|
||||
'/switch-branch',
|
||||
validatePathParams('worktreePath'),
|
||||
requireValidWorktree,
|
||||
createSwitchBranchHandler(events)
|
||||
);
|
||||
router.post('/open-in-editor', validatePathParams('worktreePath'), createOpenInEditorHandler());
|
||||
router.post(
|
||||
'/open-in-terminal',
|
||||
@@ -230,7 +235,7 @@ export function createWorktreeRoutes(
|
||||
'/stash-apply',
|
||||
validatePathParams('worktreePath'),
|
||||
requireGitRepoOnly,
|
||||
createStashApplyHandler()
|
||||
createStashApplyHandler(events)
|
||||
);
|
||||
router.post(
|
||||
'/stash-drop',
|
||||
|
||||
Reference in New Issue
Block a user