diff --git a/Auto Run Docs/PR-Triage/PR-Triage-07.md b/Auto Run Docs/PR-Triage/PR-Triage-07.md index 79d01a01..c5857b1f 100644 --- a/Auto Run Docs/PR-Triage/PR-Triage-07.md +++ b/Auto Run Docs/PR-Triage/PR-Triage-07.md @@ -12,7 +12,8 @@ These PRs all touch `src/cli/handlers/session-init.ts` — review together to av - [x] Review PR #829 (`fix: gracefully handle empty prompts in session-init hook` by @rajivsinclair). File: `src/cli/handlers/session-init.ts`. Steps: (1) `gh pr checkout 829` (2) Review — empty prompt should result in valid exit (not crash) (3) Small change, low risk (4) Run `npm run build` (5) If clean: `gh pr merge 829 --rebase --delete-branch` - **CLOSED AS REDUNDANT** (2026-02-05): The empty prompt handling fix (`!prompt || !prompt.trim()` → `return { continue: true, suppressOutput: true }`) was already merged as part of PR #828 (commit 9789a196). Main branch already has this fix at `src/cli/handlers/session-init.ts` lines 24-27. No action needed. -- [ ] Review PR #928 (`Fix: Allow image-only prompts in session-init handler` by @iammike). File: `src/cli/handlers/session-init.ts`. Image-only prompts have no text content, causing the handler to reject them. Steps: (1) `gh pr checkout 928` (2) Review — should check for content blocks (images) not just text (3) Run `npm run build` (4) If clean: `gh pr merge 928 --rebase --delete-branch` +- [x] Review PR #928 (`Fix: Allow image-only prompts in session-init handler` by @iammike). File: `src/cli/handlers/session-init.ts`. Image-only prompts have no text content, causing the handler to reject them. Steps: (1) `gh pr checkout 928` (2) Review — should check for content blocks (images) not just text (3) Run `npm run build` (4) If clean: `gh pr merge 928 --rebase --delete-branch` + - **CLOSED — FIX APPLIED ON MAIN** (2026-02-05): PR was based on outdated code (pre-#828 refactor) and would have merge conflicts. The concept was valid: image-only prompts had empty text causing session init to be skipped entirely, losing memory tracking. Applied the fix directly on main at `src/cli/handlers/session-init.ts` lines 22-26: empty/undefined prompts now use `[media prompt]` placeholder instead of returning early, so sessions are still created and tracked. Build passes. Credit to @iammike for identifying the issue (#927). - [ ] Review PR #932 (`fix: prevent duplicate generator spawns in handleSessionInit` by @jayvenn21). File: `src/services/worker/http/routes/SessionRoutes.ts`. Steps: (1) `gh pr checkout 932` (2) Review idempotency guard — should check if generator already exists before spawning (3) Run `npm run build` (4) If clean: `gh pr merge 932 --rebase --delete-branch` diff --git a/src/cli/handlers/session-init.ts b/src/cli/handlers/session-init.ts index 41c375f5..938eb947 100644 --- a/src/cli/handlers/session-init.ts +++ b/src/cli/handlers/session-init.ts @@ -19,12 +19,11 @@ export const sessionInitHandler: EventHandler = { return { continue: true, suppressOutput: true, exitCode: HOOK_EXIT_CODES.SUCCESS }; } - const { sessionId, cwd, prompt } = input; + const { sessionId, cwd, prompt: rawPrompt } = input; - // Gracefully handle empty prompts (user submitted blank input) - if (!prompt || !prompt.trim()) { - return { continue: true, suppressOutput: true }; - } + // Handle image-only prompts (where text prompt is empty/undefined) + // Use placeholder so sessions still get created and tracked for memory + const prompt = (!rawPrompt || !rawPrompt.trim()) ? '[media prompt]' : rawPrompt; const project = getProjectName(cwd); const port = getWorkerPort();