mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: surface template README to agent template tools (#26334)
Fixes CODAGT-447. Alternative implementation of https://github.com/coder/coder/pull/26212 and https://github.com/coder/coder/pull/25978 - Adds up to the first 1000 characters of `README.md` (with leading frontmatter stripped) to `chattool.list_templates` output - Adds up to 800 characters of `README.md` to `chattool.read_template`. **Note:** skipping `toolsdk` versions to keep scope small. > 🤖 Generated by Coder Agents
This commit is contained in:
@@ -124,9 +124,9 @@ immediately with no provisioning delay.
|
||||
|
||||
## Optimize your templates
|
||||
|
||||
The agent selects templates based on their **name and description** — it does
|
||||
not read Terraform. Clear, specific descriptions are the most important factor
|
||||
in whether the agent picks the right template.
|
||||
The agent selects templates based on their **name, description, and README**.
|
||||
It does not read Terraform. Clear, specific descriptions are the most important
|
||||
factor in whether the agent picks the right template.
|
||||
|
||||
Update your template descriptions to include:
|
||||
|
||||
@@ -134,6 +134,15 @@ Update your template descriptions to include:
|
||||
- Which repository or service it is for, if applicable.
|
||||
- What type of work it supports (backend, frontend, data pipeline, etc.).
|
||||
|
||||
When 128 characters is not enough, put the most important routing context near
|
||||
the top of the template's
|
||||
[`README.md`](./platform-controls/template-optimization.md#put-routing-context-near-the-top-of-the-readme).
|
||||
The chat agent's template listing includes a bounded README excerpt (roughly the
|
||||
first 1,000 characters), and template detail includes the README (up to roughly
|
||||
8,000 characters). Both are reduced to plain text: frontmatter is stripped,
|
||||
link text is kept while link URLs are dropped, images and badges are dropped
|
||||
entirely, and code blocks and tables are preserved as text.
|
||||
|
||||
**Good examples:**
|
||||
|
||||
| Description | Why it works |
|
||||
|
||||
Reference in New Issue
Block a user