Skip to content

refactor(cli): carry agent displayName/source as typed fields instead of provider options#11773

Merged
chrarnoldus merged 7 commits into
mainfrom
refactor/agent-typed-metadata-fields
Jun 29, 2026
Merged

refactor(cli): carry agent displayName/source as typed fields instead of provider options#11773
chrarnoldus merged 7 commits into
mainfrom
refactor/agent-typed-metadata-fields

Conversation

@chrarnoldus

Copy link
Copy Markdown
Collaborator

Summary

Follow-up hardening split out of #11767. Keeps the agent options record provider-clean by storing Kilo agent metadata as typed fields instead of mixing it into the bag that is forwarded to the model API.

options is forwarded verbatim into providerOptions, so any non-provider key in it gets sent in the request body. Previously convertOrganizationMode and marketplace/.md agents stored displayName/source there, which leaked to strict providers (the root cause behind #11754).

Changes

  • Added typed displayName/source fields to the agent config schema (config/agent.ts, also in KNOWN_KEYS so they're not promoted into options) and the runtime Agent.Info (agent/agent.ts).
  • convertOrganizationMode now writes typed displayName/source instead of options: { ... }.
  • processConfigItem lifts any legacy/marketplace options.displayName/options.source onto the typed fields and deletes them from options, so installed .md/marketplace agents are cleaned at construction too.
  • The org-agent removal guard reads the typed source (with an options fallback for safety).

Relationship to #11767

#11767 is the actual bug fix for #11754 — it strips id/displayName/source from agent.options at the request boundary as a safety net (and is the only thing that covers id, which intentionally stays in options). This PR is independent defense-in-depth that removes the pollution at its source; the two can merge in either order.

Notes

  • Adds two optional keys (displayName, source) to the agent config schema. If the cloud config JSON schema isn't auto-derived from Config.Info, a matching entry may need mirroring in the cloud repo (apps/web/src/app/config.json/extras.ts).
  • Local bun test / typecheck could not be run in this environment (missing @opentui/solid preload and a broken @babel/traverse in the dep cache). Tests: test/kilocode/agent-config-metadata.test.ts (processConfigItem) and a convertOrganizationMode case in test/kilocode/modes-migrator.test.ts.

… of provider options

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Comment thread .changeset/agent-typed-metadata-fields.md Outdated
chrarnoldus and others added 2 commits June 29, 2026 08:36
…metadata-fields

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

kilo-code-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • packages/opencode/src/agent/agent.ts
  • packages/opencode/src/config/agent.ts
  • packages/opencode/src/kilocode/agent/index.ts
  • packages/opencode/src/kilocode/modes-migrator.ts
  • packages/opencode/test/kilocode/agent-config-metadata.test.ts
  • packages/opencode/test/kilocode/modes-migrator.test.ts
Previous Review Summary

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
.changeset/agent-typed-metadata-fields.md 5 Changeset text is too implementation-oriented for end-user release notes.

Fix these issues in Kilo Cloud

Files Reviewed (7 files)
  • .changeset/agent-typed-metadata-fields.md - 1 issue
  • packages/opencode/src/agent/agent.ts - 0 issues
  • packages/opencode/src/config/agent.ts - 0 issues
  • packages/opencode/src/kilocode/agent/index.ts - 0 issues
  • packages/opencode/src/kilocode/modes-migrator.ts - 0 issues
  • packages/opencode/test/kilocode/agent-config-metadata.test.ts - 0 issues
  • packages/opencode/test/kilocode/modes-migrator.test.ts - 0 issues

Reviewed by gpt-5.4-20260305 · Input: 87K · Output: 10.3K · Cached: 586.8K

Review guidance: REVIEW.md from base branch main

@chrarnoldus chrarnoldus merged commit cbd22a3 into main Jun 29, 2026
25 checks passed
@chrarnoldus chrarnoldus deleted the refactor/agent-typed-metadata-fields branch June 29, 2026 11:58
vkeerthivikram pushed a commit to vkeerthivikram/kilocode that referenced this pull request Jun 30, 2026
…metadata-fields

refactor(cli): carry agent displayName/source as typed fields instead of provider options
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