Repository navigation
fix: persist the template description sent to PUT /templates/{id} - #735
Merged
marcvergees merged 2 commits intoOct 24, 2026
Merged
marcvergees merged 2 commits into
marcvergees merged 2 commits into
Conversation
TemplateUpdate accepted only name and fields, so a description in the PUT body was ignored. The Studio description editor and the fill prompt could never pick up a corrected description after create. Accept description on update the same way as name, and assert it in the update and update-then-fill API tests.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Description
PUT /api/v1/templates/{id}is a partial update: only the keys sent are changed.TemplateResponsereturns adescription, andTemplateCreateaccepts one, butTemplateUpdateonly hadnameandfields. Pydantic ignores extras, so:returns 200 with the old description unchanged.
That leaves the description frozen after create:
templateDescription/descriptionEditedin fireform-frontend) has no backend field to send.updateTemplateonly typesnameandfields.FormService.fill_and_persistpassestemplate.descriptionto the filler, so a wrong or empty description stays in the<template_description>block (feat: add template description to guide LLM form filling (#510) #703 / Add general description to each form template to enhance LLM output #510) until the template is deleted and recreated.This accepts
descriptiononTemplateUpdateand writes it when it is sent, the same way asname. A name-only PUT still leaves the description alone.Independent of #734 (create). That PR only changes
create_template; this one changesTemplateUpdateandupdate_template. They share no hunks.Type of change
How Has This Been Tested?
Repro on
development(5e79f14) with the same in-memory SQLite setup the tests use. Insert a template whose description is"Original radio plan", then:With the change both return the updated description. A name-only PUT still keeps
"Original radio plan".test_update_template_description: PUT with onlydescriptionupdates it and leaves name/fields alone. Fails ondevelopment(assert 'Original radio plan' == 'Updated ICS 205 radio plan').test_update_keeps_description_when_omitted: a name-only PUT must not clear the description.test_fill_form_uses_description_from_update: PUT a description, fill the form, and check the filler gets that text. Fails ondevelopment(assert '' == 'Incident radio communications plan').All three fail on
developmentand pass with the change.python -m pytest tests/→ 305 passed.ruff check app/→ All checks passed.Test Configuration:
Checklist: