Skip to content

Fix agent list settings schema#189

Open
danielrobbins wants to merge 2 commits into
ggml-org:masterfrom
danielrobbins:fix/agent-settings-schema
Open

Fix agent list settings schema#189
danielrobbins wants to merge 2 commits into
ggml-org:masterfrom
danielrobbins:fix/agent-settings-schema

Conversation

@danielrobbins
Copy link
Copy Markdown

Summary

This PR fixes a schema/runtime mismatch in llama-vscode.agents_list.

The extension settings schema treated system_instruction as the required field, while the runtime configuration loader expected the canonical camelCase field systemInstruction. In practice, that produced false validation errors for valid agent settings and made the settings experience inconsistent.

What changed

  • Correct the llama-vscode.agents_list schema so it matches the runtime shape
  • Treat systemInstruction as the canonical field
  • Accept legacy system_instruction input as a compatibility alias
  • Normalize loaded agent settings into the expected in-memory shape
  • Correct subagentEnabled to use a boolean schema value

Why this is needed

Before this change, valid camelCase agent settings could be flagged incorrectly by the schema even though the runtime expected that form. At the same time, older persisted settings using the snake_case key could still exist in user configs.

This PR removes that mismatch while preserving backward compatibility for existing user settings.

Compatibility

  • systemInstruction remains the canonical settings key
  • legacy system_instruction is still accepted on read
  • the loader normalizes values after reading settings rather than rewriting user configuration

Scope

This PR is intended to be a focused settings/schema compatibility fix.

Note: this branch currently also includes the prerequisite shim cleanup from #187 so it compiles cleanly against current VS Code typings. That overlap is not logically part of the agent-settings fix itself.

Validation

  • Verified the touched files are clean
  • Verified the branch compiles cleanly in the current local build environment

The llama-vscode.agents_list schema defined the canonical property as systemInstruction but incorrectly required system_instruction. That produced false settings diagnostics for valid camelCase entries, while the runtime configuration loader still only consumed the camelCase field.

Fix the mismatch by correcting the schema, making subagentEnabled a boolean, and documenting system_instruction as a deprecated alias. In the configuration loader, normalize agents_list into the canonical in-memory Agent shape while accepting both systemInstruction and legacy system_instruction inputs.

Accepting both syntaxes is the safer compatibility path: it removes the bogus validation error for current settings without breaking existing user configs that already persisted the legacy snake_case key. The loader does not rewrite user settings; it only canonicalizes the data after reading it.
conflicts with current @types/vscode declarations.

The original shim was added when llama-vscode needed to supply its own
temporary LM chat-provider typings. That is no longer necessary because
current @types/vscode releases already include the relevant language
model chat APIs.

Leaving the old shim in place causes duplicate declaration errors during
TypeScript compilation. Properties such as modelOptions, tools,
maxInputTokens, maxOutputTokens, and LanguageModelResponsePart are now
defined both by @types/vscode and by the local shim, which breaks the
build even though the runtime code itself is otherwise valid.

This change removes the dead shim file entirely and keeps one small
provider typing cleanup in llama-chat-model-provider.ts so the current
tool metadata mapping aligns with the upstream VS Code types.

After this cleanup, the repo compiles cleanly against the installed
@types/vscode package without relying on duplicate local declarations.

This cleanup is also required for the separate VS Code tool
serialization fix to build cleanly. Without removing the obsolete shim,
that branch still fails compilation on current @types/vscode before its
behavioral changes can be validated in a normal TypeScript build.
@danielrobbins danielrobbins changed the title Fix/agent list settings schema Fix agent list settings schema May 17, 2026
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.

1 participant