Skip to content

openclaw ACP adapter: cancellation marker survives a finished prompt and mislabels the next prompt as cancelled (#3997) #4618

Closed

Description

@dezren39

Finding (from PR review)

A cancellation that races with a prompt's completion leaves a stale cancellation marker that mislabels the next normally completed prompt. Codex (P2, PR #3997):

When a cancellation notification races with the prompt's final idle event, the prompt can finish before this handler runs. The handler still records the session as cancelled, but an ensuing idle event cannot remove that marker because cleanup in handleServeEvent requires a pending prompt. The next normally completed prompt then incorrectly returns stopReason: "cancelled". The marker also survives a cancelled prompt ending through session.error. Only mark active prompts as cancelled and clear their cancellation state on every terminal path.

Evidence

Acceptance criteria

  • Cancellation is recorded only for prompts actually in flight, and cancellation state is cleared on every terminal path (session.idle, session.error, prompt finish).
  • A regression test covers: cancel arriving after a prompt finished, followed by a normal prompt that must return stopReason: "end_turn".
  • Or the finding is resolved by a documented decision on this issue.

Activity

  1. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  4. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  5. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: handed_off
    state: handed off
    task: 6520 (repo-health-code-pilot; worker repo-worker-code)
    session: ses_e5e61a4e311ffea3y9BCxWDFUd
    route: opencode-route/workhorse
    action: Bound OpenCode worker launched for this already-claimed task; it must not claim another task.

  6. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  8. 32 remaining items

  9. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: repo-fleet-monitor run 2026-11-02 20:12 CST
    • Found via: monitor reconciliation
    • Task: Claim-evaporated repair: task 6520 is queued unclaimed (attempts 3/3, checkpoint stage handed_off) while this issue still carried claimed labels. Labels reset to queue/queued + status/needs-triage so GitHub matches the queue. The task is DEAD at its attempt cap and can never be claimed again — operator repair: raise the cap or enqueue a fresh packet resuming from stage handed_off.
    • Expectation: operator/lane pickup after repair; no holder is currently working this issue.
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  11. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  12. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · bound

  13. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  14. added a commit that references this issue on Nov 3, 2026
  15. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobsource/pr-comment-reviewFiled by the pr-comment-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions