Skip to content

Show pinned model, schema and tools in llm templates - #1687

Open
eren-YU wants to merge 1 commit into
simonw:mainfrom
eren-YU:feat/templates-list-markers
Open

eren-YU wants to merge 1 commit into
simonw:mainfrom
eren-YU:feat/templates-list-markers

Conversation

@eren-YU

@eren-YU eren-YU commented Sep 16, 2026

Copy link
Copy Markdown

Closes #1678.

What changed

llm templates showed only the name and prompt text, so the things a template can pin — model, schema_object, tools, functions, fragments — were invisible from the listing. Answering "which of my templates pin gpt-4o?" or "which ones need tools?" meant running llm templates show on each one, and after a plugin upgrade the templates pinning a specific model are exactly the ones that need attention.

The listing now appends a compact marker suffix, only for the fields a template actually sets:

cmd    : system: reply with macos terminal commands only, no extra information
dog    : invent a dog [schema]
frag   : with fragments [fragments: 2]
report : system: Write a QA report [model: gpt-4o] [tools: llm_time, search]

Markers are omitted when the corresponding field is unset, so a prompt-only template's line is byte-identical to before.

This reaches the templates list path through template_list_markers(); the template object was already loaded in templates_list(), so there is no extra loading or I/O.

How I checked

Two tests added to tests/test_templates.py:

  • test_templates_list_markers — sets a pinned model, a schema, tools and fragments, and asserts the full listing output, including the fragment/query-free cases from the issue.
  • test_templates_list_markers_absent_for_simple_templates — asserts a prompt-only template still prints exactly one : template one, so the markers cannot leak into existing listings.

The first fails without the change; both pass with it. The existing test_templates_list and test_templates_list_no_templates_found are untouched and still pass.

uv run pytest tests/test_templates.py -q

48 passed. ruff check and black --check are clean.

Note on the alternatives in the issue

The issue also floated a --verbose flag and a separate llm templates --json. I went with the always-on markers because they are small enough to read at a glance and keep list useful without a flag; happy to gate them behind --verbose instead if you would rather keep the default output stable.

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.

llm templates listing should surface pinned model, schema and tools

1 participant