fix(server): treat a template-only ledger as a readable in-scope document

A missing ledger body was reported as not found, so an in-scope view of a template document never reached the template reply.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-21 09:37:39 +00:00
co-authored by Cursor
parent 776e069e2f
commit 0272d13574
+1 -1
View File
@@ -157,7 +157,7 @@ func (s *Server) loadControlledDocumentContent(ctx context.Context, docID string
if err != nil && !errors.Is(err, docquery.ErrLedgerMissing) {
return nil, err
}
if view != nil && view.Markdown != "" {
if view != nil && (view.Markdown != "" || view.IsTemplateOnly) {
return view.ToDocumentContent(), nil
}
return s.gov.ReadDocumentContent(ctx, docID, s.repoRoot())