Skip to content

bug: stale-base merge (#606) silently reverted the initiative-planner discussion→dispatch fix (#618); idea:approved stopped planning #655

Closed

Description

@don-petry

Summary

The initiative-planner's primary trigger — a maintainer adding idea:approved to an Ideas Discussion — silently stopped working. Labelling Discussion #650 fired the planner but it died with:

##[error]Action failed with error: Unsupported event type: discussion

No epic was created. Root cause is not a new bug: a previously-shipped fix was silently reverted by an unrelated PR that was merged from a stale base. Filing this to capture the regression sequence and prevent recurrence. Fix is in #654.

Regression sequence

# PR / event What it did
1 #591 Identified: claude-code-action aborts on discussion event contexts, so the idea:approved auto-trigger never plans.
2 #618 (6feb0fe, 06-11) Fixed it. Added a redispatch bridge job: on discussion [labeled] the planner resolves the discussion number and re-invokes itself via workflow_dispatch (which the action supports); plan runs only on workflow_dispatch. Shipped with scripts/initiative-planner/redispatch.sh + tests/test_initiative_planner_redispatch.bats.
3 #606 (0407ea5, 06-11, "pr-review: PRs with >300 changed files hard-fail") Silently reverted #618. This PR was branched off main before #618 landed and, on merge, its diff deleted the redispatch job, redispatch.sh, and test_initiative_planner_redispatch.bats, and restored the broken direct-on-discussion if. The PR had nothing to do with the planner.
4 #640 (3f9e580, 06-13, dependabot) Bumped claude-code-action 1.0.133 → 1.0.148 on top of the now-broken file. Not causal — only touched the action SHA.
5 Discussion #650 (06-13) Maintainer added idea:approved → run 27479891465 failed with "Unsupported event type: discussion". Bug confirmed in production.

Why it slipped through CI

The killer property: #606 deleted the regression test (test_initiative_planner_redispatch.bats) in the same diff that deleted the feature. So there was no failing test to flag the revert — CI was green on a PR that removed both the guard and the thing it guarded. The mechanism is a classic stale-base / semantic revert: a PR whose branch predates an intervening change can, on merge, reintroduce the pre-change state of files it happens to touch, without a textual conflict.

Prevention (proposed)

  1. Require branches to be up to date with base before merge — i.e. adopt GitHub merge queues (or at minimum enable "Require branches to be up to date before merging" in branch protection). Under a merge queue, feat: implement issue #574 — pr-review: PRs with >300 changed files hard-fail the cascade (gh pr diff 406); define org standard for oversized PRs #606 would have been rebased onto post-feat: implement issue #591 — bug(initiative-planner): claude-code-action rejects discussion events — the idea:approved auto-trigger never plans #618 main and re-tested before landing; the revert would surface as a conflict or a failing test_initiative_planner_redispatch.bats instead of merging clean. This is the single highest-leverage guard for this class of bug.
  2. Treat test deletions as a reviewable signal — flag PRs that delete files under tests/ (or net-remove test cases) for explicit human acknowledgement, so "PR silently deletes a regression test" can't pass unnoticed.
  3. Smoke-monitor the live trigger — the planner's discussion [labeled] path has no post-merge canary. A lightweight check (or alert on planner runs that conclude failure with "Unsupported event type") would have caught this on the first idea:approved after the revert rather than relying on a human noticing MCP-Powered CI Review Enhancement — Standard #650 never planned.
  4. Pin agent-authored PRs to a fresh base — feat: implement issue #574 — pr-review: PRs with >300 changed files hard-fail the cascade (gh pr diff 406); define org standard for oversized PRs #606 was an agent-implemented PR (feat: implement issue #574); requiring a rebase-onto-latest-main step before agent PRs merge closes the stale-base window.

Acceptance

https://claude.ai/code/session_01WRJisJyfNK2CuR4f1n9cao

Activity

  1. don-petry commented on Jul 14, 2026

    @don-petry
    CollaboratorAuthor

    Closing as resolved (confirmed per your note — a canary-rollout stale-base side effect, now fixed).

    Remaining are process decisions, not code (tracked here for your call, non-blocking):

    The regression itself is fixed and canary-guarded.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reports

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions