Pull requests / #987

#987 serve: /props reports chat_template_caps so Zed offers tools (#986)

closed · @1it · 0 コメント · GitHub で見る

Server & APIDocumentationWindowsLinux

本文

Fixes #986.

Zed's llama.cpp provider reads `GET /props` to decide whether a model supports tools. Strata already parses Qwen XML tool calls, but omitted `chat_template_caps`, so Zed showed **Tools Unsupported**.

`/props` now reports tools, tool-call history, multiple calls in one assistant turn, the system role, and reasoning preservation using llama.cpp's field names. Capabilities are computed when the active template loads, before concurrent HTTP requests arrive. History checks supply matching tool definitions and parse the probe calls separately from example calls in the instructions. Tool-call history must use Strata's XML format and retain tool results. Rejected or omitted features report `false`. Expected Jinja errors produce debug diagnostics; unexpected rendering errors surface. The bundled template reports all five capabilities as `true`.

The docs explain that `supports_preserve_reasoning` describes retaining older assistant `reasoning_content` in the prompt, and that these flags are compatibility hints. Regression coverage includes concurrent discovery requests, error diagnostics, and templates that omit or reject features, require matching tool definitions, support only one call, drop prior reasoning, or use incompatible JSON tool calls. Tests check required capability values while allowing additional keys.

Zed's generic OpenAI-compatible provider needs `"capabilities": {"tools": true, "chat_completions": true}` in its model settings; this is documented too.

Validation on Linux with Python 3.12, Jinja2 3.1.6, regex 2026.9.10, and the optional jsonschema 4.26.0 validator:

- `python -m unittest discover -s serve -t . -p 'test_*.py' -v`: 264 passed, 7 skipped (5 require a model tokenizer; 2 are Windows-only).
- All 10 cases in `serve/chat_golden.json` matched.
- Python compilation and `git diff --check` passed.

API validation used mock engines; a live Zed session and GPU inference were not exercised.

関連リンク

インストール・モデル・リリースへの站内リンク。