From 0f380c4809348a24db4019b792568b85196909f6 Mon Sep 17 00:00:00 2001 From: Pedram Amini Date: Sun, 5 Apr 2026 03:27:09 -0500 Subject: [PATCH 1/3] ## CHANGES MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Standardized multi-phase auto-run docs into one flat, dated subdirectory ๐Ÿ“ - Explicitly banned nested project/feature folder structures for phase outputs ๐Ÿšซ - Improved guidance for clean lexicographic sorting with zero-padded phases ๐Ÿ”ข - Made it easier to add entire effort folders to auto-run at once โž• - Clarified organization rules so related phase documents stay tightly grouped ๐Ÿงญ --- src/prompts/maestro-system-prompt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prompts/maestro-system-prompt.md b/src/prompts/maestro-system-prompt.md index 94cd07a9f..90c2dd2cb 100644 --- a/src/prompts/maestro-system-prompt.md +++ b/src/prompts/maestro-system-prompt.md @@ -45,7 +45,7 @@ To recall recent work, read the file and scan the most recent entries by timesta When a user wants an auto-run document (or playbook), create a detailed multi-document, multi-point Markdown implementation plan in the `{{AUTORUN_FOLDER}}` folder. Use the format `$PREFIX-XX.md`, where `XX` is the two-digit phase number (01, 02, etc.) and `$PREFIX` is the effort name. Always zero-pad phase numbers to ensure correct lexicographic sorting. Break phases by relevant context; do not mix unrelated task results in the same document. If working within a file, group and fix all type issues in that file together. If working with an MCP, keep all related tasks in the same document. Each task must be written as `- [ ] ...` so auto-run can execute and check them off with comments on completion. -**Multi-phase efforts:** When creating 3 or more phase documents for a single effort, place them in a dedicated subdirectory prefixed with today's date (e.g., `{{AUTORUN_FOLDER}}/YYYY-MM-DD-Feature-Name/FEATURE-NAME-01.md`). This allows users to add the entire folder at once and keeps related documents organized with a clear creation date. +**Multi-phase efforts:** When creating 3 or more phase documents for a single effort, place them in a single flat subdirectory directly under `{{AUTORUN_FOLDER}}`, prefixed with today's date (e.g., `{{AUTORUN_FOLDER}}/YYYY-MM-DD-Feature-Name/FEATURE-NAME-01.md`). Do NOT create nested subdirectories โ€” all phase documents for a given effort go into one folder, never `project/feature/` nesting. This allows users to add the entire folder at once and keeps related documents organized with a clear creation date. **Context efficiency:** Each checkbox task runs in a fresh agent context. Group logically related work under a single checkbox when: (1) tasks modify the same file(s), (2) tasks follow the same pattern/approach, or (3) understanding one task is prerequisite to the next. Keep tasks separate when they're independent or when a single task would exceed reasonable scope (~500 lines of change). A good task is self-contained and can be verified in isolation. From 5d9c74ae4d3381d5954fb49157843e636dc84d1e Mon Sep 17 00:00:00 2001 From: Pedram Amini Date: Sun, 5 Apr 2026 18:09:47 -0500 Subject: [PATCH 2/3] fix: thread projectPath for cross-project history resume and fix Codex session lookup (#251) Two fixes for "Open session as new tab" in History: 1. Thread projectPath from history entries through to handleResumeSession so sessions from different projects resolve correctly instead of always using activeSession.projectRoot. 2. Update Codex findSessionFile/findSessionFileRemote to also check metadata.payload.id, matching the newer Codex session format where the session ID lives in payload.id rather than the top-level id field. --- .../History/HistoryEntryItem.test.tsx | 2 +- .../renderer/components/HistoryPanel.test.tsx | 2 +- src/main/storage/codex-session-storage.ts | 4 ++-- .../DirectorNotes/UnifiedHistoryTab.tsx | 2 +- .../components/History/HistoryEntryItem.tsx | 4 ++-- src/renderer/components/HistoryPanel.tsx | 2 +- src/renderer/components/RightPanel.tsx | 2 +- .../hooks/agent/useAgentSessionManagement.ts | 23 +++++++++++-------- .../hooks/props/useRightPanelProps.ts | 19 +++++++++++++-- 9 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/__tests__/renderer/components/History/HistoryEntryItem.test.tsx b/src/__tests__/renderer/components/History/HistoryEntryItem.test.tsx index e10c9715f..892314b02 100644 --- a/src/__tests__/renderer/components/History/HistoryEntryItem.test.tsx +++ b/src/__tests__/renderer/components/History/HistoryEntryItem.test.tsx @@ -304,7 +304,7 @@ describe('HistoryEntryItem', () => { const sessionButton = screen.getByTitle('session-abc-123'); fireEvent.click(sessionButton); - expect(onOpenSessionAsTab).toHaveBeenCalledWith('session-abc-123'); + expect(onOpenSessionAsTab).toHaveBeenCalledWith('session-abc-123', '/test/project'); }); it('shows elapsed time when present', () => { diff --git a/src/__tests__/renderer/components/HistoryPanel.test.tsx b/src/__tests__/renderer/components/HistoryPanel.test.tsx index e7d72bb0c..7af6ecacd 100644 --- a/src/__tests__/renderer/components/HistoryPanel.test.tsx +++ b/src/__tests__/renderer/components/HistoryPanel.test.tsx @@ -1135,7 +1135,7 @@ describe('HistoryPanel', () => { fireEvent.click(screen.getByText('ABC12345')); - expect(onOpenSessionAsTab).toHaveBeenCalledWith('abc12345-def-789'); + expect(onOpenSessionAsTab).toHaveBeenCalledWith('abc12345-def-789', '/test/project'); }); it('should render summary with truncation', async () => { diff --git a/src/main/storage/codex-session-storage.ts b/src/main/storage/codex-session-storage.ts index d0ce7a9c6..2dcbd87ac 100644 --- a/src/main/storage/codex-session-storage.ts +++ b/src/main/storage/codex-session-storage.ts @@ -1208,7 +1208,7 @@ export class CodexSessionStorage extends BaseSessionStorage { const firstLine = content.split('\n')[0]; if (firstLine) { const metadata = JSON.parse(firstLine) as CodexSessionMetadata; - if (metadata.id === sessionId) { + if (metadata.id === sessionId || metadata.payload?.id === sessionId) { return filePath; } } @@ -1242,7 +1242,7 @@ export class CodexSessionStorage extends BaseSessionStorage { const firstLine = result.data.split('\n')[0]; if (firstLine) { const metadata = JSON.parse(firstLine) as CodexSessionMetadata; - if (metadata.id === sessionId) { + if (metadata.id === sessionId || metadata.payload?.id === sessionId) { return filePath; } } diff --git a/src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx b/src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx index eaeda0ba3..a301b35f1 100644 --- a/src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx +++ b/src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx @@ -289,7 +289,7 @@ export const UnifiedHistoryTab = forwardRef { + (agentSessionId: string, _projectPath?: string) => { if (!onResumeSession) return; const entry = entries.find((e) => e.agentSessionId === agentSessionId) as | UnifiedHistoryEntry diff --git a/src/renderer/components/History/HistoryEntryItem.tsx b/src/renderer/components/History/HistoryEntryItem.tsx index 2de4932d2..14058f06d 100644 --- a/src/renderer/components/History/HistoryEntryItem.tsx +++ b/src/renderer/components/History/HistoryEntryItem.tsx @@ -64,7 +64,7 @@ export interface HistoryEntryItemProps { isSelected: boolean; theme: Theme; onOpenDetailModal: (entry: HistoryEntry, index: number) => void; - onOpenSessionAsTab?: (agentSessionId: string) => void; + onOpenSessionAsTab?: (agentSessionId: string, projectPath?: string) => void; onOpenAboutModal?: () => void; /** When true, displays the agentName field prominently in the entry header (used in unified history view) */ showAgentName?: boolean; @@ -117,7 +117,7 @@ export const HistoryEntryItem = memo(function HistoryEntryItem({