Skip to content

Configuration Alignment: kelos-planner, kelos-reviewer, kelos-squash-commits filters miss commentOn β€” replace prompt-side PR-vs-issue workarounds with the new filterΒ #1089

Description

@kelos-bot

πŸ€– Kelos Self-Update Agent @gjkim42

Area: Configuration Alignment

Summary

PR #1081 (merged 2026-05-01) added a first-class commentOn field to GitHubWebhookFilter so spawner authors can scope issue_comment events to plain issues (Issue) or pull requests (PullRequest). Two webhook-driven TaskSpawners β€” kelos-workers and kelos-pr-responder β€” already adopted it. Three more (kelos-planner, kelos-reviewer, kelos-squash-commits) still rely on prompt-side workarounds or have no guard at all. This is the follow-up cleanup explicitly deferred by #1081's PR description ("Spawner-prompt cleanups […] are intentionally out of scope per the issue and will follow as separate PRs.").

Findings

1. kelos-planner.yaml β€” filter accepts both, prompt has a stale step-0 guard

kelos-planner.yaml lines 33–43 lack commentOn on either filter:

- event: issue_comment
  action: created
  bodyContains: /kelos plan
  state: open
  author: gjkim42
- event: issue_comment
  action: created
  bodyContains: /kelos plan
  state: open
  author: kelos-bot[bot]

kelos-planner.yaml lines 86–88 then bail at runtime:

### 0. Confirm the target is an issue
If `gh pr view {{.Number}}` succeeds, this comment was posted on a pull request.
Exit without posting anything in that case.

Every PR comment containing /kelos plan (e.g., a maintainer asking the planner to plan against a PR's open question) spawns a full Opus task that consumes credentials only to exit at step 0. The README documents this spawner as "Webhook: issue comment /kelos plan" β€” the implementation should match.

Proposed fix:

  • Add commentOn: Issue to both filter entries.
  • Delete the ### 0. Confirm the target is an issue block (lines 84–88) β€” the filter now enforces it.

2. kelos-reviewer.yaml β€” filter accepts both, prompt has no guard (supersedes #1060)

kelos-reviewer.yaml lines 47–56 (the issue_comment filter entries) lack commentOn:

- event: issue_comment
  action: created
  bodyContains: /kelos review
  state: open
  author: gjkim42
- event: issue_comment
  action: created
  bodyContains: /kelos review
  state: open
  author: kelos-bot[bot]

The prompt then unconditionally assumes a PR (lines 92–104, 118, 125, 227): gh pr view, git diff origin/main...HEAD, gh pr review. If /kelos review is posted on a plain issue, the agent burns a full Opus task that can only fail or hallucinate a "PR review" comment. branch: "{{.Branch}}" (line 89) also resolves to empty for plain-issue comments per the README template-variable table.

This was previously tracked in #1060, which proposed a step-0 prompt guard plus a safer branch fallback. The new commentOn filter is a strictly better solution β€” it stops the spawn at the webhook layer instead of at runtime, mirroring the pattern already established by kelos-workers and kelos-pr-responder.

Proposed fix:

3. kelos-squash-commits.yaml β€” filter accepts both, prompt is PR-only

kelos-squash-commits.yaml lines 13–17 lack commentOn:

- event: issue_comment
  action: created
  bodyContains: /kelos squash-commits
  state: open
  author: gjkim42

The prompt is entirely PR-focused (git rebase origin/main, git push --force-with-lease, gh pr view, gh pr edit, gh pr ... comment). A /kelos squash-commits posted on a plain issue spawns a Sonnet task that fails at step 4 (gh pr view {{.Number}} --json body) and may post a confusing comment.

Proposed fix:

  • Add commentOn: PullRequest to the issue_comment filter entry. The pull_request_review entry is already PR-only by event type.

Why this is consistent

TaskSpawner Documented intent commentOn today Proposed
kelos-workers issues only Issue βœ… (already done)
kelos-pr-responder PRs only PullRequest βœ… (already done)
kelos-planner issues only (none) ❌ Issue
kelos-reviewer PRs only (none) ❌ PullRequest
kelos-squash-commits PRs only (none) ❌ PullRequest
kelos-api-reviewer both intentionally (none, by design) leave as-is β€” runtime dispatch is the documented behavior

After this change, every webhook-driven TaskSpawner whose intent is single-subject uses the filter to enforce that intent, and prompt-side gh pr view guards exist only in kelos-api-reviewer where they reflect deliberate dual-mode dispatch.

Impact

Not covered by existing issues

Metadata

Metadata

Assignees

No one assigned

    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