Skip to content

test(cli): cover JSON-clean task metadata without a selected variant - #13688

Merged
johnnyeric merged 3 commits into
Kilo-Org:mainfrom
maphew:fix/cli-subagent-metadata-variant
Sep 3, 2026
Merged

johnnyeric merged 3 commits into
Kilo-Org:mainfrom
maphew:fix/cli-subagent-metadata-variant

Conversation

@maphew

@maphew maphew commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What

Add a regression test for #13620 to packages/opencode/test/kilocode/tool-task-model.test.ts.

The subagent task metadata previously always contained a variant key even when no variant was selected, leaving an undefined value in the in-memory metadata object. JSON-valued schema validation rejects undefined, so spawning explore subagents without a variant produced a repeated Expected JSON value, got undefined at [0]["metadata"]["variant"] rejection.

Why

The construction-side fix already landed on main in commit dd390c1 (PR #13641), but it has no test coverage, and issue #13620 remains open and unlinked. This test locks in the behavior:

  • the metadata omits the variant key when undefined
  • the metadata validates against Schema.Record(Schema.String, Schema.Json)

Reverting the guard in task.ts makes this test fail, confirming it covers the regression.

Scope

Test-only change; no production code modified.

The subagent task metadata previously always included the model variant
key even when undefined, which failed JSON-valued schema validation and
produced a repeated "Expected JSON value, got undefined" rejection
after spawning explore subagents (issue Kilo-Org#13620). The construction-side
fix already landed on main in dd390c1; this adds the regression test
locking in that the metadata omits the variant key and stays
JSON-serializable.
Check the decoded output as well as the source object so the assertion
remains meaningful even if Record decoding changes semantics.
@maphew
maphew marked this pull request as ready for review September 2, 2026 04:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-02T05:02:57.176860Z 5e366bf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • packages/opencode/test/kilocode/tool-task-model.test.ts

Reviewed by grok-4.6 · Input: 139.9K · Output: 8.8K · Cached: 417.4K

Review guidance: REVIEW.md from base branch main

…i-subagent-metadata-variant

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>

maphew commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merge-readiness sweep complete: branch synced with current main (ffc0655, 0 behind), no merge conflicts, CI green on the latest head, Codex + Kilo reviews report no issues. Ready for human review.

@johnnyeric
johnnyeric merged commit 7db1716 into Kilo-Org:main Sep 3, 2026
29 checks passed
@johnnyeric

Copy link
Copy Markdown
Contributor

Thanks for adding the test! merged.

@maphew
maphew deleted the fix/cli-subagent-metadata-variant branch September 10, 2026 03:57
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