Skip to content

self-development: prevent kelos-bot from triggering self-development spawners#1100

Merged
gjkim42 merged 1 commit intomainfrom
kelos-task-1098
May 4, 2026
Merged

self-development: prevent kelos-bot from triggering self-development spawners#1100
gjkim42 merged 1 commit intomainfrom
kelos-task-1098

Conversation

@kelos-bot
Copy link
Copy Markdown

@kelos-bot kelos-bot Bot commented May 4, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Prevents the kelos bot from recursively triggering self-development TaskSpawners.

Several self-development TaskSpawners listed kelos-bot[bot] as a positive author allowlist entry alongside gjkim42. Combined with bodyContains: /kelos <command> filters, this allowed agent-authored comments that mention /kelos api-review, /kelos review, /kelos pick-up, or /kelos plan (e.g. recommendations in planner/reviewer outputs) to trigger another spawner — the recursion vector described in the issue.

The GitHubWebhook.ExcludeAuthors field already exists in the API and is evaluated before filters, taking precedence over filter-level Author matches. This PR applies it at the top level of the affected spawners and drops the now-redundant author: kelos-bot[bot] filter entries:

  • kelos-workers
  • kelos-planner
  • kelos-pr-responder
  • kelos-reviewer
  • kelos-api-reviewer

kelos-triage is intentionally left unchanged — it triages bot-created issues opened by kelos-self-update, which is the desired workflow. kelos-squash-commits already restricts to gjkim42 only.

Which issue(s) this PR is related to:

Fixes #1098

Special notes for your reviewer:

This is in tension with #979's finding that kelos-squash-commits is the only command handler missing kelos-bot[bot] from its author allowlist. Issue #1098 takes the opposite direction (no bot-on-bot triggers via these command filters), so #979's symmetry argument no longer applies for these filter blocks.

make verify and make test pass locally.

Does this PR introduce a user-facing change?

NONE

…spawners

Add `excludeAuthors: [kelos-bot[bot]]` at the top level of webhook-driven
self-development TaskSpawners and remove the now-redundant `kelos-bot[bot]`
positive author allowlist entries. Top-level ExcludeAuthors is evaluated
before filters and takes precedence over filter-level Author matches, so
agent-authored comments containing strings like `/kelos api-review` no
longer recursively trigger another spawner.

Affects: kelos-workers, kelos-planner, kelos-pr-responder, kelos-reviewer,
kelos-api-reviewer. kelos-triage is left unchanged so bot-created issues
(e.g. from kelos-self-update) continue to be triaged. kelos-squash-commits
already restricts to gjkim42 only.
@github-actions github-actions Bot added needs-triage needs-kind Indicates an issue or PR lacks a kind/* label kind/bug Categorizes issue or PR as related to a bug needs-priority needs-actor release-note-none and removed needs-kind Indicates an issue or PR lacks a kind/* label labels May 4, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 4, 2026

Greptile Summary

This PR closes the bot-on-bot recursion vector (issue #1098) by adding excludeAuthors: kelos-bot[bot] at the top-level githubWebhook spec of five TaskSpawners (kelos-workers, kelos-planner, kelos-pr-responder, kelos-reviewer, kelos-api-reviewer) and removing the now-redundant per-filter author: kelos-bot[bot] entries. The approach is correct — excludeAuthors is evaluated before filter-level author matches — and the intentional carve-outs (kelos-triage, kelos-squash-commits) are left unchanged as documented.

  • The PR uses /kind bug, but CLAUDE.md specifies that PRs modifying only self-development/ files should use /kind cleanup.

Confidence Score: 4/5

Safe to merge — the recursion fix is correct and complete; only a minor /kind label convention violation remains.

All changed files are simple YAML config edits that are logically correct. The only finding is a P2 style violation (/kind bug instead of /kind cleanup per CLAUDE.md), which does not affect runtime behavior.

No files require special attention.

Important Files Changed

Filename Overview
self-development/kelos-api-reviewer.yaml Adds top-level excludeAuthors: kelos-bot[bot] and removes both redundant author: kelos-bot[bot] entries (issue_comment and pull_request_review) from the api-review command filters.
self-development/kelos-reviewer.yaml Adds top-level excludeAuthors: kelos-bot[bot] and removes both redundant author: kelos-bot[bot] entries (issue_comment and pull_request_review) from the review command filters.
self-development/kelos-pr-responder.yaml Adds top-level excludeAuthors: kelos-bot[bot] and removes the redundant issue_comment pick-up filter scoped to kelos-bot[bot]; the pull_request_review filter (which already had no author restriction) is now correctly guarded by the top-level exclusion.
self-development/kelos-planner.yaml Adds top-level excludeAuthors: kelos-bot[bot] and removes the redundant per-filter author: kelos-bot[bot] entry from the plan command filter.
self-development/kelos-workers.yaml Adds top-level excludeAuthors: kelos-bot[bot] and removes the now-redundant per-filter author: kelos-bot[bot] entry for the issue_comment pick-up filter.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    GH[GitHub Webhook Event] --> EA{excludeAuthors check}
    EA -- "author == kelos-bot[bot]" --> DROP[🚫 Event dropped — no spawner triggered]
    EA -- "author != kelos-bot[bot]" --> FL{Filter evaluation}
    FL -- "filter matches e.g. gjkim42 + bodyContains" --> SPAWN[✅ TaskSpawner fires]
    FL -- no match --> NOOP[Event ignored]

    subgraph Before this PR
        OLD_FL{Filter evaluation OLD} -- "author: gjkim42 match" --> OLD_SPAWN1[TaskSpawner fires]
        OLD_FL -- "author: kelos-bot[bot] match + bodyContains /kelos cmd" --> OLD_RECURSE[⚠️ Recursive spawn!]
    end
Loading

Comments Outside Diff (1)

  1. self-development/kelos-workers.yaml, line 1 (link)

    P2 Wrong /kind label for self-development/-only PR

    CLAUDE.md (and AGENTS.md) states: "PRs that only modify files under self-development/ are internal agent improvements — use /kind cleanup and write NONE in the release-note block." All five changed files are under self-development/, so this PR should use /kind cleanup rather than /kind bug.

    Context Used: CLAUDE.md (source)

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: self-development/kelos-workers.yaml
    Line: 1
    
    Comment:
    **Wrong `/kind` label for `self-development/`-only PR**
    
    CLAUDE.md (and AGENTS.md) states: "PRs that only modify files under `self-development/` are internal agent improvements — use `/kind cleanup` and write `NONE` in the `release-note` block." All five changed files are under `self-development/`, so this PR should use `/kind cleanup` rather than `/kind bug`.
    
    **Context Used:** CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=c0a0674a-9e65-4e96-88fa-4a29086750fb))
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
self-development/kelos-workers.yaml:1
**Wrong `/kind` label for `self-development/`-only PR**

CLAUDE.md (and AGENTS.md) states: "PRs that only modify files under `self-development/` are internal agent improvements — use `/kind cleanup` and write `NONE` in the `release-note` block." All five changed files are under `self-development/`, so this PR should use `/kind cleanup` rather than `/kind bug`.

Reviews (1): Last reviewed commit: "self-development: prevent kelos-bot from..." | Re-trigger Greptile

@kelos-bot kelos-bot Bot added kind/cleanup and removed kind/bug Categorizes issue or PR as related to a bug labels May 4, 2026
@gjkim42 gjkim42 added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 41b8297 May 4, 2026
44 checks passed
@gjkim42 gjkim42 deleted the kelos-task-1098 branch May 4, 2026 11:48
kelos-bot Bot pushed a commit that referenced this pull request May 4, 2026
…y PRs

PR #1100 was an agent-generated PR that modified only self-development/
files but used /kind bug. Greptile flagged it P2 against the existing
CLAUDE.md/AGENTS.md rule:

  PRs that only modify files under self-development/ are internal agent
  improvements — use /kind cleanup and write NONE in the release-note
  block.

The rule lives in the project's AGENTS.md but was not echoed into the
agent's own agentsMD (where most other PR conventions are duplicated)
nor surfaced in the reviewer's project-conventions checklist. So the
worker missed it at PR-creation time, and the kelos-reviewer pass did
not catch it before merge.

Echo the rule into the shared and worker AgentConfigs, and add an
explicit reviewer checklist item with a P2 severity hint so a /review
pass on a self-development/-only PR will flag a wrong /kind label.

The framing emphasizes "classify by file location, not by problem
nature" — the failure mode in PR #1100 was the agent picking the label
from the change's semantic intent (recursion-prevention bug fix) rather
than from the directory scope.
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.

self-development: Bot should not trigger other bots

1 participant