Skip to content

Commit 07dacbe

Browse files
committed
Add support for plan mode
1 parent e0bf499 commit 07dacbe

File tree

8 files changed

+21
-10
lines changed

8 files changed

+21
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Replace `chat` behavior with `plan`.
6+
57
## 0.17.2
68

79
- fix query context refactor

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Client editors can pass custom settings when sending the `initialize` request vi
1111

1212
```javascript
1313
"initializationOptions": {
14-
"chatBehavior": "chat"
14+
"chatBehavior": "agent"
1515
}
1616
```
1717

@@ -20,7 +20,7 @@ Client editors can pass custom settings when sending the `initialize` request vi
2020
`.eca/config.json`
2121
```javascript
2222
{
23-
"chatBehavior": "chat"
23+
"chatBehavior": "agent"
2424
}
2525
```
2626

@@ -29,7 +29,7 @@ Client editors can pass custom settings when sending the `initialize` request vi
2929
`~/.config/eca/config.json`
3030
```javascript
3131
{
32-
"chatBehavior": "chat"
32+
"chatBehavior": "agent"
3333
}
3434
```
3535

resources/META-INF/native-image/eca/eca/native-image.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ Args=-J-Dborkdude.dynaload.aot=true \
88
-H:-CheckToolchain \
99
-H:Log=registerResource: \
1010
-H:IncludeResources=ECA_VERSION \
11-
-H:IncludeResources=eca_prompt.txt
11+
-H:IncludeResources=prompts/eca_base.txt \
12+
-H:IncludeResources=prompts/plan_behavior.txt \
13+
-H:IncludeResources=prompts/agent_behavior.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You are an agent - please keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. Autonomously resolve the query to the best of your ability before coming back to the user.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Plan mode is active. The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supersedes any other instructions you have received (for example, to make edits).

src/eca/db.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:workspace-folders []
1010
:client-capabilities {}
1111
:chats {}
12-
:chat-behaviors ["agent" "chat"]
12+
:chat-behaviors ["agent" "plan"]
1313
:chat-default-behavior "agent"
1414
:models {"o4-mini" {:tools true
1515
:web-search false

src/eca/features/prompt.clj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,25 @@
1212

1313
(def ^:private logger-tag "[PROMPT]")
1414

15-
(defn ^:private eca-prompt-template* [] (slurp (io/resource "eca_prompt.txt")))
15+
(defn ^:private base-prompt-template* [] (slurp (io/resource "prompts/eca_base.txt")))
16+
(def ^:private base-prompt-template (memoize base-prompt-template*))
1617

17-
(def ^:private eca-prompt-template (memoize eca-prompt-template*))
18+
(defn ^:private plan-behavior* [] (slurp (io/resource "prompts/plan_behavior.txt")))
19+
(def ^:private plan-behavior (memoize plan-behavior*))
20+
21+
(defn ^:private agent-behavior* [] (slurp (io/resource "prompts/agent_behavior.txt")))
22+
(def ^:private agent-behavior (memoize agent-behavior*))
1823

1924
(defn ^:private eca-prompt [behavior config]
2025
(let [prompt (or (:systemPromptTemplate config)
21-
(eca-prompt-template))]
26+
(base-prompt-template))]
2227
(reduce
2328
(fn [p [k v]]
2429
(string/replace p (str "{" (name k) "}") v))
2530
prompt
2631
{:behavior (case behavior
27-
"chat" "Answer questions, and provide explanations."
28-
"agent" "You are an agent - please keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved. Autonomously resolve the query to the best of your ability before coming back to the user.")})))
32+
"plan" (plan-behavior)
33+
"agent" (agent-behavior))})))
2934

3035
(defn build-instructions [refined-contexts rules repo-map* behavior config]
3136
(multi-str

0 commit comments

Comments
 (0)