summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlcan <[email protected]>2025-05-17 20:14:06 -0700
committerGitHub <[email protected]>2025-05-17 20:14:06 -0700
commit9749fcb4256b87a47480ea77ff25f07aa0c4ce45 (patch)
treebf8be1a1df1e818364f2cbeb19d3bf4032b5dd71
parent3bf0304e313afb2e06064538ac05376ae0c5e31a (diff)
ability to write system prompt to file (#414)
-rw-r--r--packages/server/src/core/prompts.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/server/src/core/prompts.ts b/packages/server/src/core/prompts.ts
index dabd77a1..4bf571a2 100644
--- a/packages/server/src/core/prompts.ts
+++ b/packages/server/src/core/prompts.ts
@@ -198,6 +198,11 @@ assistant: I can run \`rm -rf ./temp\`. This will permanently delete the directo
Your core function is efficient and safe assistance. Balance extreme conciseness with the crucial need for clarity, especially regarding safety and potential system modifications. Always prioritize user control and project conventions. Never make assumptions on the contents of files; instead use '${ReadFileTool.Name}' or '${ReadManyFilesTool.Name}' to ensure you aren't making broad assumptions. Finally, you are an agent - please keep going until the user's query is completely resolved.
`;
+ // if GEMINI_WRITE_SYSTEM_MD is set, write base prompt to systemMdPath
+ if (process.env.GEMINI_WRITE_SYSTEM_MD) {
+ fs.writeFileSync(systemMdPath, basePrompt);
+ }
+
const memorySuffix =
userMemory && userMemory.trim().length > 0
? `\n\n---\n\n${userMemory.trim()}`