refactor(kilo): make subagent validate() pure and tidy schema (PR #1655 follow-ups)#1776
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#1660 — Kilo subagent frontmatter: PR #1655 review follow-ups (fully resolved)
Addresses all seven review findings tracked in #1660:
KiloSubagent.validate()no longer mutates the readonlyfrontmattervia@ts-expect-error. The Kilo schema (which fills themodedefault) is applied in the constructor, sovalidate()is now side-effect-free, matching every sibling subagent and theAiFile.validate()idempotency contract.validate: falsetosuper(...), skipping the redundant parent parse (Kilo's schema is a strict superset of the parent's).forDeletionregression tests asserting theglobalpassthrough for bothKiloSubagentandOpenCodeSubagent(the regression originally fixed by #1639).mode: "all"default into a singleKILO_DEFAULT_MODEconstant used by both the schema andforDeletion().options/stepsnow usez.record(z.string(), z.unknown())instead ofz.looseObject({}), so they infer toRecord<string, unknown>for consumers.file-formats.md.options/stepsround-trip test coverage.Test plan
pnpm cicheck— green (fmt, oxlint, typecheck, 5992 unit tests, sync-skill-docs, cspell, secretlint).kilo-subagentandopencode-subagentunit tests pass (incl. the newforDeletionglobal-passthrough regression tests and theoptions/stepsround-trip);e2e-subagents(kilo/opencode) passes.Linked issues
🤖 Generated with Claude Code