|
39 | 39 | s |
40 | 40 | vars)) |
41 | 41 |
|
42 | | -(defn ^:private eca-chat-prompt [behavior config db] |
| 42 | +(defn ^:private eca-chat-prompt [behavior config] |
43 | 43 | (let [behavior-config (get-in config [:behavior behavior]) |
44 | 44 | ;; Use systemPromptFile from behavior config, or fall back to built-in |
45 | 45 | prompt-file (or (:systemPromptFile behavior-config) |
46 | 46 | ;; For built-in behaviors without explicit config |
47 | 47 | (when (#{"agent" "plan"} behavior) |
48 | 48 | (str "prompts/" behavior "_behavior.md")))] |
49 | | - (replace-vars |
50 | | - (cond |
51 | | - ;; Custom behavior with absolute path |
52 | | - (and prompt-file (string/starts-with? prompt-file "/")) |
53 | | - (slurp prompt-file) |
| 49 | + (cond |
| 50 | + ;; Custom behavior with absolute path |
| 51 | + (and prompt-file (string/starts-with? prompt-file "/")) |
| 52 | + (slurp prompt-file) |
54 | 53 |
|
55 | | - ;; Built-in or resource path |
56 | | - prompt-file |
57 | | - (load-builtin-prompt (some-> prompt-file (string/replace-first #"prompts/" ""))) |
| 54 | + ;; Built-in or resource path |
| 55 | + prompt-file |
| 56 | + (load-builtin-prompt (some-> prompt-file (string/replace-first #"prompts/" ""))) |
58 | 57 |
|
59 | | - ;; Fallback for unknown behavior |
60 | | - :else |
61 | | - (load-builtin-prompt "agent_behavior.md")) |
62 | | - {:workspaceRoots (shared/workspaces-as-str db)}))) |
| 58 | + ;; Fallback for unknown behavior |
| 59 | + :else |
| 60 | + (load-builtin-prompt "agent_behavior.md")))) |
63 | 61 |
|
64 | 62 | (defn contexts-str [refined-contexts repo-map*] |
65 | 63 | (multi-str |
|
91 | 89 |
|
92 | 90 | (defn build-chat-instructions [refined-contexts rules repo-map* behavior config db] |
93 | 91 | (multi-str |
94 | | - (eca-chat-prompt behavior config db) |
| 92 | + (eca-chat-prompt behavior config) |
95 | 93 | (when (seq rules) |
96 | 94 | ["<rules description=\"Rules defined by user\">\n" |
97 | 95 | (reduce |
|
102 | 100 | "</rules>"]) |
103 | 101 | "" |
104 | 102 | (when (seq refined-contexts) |
105 | | - [(contexts-str refined-contexts repo-map*)]))) |
| 103 | + [(contexts-str refined-contexts repo-map*)]) |
| 104 | + "" |
| 105 | + (replace-vars |
| 106 | + (load-builtin-prompt "additional_system_info.md") |
| 107 | + {:workspaceRoots (shared/workspaces-as-str db)}))) |
106 | 108 |
|
107 | 109 | (defn build-rewrite-instructions [text path full-text range config] |
108 | 110 | (let [prompt-file (-> config :rewrite :systemPromptFile) |
|
0 commit comments