Skip to content

fix(agent-manager): support llama.cpp tool schema - #12946

Merged
chrarnoldus merged 3 commits into
mainfrom
fix/agent-manager-llamacpp-schema
Aug 6, 2026
Merged

fix(agent-manager): support llama.cpp tool schema#12946
chrarnoldus merged 3 commits into
mainfrom
fix/agent-manager-llamacpp-schema

Conversation

@chrarnoldus

Copy link
Copy Markdown
Collaborator

The Agent Manager advertises a prefix-only ^ses pattern for sessionID. llama.cpp rejects that tool schema before inference because it requires patterns to be fully anchored.

Expose sessionID as a plain string only in the model-facing wire schema while retaining the branded SessionID constraint in the local execution schema. This keeps validation intact without applying provider-wide schema rewriting.

Related to #12773.

@chrarnoldus chrarnoldus self-assigned this Aug 6, 2026
Comment thread packages/opencode/src/kilocode/tool/agent-manager.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The previous suggestion (retain the session ID format hint in the wire schema) was addressed in e7a3ca1a: the description now notes that IDs start with ses_, the test asserts the new wording, and the wire schema still exposes sessionID as a plain string with no pattern, so llama.cpp compatibility is retained. The incremental change is string-only — no logic, security, or memory-leak surface.

Files Reviewed (2 files)
  • packages/opencode/src/kilocode/tool/agent-manager.ts
  • packages/opencode/test/kilocode/agent-manager-tool.test.ts
Previous Review Summary (commit 24da90f)

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

Previous review (commit 24da90f)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

SUGGESTION

File Line Issue
packages/opencode/src/kilocode/tool/agent-manager.ts 120 Wire schema lost the session ID format hint; consider noting the ses_ prefix in the description

The fix is correct and minimal: the wire schema drops the prefix-only ^ses pattern that llama.cpp rejects, while local execution still decodes against Params (verified in Tool.define, which validates via Schema.decodeUnknownEffect(toolInfo.parameters)), so SessionID validation remains enforced. The new tests cover both the absence of pattern in the wire schema and retained local validation. Changeset is present and user-facing. No memory-leak surface introduced.

Files Reviewed (3 files)
  • .changeset/friendly-llamas-manage.md
  • packages/opencode/src/kilocode/tool/agent-manager.ts - 1 issue
  • packages/opencode/test/kilocode/agent-manager-tool.test.ts

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 46K · Output: 4.1K · Cached: 244.7K

Review guidance: REVIEW.md from base branch main

@chrarnoldus
chrarnoldus merged commit e5ae384 into main Aug 6, 2026
30 checks passed
@chrarnoldus
chrarnoldus deleted the fix/agent-manager-llamacpp-schema branch August 6, 2026 13:33
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…macpp-schema

fix(agent-manager): support llama.cpp tool schema
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.

OpenAI-compatible llama.cpp server fails with "Pattern must start with '^' and end with '$'" while direct API requests succeed

2 participants