Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1678.
What changed
llm templatesshowed 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 pingpt-4o?" or "which ones need tools?" meant runningllm templates showon 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:
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 listpath throughtemplate_list_markers(); the template object was already loaded intemplates_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 exactlyone : template one, so the markers cannot leak into existing listings.The first fails without the change; both pass with it. The existing
test_templates_listandtest_templates_list_no_templates_foundare untouched and still pass.→
48 passed.ruff checkandblack --checkare clean.Note on the alternatives in the issue
The issue also floated a
--verboseflag and a separatellm templates --json. I went with the always-on markers because they are small enough to read at a glance and keeplistuseful without a flag; happy to gate them behind--verboseinstead if you would rather keep the default output stable.