Skip to content

Merge session checkpoint (P) into agent handoff (H) as a buffer-aware command - #498

Open
tninja wants to merge 1 commit into
mainfrom
kang_feat_13
Open

Merge session checkpoint (P) into agent handoff (H) as a buffer-aware command#498
tninja wants to merge 1 commit into
mainfrom
kang_feat_13

Conversation

@tninja

@tninja tninja commented Sep 1, 2026

Copy link
Copy Markdown
Owner

C-c a P (session checkpoint) and C-c a H (agent handoff) were two keys doing closely related things, and H only 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-checkpoint in ai-code.el: an Org buffer runs ai-code-agent-handoff (forwarding the prefix arg), an AI session buffer runs ai-code-session-checkpoint, and anything else asks which of the two to run via completing-read so neither existing path is lost. Menu H now points at the dispatcher; the P entry is removed and its key left free. Both original commands remain callable via M-x.

Handoff section detection. ai-code-task.el walks 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.el 25/25, test_ai-code.el 50/50. Full suite sits at the same 13 pre-existing failures as main — no new ones. Clean byte-compile and checkdoc on both touched files. README and HISTORY updated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ai-code.el
(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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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