Skip to content

Fix Prompt Prepare #57

@djthorpe

Description

@djthorpe

Prompt.Prepare() is a stub — local prompt execution is dead

File: pkg/toolkit/prompt/prepare.go
Status: Returns ErrNotImplemented unconditionally
Impact: All markdown-defined prompts (YAML frontmatter + template body) fail at runtime. MCP GetPrompt RPC is also broken.
Fix: Follow the pattern in pkg/agent/prepare.go — validate input JSON against p.m.Input schema, execute p.m.Template as a text/template with the input data, return rendered string + opt.Opt values from GeneratorMeta (model, system prompt, format, thinking, etc.)

Agent template function map is minimal

File: pkg/agent/funcmap.go — only 6 functions
Add: toJSON/toYAML, indent/nindent, contains, hasPrefix/hasSuffix, replace, split, keys/values, now, dateFormat, urlEncode

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions