Skip to content

Workflow Completeness: kelos-config-update PR dedup check never matches due to date-based branch naming #669

@kelos-bot

Description

@kelos-bot

🤖 Kelos Self-Update Agent @gjkim42

Problem

The kelos-config-update TaskSpawner creates a new PR every daily run instead of updating an existing one, because the PR deduplication check in the prompt never finds a match.

Root cause: The prompt instructs the agent to check for existing open PRs using:

gh pr list --head kelos-config-update --state open

But the branch template is:

branch: "kelos-config-update-{{.ID}}"

Where {{.ID}} for cron sources resolves to a date-time string (e.g., 20260313-1800), producing branches like kelos-config-update-20260313-1800. The gh pr list --head flag performs exact matching, not prefix matching, so --head kelos-config-update returns empty results when the actual branch is kelos-config-update-20260313-1800.

This means the dedup guard never triggers, and the agent creates a new PR on every run.

Evidence

There are currently 7 open kelos-config-update PRs that have accumulated over the past week, each on a separate date-based branch:

PR Branch Created
#662 kelos-config-update-20260313-1800 2026-03-13
#652 kelos-config-update-20260312-1800 2026-03-12
#619 kelos-config-update-20260309-1800 2026-03-09
#599 kelos-config-update-20260308-1800 2026-03-08
#582 kelos-config-update-20260307-1800 2026-03-07
#569 kelos-config-update-20260306-1800 2026-03-06
#561 kelos-config-update-20260305-1800 2026-03-05

Some of these PRs have overlapping or conflicting changes (e.g., #619 and #599 both add self-review and commit hygiene conventions to the same files). This creates merge conflicts and review burden for the maintainer.

Verified behavior:

$ gh pr list --head kelos-config-update --state open --json number
[]

$ gh pr list --head kelos-config-update-20260313-1800 --state open --json number
[{"number":662}]

Proposed Fix

Update the dedup check in the kelos-config-update.yaml prompt (line 92) to use a search query that matches any branch with the kelos-config-update prefix:

Option A (recommended): Use --search with the branch prefix:

gh pr list --state open --search "head:kelos-config-update" --json number,title,headRefName

Option B: Use the label to find existing PRs from this agent:

gh pr list --state open --label generated-by-kelos --search "author:app/github-actions" --json number,title,headRefName

Then filter for PRs with kelos-config-update in the branch name.

Additionally, the prompt should instruct the agent to check out the existing PR's branch and push updates to it, rather than creating a new branch. This would require either:

  • Using a fixed branch name (e.g., kelos-config-update-latest) instead of the date-based kelos-config-update-{{.ID}}
  • Or having the agent switch to the existing PR's branch when one is found

Files to Change

  • self-development/kelos-config-update.yaml — line 92 (the dedup check command) and potentially line 20 (the branch template)

Scope

This is a prompt tuning + configuration fix. No code changes to the Kelos controller are needed.

/kind cleanup

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions