Skip to content

Hand-back check: give it its own switch - #1360

Merged
mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/handback-own-switch/hand-back-check-give-own-switch--69aa5ab2
Oct 13, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/handback-own-switch/hand-back-check-give-own-switch--69aa5ab2

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

A check catches replies that hand the user a step the agent could have run. Here it never ran, because it shared a switch with features that are off.

This gives that check its own switch. It also still turns on when the older switch is on.

The new switch is off by default.

Review Claim

Approve a separate switch for turning on the hand-back check, so it can run without turning on the other reflect features.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

The new switch defaults to off and the old switch still turns the check on, so nothing changes until someone opts in. The check only reports; it never blocks a reply.

Slice Rationale

The switch and its hook change are one claim. The written rule and the planning guide are other claims and ship separately.

Non-goals

  • No change to what the check judges.
  • No change to the other reflect checks.
  • No fix for the failing test noted below; it fails the same way on the base.

Measured

Command: python3 -m unittest engine/hooks/handback-needs-attempt/tests/test_hooks.py

  • base: Ran 9 tests ... FAILED (failures=1) (the one failure is test_stop_wrapper_never_blocks_the_reply)
  • head: Ran 11 tests ... FAILED (failures=1) (the same one failure; the 2 new tests pass)

Test Plan

Test Plan
  • python3 -m unittest discover -s engine/hooks/_flags/tests printed Ran 45 tests ... OK
  • python3 scripts/ci/check_hook_test_coverage.py engine/hooks/handback-needs-attempt printed check_hook_test_coverage: OK (1 hook(s) checked)
  • Known failing on the base and the head: test_stop_wrapper_never_blocks_the_reply prints catstack-hook-error handback-needs-attempt: ... rejected blank or synthetic model
  • Not run: the check flagging a real handoff in a live session. Blocker: hooks run from the installed copy, which only updates after this merges and ./install.sh runs

Revert Plan

Revert Plan
  • Safe to revert? Yes
  • Revert command: git revert <sha>
  • Post-revert steps: None
  • Data migration? No

🤖 Generated with Claude Code


Note

Low Risk
Additive flag wiring with default-off behavior and unchanged reflect-enforcement compatibility; the check remains advisory and does not block replies.

Overview
The handback-needs-attempt Stop hook no longer runs only when CATSTACK_REFLECT_ENFORCEMENT is on. It gets its own opt-in flag (default off) so the hand-back judge can run without enabling the rest of reflect/automate-me.

CATSTACK_REFLECT_ENFORCEMENT=1 still enables the check, preserving today’s behavior for anyone already using that switch. The hook’s gate and shared _flags wiring are updated accordingly, with two new unit tests covering the dedicated flag path.

Reviewed by Cursor Bugbot for commit a38ea67. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Oct 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: cab39655-cd5c-4290-952b-54694bc704d7)

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 6 minutes 10 seconds in the queue, including 47 minutes 40 seconds running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • test

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for
  • check-success = test
All conditions
  • check-success = test
  • check-success = lint
  • check-success = validate

Requeued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 45 seconds in the queue, including 1 hour 30 seconds running CI.

Reason

The merge conditions cannot be satisfied: the checks did not pass within the checks timeout of 1 hour

These checks were still running:

  • test

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.

If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for
  • check-success = test
All conditions
  • check-success = test
  • check-success = lint
  • check-success = validate

Requeued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 5 minutes 32 seconds in the queue, including 1 hour 33 seconds running CI.

Reason

The merge conditions cannot be satisfied: the checks did not pass within the checks timeout of 1 hour

These checks were still running:

  • test

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.

If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for
  • check-success = test
All conditions
  • check-success = test
  • check-success = lint
  • check-success = validate

Requeued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

🛑 Queue command has been cancelled

@mergify mergify Bot added the queued label Oct 13, 2026
@mergify mergify Bot mentioned this pull request Oct 13, 2026
5 of 6 tasks
@mergify mergify Bot removed the dequeued label Oct 13, 2026
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/handback-own-switch/hand-back-check-give-own-switch--69aa5ab2 branch from 42ee33c to a38ea67 Compare October 13, 2026 03:59
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: d0274e66-9f25-4672-a3b6-8d47b33ee02a)

@mergify mergify Bot removed the queued label Oct 13, 2026
@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 2 hours 1 minute 55 seconds in the queue, including 1 hour 31 seconds running CI.

Reason

The merge conditions cannot be satisfied: the checks did not pass within the checks timeout of 1 hour

These checks were still running:

  • test

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.

If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 1 minute 18 seconds in the queue, including 1 hour 57 seconds running CI.

Required conditions to merge
  • check-success = lint
  • check-success = test
  • check-success = validate

@mergify mergify Bot added the queued label Oct 13, 2026
@mergify mergify Bot mentioned this pull request Oct 13, 2026
6 tasks done
@mergify mergify Bot removed the dequeued label Oct 13, 2026
@mergify
mergify Bot merged commit 95a7429 into main Oct 13, 2026
7 checks passed
@mergify mergify Bot removed the queued label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant