2.4 KiB
2.4 KiB
03. Replace sendMessage with ctx.ui progress API
meta: id: ralph-loop-fixes-03 feature: ralph-loop-fixes priority: P1 depends_on: [ralph-loop-fixes-04] tags: [implementation, executor]
objective:
- Replace all
piApi.sendMessage({ customType: "ralph-progress", display: true })calls withctx.ui.notify()andctx.ui.setStatus()to avoid TUI crash from unregistered custom message renderer
deliverables:
- Modified
src/executor.ts— removesendProgressMessage(), replace withctx.uicalls - Modified
src/executor.ts— removeformatToolUsage()if no longer needed, or keep for status text
steps:
- Open
src/executor.ts - Remove
sendProgressMessage()function entirely - In
runTask(), replacesendProgressMessage(piApi, task, project, "starting")withctx.ui.setStatus("ralph", "Running ${task.id}: ${task.title}") - In
runTask()success path, replacesendProgressMessage(..., "completed")withctx.ui.notify()for completion summary - In
runTask()failure path, replacesendProgressMessage(..., "failed")withctx.ui.notify()for error - In
executeBatch(), replace batch startpiApi.sendMessage()withctx.ui.setStatus() - In
executeTask(), replace retrypiApi.sendMessage()withctx.ui.notify() - Remove
piApi: ExtensionAPIparameter from all executor functions (replaced byctx: ExtensionCommandContext) - Remove unused
ExtensionAPIimport from executor.ts
tests:
- Manual: Run a task and verify progress appears in the Pi UI without crash
- Manual: Verify no
child.render is not a functionerror
acceptance_criteria:
- No TUI crash during task execution
- Progress messages visible to user via
ctx.ui sendProgressMessage()function removed from codebasepiApi.sendMessage()no longer called anywhere in executor
validation:
- Grep for
sendMessagein executor.ts — should only appear in comments or not at all - Grep for
customType.*ralph-progress— should be removed - Verify
ctx.ui.notifyandctx.ui.setStatusare used instead
notes:
ctx.ui.notify(message, type)shows a notification — use "info" for progress, "error" for failuresctx.ui.setStatus(key, text)sets footer status text — good for "Running task X" updatesctx.ui.setStatus(key, undefined)clears the status- The TUI crash (
child.render is not a function) happens becausecustomType: "ralph-progress"has no registered renderer viapi.registerMessageRenderer()