-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Description
I played around with this tool and added a system prompt pointing to a file systempromp.md.
I started the tool and everything "looked fine".
Until I realized, the system prompt wasn't really used.
The problem?
I had a typo in systempromp.md (spot the missing t 😉 ).
The file name is actually systemprompt.md
The "problem" is here:
mcphost/internal/config/config.go
Lines 249 to 266 in 4891f87
| func LoadSystemPrompt(input string) (string, error) { | |
| if input == "" { | |
| return "", nil | |
| } | |
| // Check if input is a file that exists | |
| if _, err := os.Stat(input); err == nil { | |
| // Read the entire file as plain text | |
| content, err := os.ReadFile(input) | |
| if err != nil { | |
| return "", fmt.Errorf("error reading system prompt file: %v", err) | |
| } | |
| return strings.TrimSpace(string(content)), nil | |
| } | |
| // Treat as direct string | |
| return input, nil | |
| } |
If os.Stat() returns an error, the tool assumes the input as text.
So the system prompt end up as systempromp.md 🫣 instead of the content of the correct file.
I'm not sure how to handle it better?
Maybe like curl, that requires a @ followed by the file path?
Or different options? system-prompt and system-prompt-file
💭
Metadata
Metadata
Assignees
Labels
No labels