Skip to content

Commit 78c2ad2

Browse files
committed
docs(code): add progress tracking instructions to plan.devin
Add detailed instructions for documenting reasoning processes in `<THOUGHT>` tags, including progress tracking symbols (`✓`, `!`, `*`) for tasks and sub-tasks. Also, update Kotlin files to improve file handling and UI feedback.
1 parent bcbe6bc commit 78c2ad2

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/CodeHighlightSketch.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ private fun CodeHighlightSketch.processWriteCommand(currentText: String) {
342342
val file = ScratchRootType.getInstance()
343343
.createScratchFile(project, newFileName, language, currentText)
344344

345-
if (file == null) {
346-
return@addActionListener
347-
}
345+
this.text = "Written to $newFileName"
346+
347+
if (file == null) return@addActionListener
348348

349349
val psiFile = PsiManager.getInstance(project).findFile(file)!!
350350

core/src/main/resources/genius/en/code/plan.devin

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ Here is the rule you should follow:
5858
If `<user.question>` directly contradicts any of these steps, follow the instructions from `<user.question>`
5959
first. Be thorough in your thinking process, so it's okay if it is lengthy.
6060

61+
For each step, document your reasoning process inside `<THOUGHT>` tags. Include the following information, enclosed within XML tags:
62+
63+
1. `<PLAN>`: An updated plan incorporating the outcomes from the previous step. Mark progress by adding `✓` after each task in the plan that was fully completed before this step during the **current session**. Use the symbol `!` for tasks that have a latest status as failed, and use `*` for tasks that are currently in progress. If there are sub-tasks, mark their progress statuses as well. Ensure all progress statuses are marked accurately and appropriately reflect the hierarchical relationships of statuses between tasks and sub-tasks. For example, if all sub-tasks are completed, the parent task should also be marked as completed.
64+
6165
For example:
6266

6367
<THOUGHT>

core/src/main/resources/genius/zh/code/plan.devin

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,16 @@ Here is the rule you should follow:
5858
If `<user.question>` directly contradicts any of these steps, follow the instructions from `<user.question>`
5959
first. Be thorough in your thinking process, so it's okay if it is lengthy.
6060

61+
For each step, document your reasoning process inside `<THOUGHT>` tags. Include the following information, enclosed within XML tags:
62+
63+
1. `<PLAN>`: An updated plan incorporating the outcomes from the previous step. Mark progress by adding `✓` after each task in the plan that was fully completed before this step during the **current session**. Use the symbol `!` for tasks that have a latest status as failed, and use `*` for tasks that are currently in progress. If there are sub-tasks, mark their progress statuses as well. Ensure all progress statuses are marked accurately and appropriately reflect the hierarchical relationships of statuses between tasks and sub-tasks. For example, if all sub-tasks are completed, the parent task should also be marked as completed.
64+
65+
6166
For example:
6267

6368
<THOUGHT>
6469
<PLAN>
65-
Some plan
70+
1.
6671
</PLAN>
6772
</THOUGHT>
6873

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/WriteInsCommand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WriteInsCommand(val myProject: Project, val argument: String, val content:
3737
return writeToFile(filepath, projectDir)
3838
}
3939

40-
val psiFile = PsiManager.getInstance(myProject).findFile(virtualFile)
40+
val psiFile = runReadAction { PsiManager.getInstance(myProject).findFile(virtualFile) }
4141
?: return "$DEVINS_ERROR: File not found: $argument"
4242

4343
var output: String? = null

0 commit comments

Comments
 (0)