Skip to content

feat(sessions): Del-to-delete for in-REPL /resume and /replay pickers - #26

Merged
MotionDevLab merged 1 commit into
mainfrom
feat/resume-replay-delete
Oct 13, 2026
Merged

MotionDevLab merged 1 commit into
mainfrom
feat/resume-replay-delete

Conversation

@MotionDevLab

Copy link
Copy Markdown
Owner

Summary

  • What changed: Del-to-delete session flow (previously --resume-CLI-only from feat(sessions): inline delete in resume picker with confirm dialog #25) is now wired into the two in-REPL pickers that mount the same LogSelector without delete wiring: /resume (src/commands/resume/resume.tsx) and /replay (src/commands/replay/replay.tsx). New shared hook src/hooks/useSessionDelete.ts (+ useSessionDelete.test.tsx, 6 tests) serves only the two new consumers; ResumeConversation.tsx is deliberately untouched (byte-identical, zero regression surface on the proven path). Both pickers render DeleteSessionConfirm + error/notice banners in ResumeConversation's relative positions and pass onDeleteRequest + isInputDisabled to LogSelector. Stale-selection guards included (selectedSession/sessionSummary in /resume, selected/replayIndex in /replay).
  • Why it changed: Del was a silent no-op in both pickers (onDeleteRequest?.() with no prop) while the footer unconditionally advertised Del to delete — misleading UI. Follow-up to fix(resume): clean terminal exit from session picker #24 (Esc/alt-screen fix) + feat(sessions): inline delete in resume picker with confirm dialog #25 (CLI delete).

Impact

  • user-facing impact: Del now works identically in all three session pickers (confirm → file deleted + entry dropped + notice; Esc/n aborts; active session and live-background sessions blocked with explanatory messages). No Esc/exit, listing, resume/select, rename, search, preview, or cross-project behavior changed.
  • developer/maintainer impact: New useSessionDelete hook reuses getDeleteBlockReason, deleteSession, DeleteSessionConfirm, and tengu_session_delete analytics verbatim — one shared implementation for the two new hosts. No LogSelector contract changes.

Testing

  • I ran the required local preflight.
  • exact commands and results:
    • bun install --frozen-lockfile — clean (not shallow; 1 package).
    • bun run lint:any-budget — ok (779 = baseline 779).
    • bun run smoke — green (0.31.0 (OpenClaude), externals valid, SDK declarations in sync).
    • bun run deadcode (knip) — exit 0, configuration hints only.
    • bunx eslint on all 4 touched files, run twice — clean both passes.
    • bun run typecheck, run twice — only the 12 known pre-existing ink-reconciler errors (ink.tsx/reconciler.ts/render-to-screen.ts, identical on pristine main); zero in touched files.
    • bun run typecheck:type-tests — passed (10 files checked).
    • node bin/openclaude --version — 0.31.0 (OpenClaude); compile-cache-disabled launcher check — LAUNCHER_OK.
    • bun test src/hooks/useSessionDelete.test.tsx — 6 pass, 0 fail.
    • bun test src/screens/resumeDeleteGuards.test.ts src/components/DeleteSessionConfirm.render.test.tsx — green (pre-existing suites).
    • bun run test:provider — 1748 pass / 3 fail; rerun showed 2 fail (count varies run to run). All observed failures are timing-sensitive provider internals (Claude stream watchdog … never settles, native Anthropic client validates and clamps API_TIMEOUT_MS) — none touch sessions/resume/replay/hooks.
    • npm run test:provider-recommendation — 165 pass, 0 fail.
    • git fetch https://github.com/Gitlawb/openclaude.git main + bun run security:pr-scan -- --base FETCH_HEAD --head HEAD — 1 medium in untouched scripts/prepare.mjs (same pre-existing finding as fix(resume): clean terminal exit from session picker #24/feat(sessions): inline delete in resume picker with confirm dialog #25).
    • Live visual tests in Windows Terminal (fresh node dist/cli.mjs session): Del → confirm → Deleted … notice + entry dropped in both /resume and /replay; dialog-cancel/Esc aborts cleanly; active-session block verified; Esc-at-picker unchanged; resume/select + replay-load regressions pass; --resume CLI delete flow unchanged. Disk-level verification: deleted session .jsonl files confirmed gone from ~/.openclaude/projects/, no orphaned sidecars.
  • focused tests: src/hooks/useSessionDelete.test.tsx (open-pending, confirm-deletes+notice, cancel-no-op, active-blocked, bg-running-blocked, already-deleted notice).
  • documented skipped checks, platform limitations, or verified pre-existing failures: full bun test (test:full) is known to hang/stall on this Windows box for spawn-heavy suites (same as fix(resume): clean terminal exit from session picker #24/feat(sessions): inline delete in resume picker with confirm dialog #25: launcher heap/compile-cache + bughunter timeouts reproduced 21/9 on a pristine origin/main worktree); not re-chased here — CI is authoritative. The 3 (rerun: 2) test:provider timing flakes and the 12 tsc ink-reconciler errors are likewise pre-existing/environmental and outside this PR's surface. mindmodel_lookup unavailable in the agent toolset during this work (no .mindmodel/ in repo).

Notes

  • provider/model path tested: N/A — no provider, model, or API behavior touched.
  • screenshots attached (if UI changed): N/A — terminal UI; verified live in Windows Terminal per above (dialog, banners, footer hint now truthful in all three pickers).
  • follow-up work or known limitations: migrating ResumeConversation onto the shared hook is an optional, explicitly out-of-scope follow-up (de-risking decision: keeps the proven path byte-identical). /replay remains repo-scoped with no all-projects toggle (pre-existing, unchanged). Laya advisory gate: approve 0.81, complete 0.83.

Shared useSessionDelete hook serves only the two new consumers, reusing guards, delete API, confirm dialog, and analytics. ResumeConversation left untouched. Plan: docs/openclaude/plans/2026-10-13-resume-replay-delete-wiring.md
@MotionDevLab
MotionDevLab merged commit c340572 into main Oct 13, 2026
5 checks passed
@MotionDevLab
MotionDevLab deleted the feat/resume-replay-delete branch October 13, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant