Skip to content

session-flow handoff: resume prompt drops /loop wrapper on save-point (goal-aware re-arm has no loop counterpart) #1413

Closed

Description

@kyle-sexton

Filed from direct observation this session, running the /work-items:work-loop self-paced dynamic
loop against this same repo. Not a work-item-tracker lane action — a plain bug report on the
session-flow plugin's handoff skill.

What happened

Asked the assistant, mid /loop (self-paced, no interval — the dynamic mode where the harness
re-invokes via a scheduled wakeup, not a fixed cadence), for the copy/paste resume prompt it would
emit after a hypothetical /clear. The first draft it produced was:

Read @.work/handoffs/<TS>-handoff-work-loop-oldest-first.md and execute /work-items:work-loop.

That is exactly the full-path shape documented in
plugins/session-flow/reference/save-point.md (lines 90-100) — and it is wrong for this case. It
drops the /loop wrapper entirely. Pasted as-is after /clear, the fresh session would run
/work-items:work-loop exactly once and stop; the self-paced recurring behavior would not resume,
because nothing re-invoked /loop to re-establish dynamic-loop mode. /clear does not preserve
loop state any more than it preserves an active /goal.

Root cause

save-point.md has a goal-aware re-arm rule (lines 85-88):

Goal-aware re-arm: if a /goal is active this session (infer from conversation), the FIRST
line between the rails starts with literal /goal — /clear destroys an active goal, so the
pasted block must re-arm it.

There is no equivalent loop-aware re-arm rule. /loop destructibility on /clear is the same
class of problem as /goal destructibility — both are session-scoped modes that a resume prompt
must explicitly re-invoke, not just a resumption task description. The engine doc only handles one
of the two known cases.

The skill file plugins/session-flow/skills/handoff/SKILL.md inherits the same gap: its two
enforcement checklists (full path, line 131; prompt-only path, line 139) both say `/goal` first line if a goal is active and say nothing about loop mode.

Why "detects /goal but not that well" also applies

The existing goal-aware rule already has a soft edge worth tightening in the same pass: "infer
from conversation" with an explicit "when unsure, omit it" escape hatch means detection is
best-effort prose, not a checked condition. A session running a genuine active /goal with a
quiet stretch of tool calls in between (no recent /goal-referencing text) could plausibly get
missed the same way loop mode was missed here. Whatever mechanism gets added for loop detection
should also give /goal detection a firmer signal than "infer from conversation" — e.g., an
explicit check against whatever session state actually marks a goal or loop as active, rather than
prose-level inference — so both re-arm rules rest on the same footing.

Suggested fix

  • Add a loop-aware re-arm rule to save-point.md, structurally parallel to the existing
    goal-aware rule: if this session is running under /loop (self-paced or fixed-interval — infer
    from the presence of ScheduleWakeup usage / a /loop-shaped launch prompt in this
    conversation), the resume prompt's first line must be /loop <same-prompt-body> (self-paced) or
    /loop <interval> <same-prompt-body> (fixed-interval, preserving the original interval) — not a
    bare task-continuation sentence.
  • Cover the combination case too: a /goal active inside a /loop needs both wrapped correctly
    (/loop outermost, since /loop's own contract re-issues its prompt verbatim each cycle — a
    /goal line would need to live inside that prompt body, not stack in front of it as a second
    top-level line the way the current single-rule doc might imply if extended naively).
  • Tighten both rules' detection signal from "infer from conversation" / "when unsure, omit" to a
    concrete check against actual session state, if such a signal is available (e.g., whether a
    ScheduleWakeup call with a non-empty prompt exists in this conversation, for loop; an
    equivalent concrete signal for goal).
  • Update the two enforcement checklists in plugins/session-flow/skills/handoff/SKILL.md
    (lines 131, 139) to reference the new loop-aware rule alongside the existing goal-aware one.

Out of scope

  • This report does not propose exact wording for the new rule or checklist lines — that is a
    design decision for whoever implements it (how to phrase the loop-vs-goal nesting case in
    particular deserves its own look).
  • Not filed with a work-class label; that classification belongs to triage.

Activity

  1. added
    needs-triage
    on Jul 25, 2026
  2. added
    needs-human
    on Jul 25, 2026
  3. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Verified. Read plugins/session-flow/reference/save-point.md on origin/main directly: the
    "Goal-aware re-arm" bullet exists exactly as quoted in the issue body, and no loop-aware equivalent
    bullet exists anywhere in that file or in plugins/session-flow/skills/handoff/SKILL.md's two
    enforcement checklists. The gap is real.

    Agent Brief

    Type: Bug
    Summary: save-point.md's emitted resume prompt has a goal-aware re-arm rule but no
    loop-aware equivalent, so a handoff written mid-/loop silently drops the /loop wrapper and the
    pasted resume prompt runs once instead of resuming the recurring/self-paced loop.

    Current behavior:
    The full-path and prompt-only resume-prompt shapes in save-point.md, and the two matching
    enforcement checklists in plugins/session-flow/skills/handoff/SKILL.md (goal-aware bullet only),
    have no rule that checks for or re-arms an active /loop. A handoff written during a /loop run
    emits a bare task-continuation line.

    Desired behavior:
    A new loop-aware re-arm rule, structurally parallel to the existing goal-aware rule: when this
    session is running under /loop (self-paced or fixed-interval), the resume prompt's first line is
    /loop <same-prompt-body> (self-paced) or /loop <interval> <same-prompt-body> (fixed-interval,
    preserving the original interval) — not a bare continuation sentence. Cover the combination case
    (a /goal active inside a /loop): /loop wraps outermost since it re-issues its prompt verbatim
    each cycle, so a /goal line lives inside that prompt body rather than stacking as a second
    top-level line. Update both enforcement checklists in handoff/SKILL.md to reference the new rule.

    Acceptance criteria:

    • save-point.md gains a loop-aware re-arm rule structurally parallel to the goal-aware one,
      covering both the self-paced and fixed-interval /loop shapes.
    • The combination case (goal active inside a loop) is covered: /loop wraps outermost, the
      /goal line lives inside its prompt body.
    • Both enforcement checklists in plugins/session-flow/skills/handoff/SKILL.md (currently
      lines 131 and 139) reference the new loop-aware rule.
    • Existing tests for session-flow still pass.

    Out of scope:

    • Firming up the "infer from conversation" / "when unsure, omit" detection signal for either rule
      into a concrete session-state check — the issue explicitly defers this as a separate improvement,
      not required for the core fix.
    • Exact wording of the new rule and checklist lines — the issue explicitly leaves this to the
      implementer.

    Work-loop admission note. Bounded blast radius (one reference doc, one skill file's two
    checklist lines), trivially reversible, verifiable via existing session-flow tests — C3
    scoped-change shaped. No prior ratification on this item, and this lane's durable state has not
    recorded first_drain_complete: true. Per the admission gate's first-drain rule this is queued,
    not dispatched
    , pending an operator ratification reply. Applied needs-human for that reason,
    not because a design choice is open on the core ask.

  4. kyle-sexton commented on Jul 25, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI, delegated directly by the repository operator to resolve this blocker.

    Independent re-verification (current origin/main)

    Re-checked both files fresh, not relying on the triage comment:

    • plugins/session-flow/reference/save-point.md — the Goal-aware re-arm bullet exists exactly
      as quoted in the issue body; the file contains zero mentions of /loop. No loop-aware
      equivalent anywhere.
    • plugins/session-flow/skills/handoff/SKILL.md — both enforcement checklists say
      `/goal` first line if a goal is active at lines 131 and 139 (line numbers in the brief
      are still accurate), with no loop-aware counterpart.
    • Tests exist to satisfy the last acceptance criterion (skills/handoff/evals/evals.json plus the
      plugin's other eval/test files).

    The gap is real and unchanged since the triage pass.

    Brief soundness check

    The Agent Brief's acceptance criteria are sound and complete. Two implementer notes, neither a
    correction:

    • The rails output is a detection contract consumed by /session-flow:find-handoff
      (documented at the bottom of save-point.md). Its load-bearing keys are the Read @… directive,
      the U+2500 rails + copy instruction, and the Prior session: line — a /loop first line no more
      disturbs them than the existing /goal first line does, so no find-handoff change is required.
    • The re-arm rules live in the shared engine doc, so the new rule also applies to
      /session-flow:continue-in-background's delivery — same posture the goal-aware rule already has;
      intentional, not a side effect.

    Decision

    RATIFIED. C3 scoped-change classification is appropriate: two doc files, bounded blast radius,
    trivially reversible, verifiable against existing evals. Removing needs-human, adding
    agent-ready — eligible for autonomous pickup.

  5. added
    agent-ready
    and removed
    needs-human
    on Jul 25, 2026
  6. self-assigned this
    on Jul 26, 2026
  7. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
  8. kyle-sexton commented on Jul 26, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during work-loop execution.

    Auto-confirmed for autonomous execution: dispatched as a /work-items:work-loop worker with the item pre-admitted (agent-ready, no needs-human, no existing branch/PR/assignee at dispatch time, per re-verification just prior to claim). Claiming and starting implementation now.

  9. added a commit that references this issue on Jul 26, 2026
    2fe3474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyneeds-triage

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions