Skip to content

[CLI] Subagent sessions trigger continuous schema rejection on metadata.variant #13620

Closed

Description

@Natan-M64

Description

Summary

When Kilo CLI spawns multiple read-only subagent sessions, the local runtime starts emitting a continuous schema rejection approximately once per second:

Expected JSON value, got undefined at [0]["metadata"]["variant"]

The parent session continues progressing, but the warning loop persists until the session is disposed.

Environment

  • Kilo CLI: 7.5.6
  • Operating system: macOS
  • Provider: custom OmniRoute provider (provider credentials and private configuration omitted)
  • Agent type involved: explore subagents

Actual behavior

After three explore child sessions are created, the log records child-session entries containing:

  • model=undefined
  • metadata=undefined

The first schema rejection appears about one second after the child sessions are created and then repeats at roughly one-second intervals. The parent session continues making progress and can still invoke tools.

Expected behavior

Session metadata should be normalized before it is serialized or validated. Missing optional fields should not cause an unbounded polling/retry loop or repeated warnings.

Impact

  • Significant log growth
  • Unnecessary CPU and disk I/O
  • Increased diagnostic noise
  • No evidence of source-code corruption or provider-side failure
  • The parent task may continue, but the runtime becomes degraded while the affected child sessions remain active

Additional observations

  • A fresh Kilo start without spawning subagents did not produce this warning.
  • The warning stops when the affected session is disposed.
  • The issue appears to be local session/event serialization rather than a model response error, although the exact endpoint or source location is not yet confirmed.

No credentials, tokens, cookies, session identifiers, or raw logs are included in this report.

Plugins

None relevant; custom OmniRoute provider used (private details omitted)

Kilo version

7.5.6

Steps to reproduce

  1. Start Kilo CLI 7.5.6 on macOS.
  2. Start a coding session in a project.
  3. Ask the primary agent to create three read-only explore subagents in parallel.
  4. Observe the Kilo log while the child sessions are active.
  5. Look for repeated warnings matching:
    schema rejection
    Expected JSON value, got undefined
    metadata.variant
  6. Dispose the affected session and observe that the repeated warnings stop.
  7. Start a fresh session without creating subagents; the warning does not appear in the comparison run.

Screenshot and/or share link

No response

Operating System

macOS

Terminal

Terminal.app / Kilo CLI

Activity

  1. maphew commented on Sep 2, 2026

    @maphew
    Contributor

    Root cause confirmed and fixed.

    The subagent tool-part metadata in packages/opencode/src/tool/task.ts always included the variant key even when no model variant was selected, leaving an undefined value in the in-memory metadata object. JSON-valued schema validation rejects undefined, which produced the repeated Expected JSON value, got undefined at [0]["metadata"]["variant"] warning after spawning explore subagents.

    The construction-side fix (omitting variant when undefined) already landed on main in commit dd390c1930 (PR #13641). A regression test locking in the JSON-clean metadata is added in PR #13688.

  2. Natan-M64 commented on Sep 2, 2026

    @Natan-M64
    Author

    Root cause confirmed and fixed.

    The subagent tool-part metadata in packages/opencode/src/tool/task.ts always included the variant key even when no model variant was selected, leaving an undefined value in the in-memory metadata object. JSON-valued schema validation rejects undefined, which produced the repeated Expected JSON value, got undefined at [0]["metadata"]["variant"] warning after spawning explore subagents.

    The construction-side fix (omitting variant when undefined) already landed on main in commit dd390c1930 (PR #13641). A regression test locking in the JSON-clean metadata is added in PR #13688.

    Thanks for investigating and fixing this! I'll close the issue as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions