Skip to content

chore: convert upstream-manual-merge command to agent#9965

Merged
markijbema merged 3 commits into
mainfrom
mark/upstream-merge-agent
May 7, 2026
Merged

chore: convert upstream-manual-merge command to agent#9965
markijbema merged 3 commits into
mainfrom
mark/upstream-merge-agent

Conversation

@markijbema
Copy link
Copy Markdown
Contributor

Summary

Converts .kilo/command/upstream-manual-merge.md into .kilo/agent/upstream-merge.md so the workflow can run under agent-scoped permissions. The body of the workflow is unchanged except for step 1, which no longer relies on $ARGUMENTS (agents don't support command template vars) — the agent reads the version from the user's first message, the branch name, or the newest upstream-merge-report-<version>.md.

Why

The existing slash command ran under the caller's unrestricted permissions. As an agent we can gate read, edit, and webfetch behind ask, and whitelist only the read-only shell commands the workflow actually needs (git status/log/diff/show, grep/rg, cat/head/tail, gh pr view, script/upstream/find-conflict-markers.sh, the project's test/typecheck/lint runners, etc.) while leaving everything else — notably sed -i and any other file-mutating shell command — to fall through to ask. This makes the "approve before applying" step of the manual merge workflow mechanical instead of social.

Notes

  • Permission rules use last-match-wins (permission/evaluate.ts:9-15 uses Array.findLast), so "*": ask is listed first and specific allows follow. The kilo-config built-in skill doc currently states the opposite — worth a follow-up fix there.
  • Bash patterns match against the full literal command string (anchored both ends); a trailing * is special-cased so e.g. "git status *" matches both bare git status and git status --short.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 6, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • .kilo/agent/upstream-merge.md

Reviewed by gpt-5.5-2026-04-23 · 254,232 tokens

Three new/extended sections capturing patterns that repeatedly caught us off-guard during the v1.14.33 merge:

- 6.5 Scan auto-merged files for latent bugs. Not every problem surfaces as a conflict marker: duplicate declarations, duplicate manifest keys, orphaned imports, and partially-applied auto-merges that reference names from paths Kilo stubbed out.

- 9.5 Handle downstream API renames as separate commits. An upstream rename auto-merges cleanly in shared code but cascades into Kilo-only files. Keep the behavioural merge commit focused; land the mechanical cascade in follow-ups.

- 9.6 Handle upstream-added tests that diverge from Kilo. Upstream tests can encode contracts Kilo intentionally breaks, intercept seams that dependency injection now bypasses, or assume serialization shapes Kilo's extensions violate. Rewrite, skip, or delete — with a kilocode_change breadcrumb.

- Common pitfalls: added ambient-state / dependency-injection / serialization / rule-ordering / environment-divergence / lockfile-sync bullets, phrased generically so they apply beyond any one technology stack.
@markijbema markijbema merged commit 979fdc7 into main May 7, 2026
11 checks passed
@markijbema markijbema deleted the mark/upstream-merge-agent branch May 7, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants