Skip to content

refactor(kilo): make subagent validate() pure and tidy schema (PR #1655 follow-ups)#1776

Merged
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issues-20260608-8
Jun 9, 2026
Merged

refactor(kilo): make subagent validate() pure and tidy schema (PR #1655 follow-ups)#1776
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issues-20260608-8

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

#1660 — Kilo subagent frontmatter: PR #1655 review follow-ups (fully resolved)

Addresses all seven review findings tracked in #1660:

# Sev Fix
1 High KiloSubagent.validate() no longer mutates the readonly frontmatter via @ts-expect-error. The Kilo schema (which fills the mode default) is applied in the constructor, so validate() is now side-effect-free, matching every sibling subagent and the AiFile.validate() idempotency contract.
2 Mid The constructor passes validate: false to super(...), skipping the redundant parent parse (Kilo's schema is a strict superset of the parent's).
3 Mid Added forDeletion regression tests asserting the global passthrough for both KiloSubagent and OpenCodeSubagent (the regression originally fixed by #1639).
4 Mid Extracted the mode: "all" default into a single KILO_DEFAULT_MODE constant used by both the schema and forDeletion().
5 Low options/steps now use z.record(z.string(), z.unknown()) instead of z.looseObject({}), so they infer to Record<string, unknown> for consumers.
6 Low Replaced the long inline Kilo-fields doc bullet with a field/type/notes table in file-formats.md.
7 Low Added options/steps round-trip test coverage.

Test plan

  • pnpm cicheck — green (fmt, oxlint, typecheck, 5992 unit tests, sync-skill-docs, cspell, secretlint).
  • kilo-subagent and opencode-subagent unit tests pass (incl. the new forDeletion global-passthrough regression tests and the options/steps round-trip); e2e-subagents (kilo/opencode) passes.

Linked issues

🤖 Generated with Claude Code

… follow-ups)

Addresses the review follow-ups tracked in #1660:

- #1 (High): KiloSubagent.validate() no longer mutates the readonly frontmatter via @ts-expect-error. The Kilo schema (which fills the mode default) is now applied in the constructor, so validate() is side-effect-free like every sibling subagent.

- #2 (Mid): the constructor passes validate:false to super to skip the redundant parent parse (Kilo's schema is a strict superset).

- #3 (Mid): added forDeletion regression tests asserting the global passthrough for both KiloSubagent and OpenCodeSubagent.

- #4 (Mid): extracted the mode default into a KILO_DEFAULT_MODE constant used by both the schema and forDeletion.

- #5 (Low): options/steps now use z.record(z.string(), z.unknown()) instead of z.looseObject({}).

- #6 (Low): replaced the long inline Kilo-fields doc bullet with a field/type/notes table.

- #7 (Low): added options/steps round-trip test coverage.

Closes #1660

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dyoshikawa dyoshikawa merged commit 56e29fb into main Jun 9, 2026
10 checks passed
@dyoshikawa dyoshikawa deleted the resolve-scrap-issues-20260608-8 branch June 9, 2026 03:00
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.

Follow-ups from PR #1655 review (Kilo subagent frontmatter)

2 participants