Merge session checkpoint (P) into agent handoff (H) as a buffer-aware command - #498
Merge session checkpoint (P) into agent handoff (H) as a buffer-aware command#498tninja wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a72ba42bfc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (ai-code--infix-toggle-auto-follow-up) | ||
| ("k" "Create/Open task file" ai-code-create-or-open-task-file) | ||
| ("H" "Agent handoff (C-u: whole task)" ai-code-agent-handoff) | ||
| ("H" "Handoff / checkpoint" ai-code-agent-handoff-or-checkpoint) |
There was a problem hiding this comment.
Restore the prefix hint in the handoff menu description
When test/test_ai-code.el runs, ai-code-test-menu-other-tools-includes-agent-handoff-entry requires this suffix description to equal "Handoff / checkpoint (C-u: whole task)", but the changed transient definition supplies only "Handoff / checkpoint". That equality always fails, preventing both the targeted test and the full ERT suite from passing; restore the expected description while retaining the useful prefix-argument hint.
Useful? React with 👍 / 👎.
C-c a P(session checkpoint) andC-c a H(agent handoff) were two keys doing closely related things, andHonly loaded a handoff subtree when the cursor sat exactly on its headline. This merges them into one buffer-aware entry and makes handoff loading work from anywhere inside a handoff section.Dispatcher. New
ai-code-agent-handoff-or-checkpointinai-code.el: an Org buffer runsai-code-agent-handoff(forwarding the prefix arg), an AI session buffer runsai-code-session-checkpoint, and anything else asks which of the two to run viacompleting-readso neither existing path is lost. MenuHnow points at the dispatcher; thePentry is removed and its key left free. Both original commands remain callable viaM-x.Handoff section detection.
ai-code-task.elwalks the current heading and its ancestors looking for a handoff headline (* Agent Handoff YYYY-MM-DD HH:MM, matched case-insensitively), so point anywhere inside the section — including under a sub-heading — loads that subtree. Point on any heading still loads it, and body text in a non-handoff section still dumps a new handoff.Verification. 6 new ERT tests (2 for section detection, 4 for the dispatcher), written failing first:
test_ai-code-task.el25/25,test_ai-code.el50/50. Full suite sits at the same 13 pre-existing failures asmain— no new ones. Clean byte-compile and checkdoc on both touched files. README and HISTORY updated.