fix: send system instructions in Devin's dedicated prompt field

This commit is contained in:
Kashyab Ambarani
2026-09-22 15:38:37 -07:00
parent f42b776b8e
commit 3b40b4020d
5 changed files with 188 additions and 51 deletions
+7 -3
View File
@@ -18,8 +18,8 @@ test("preserves the prompt and tools from a normalized transcript", () => {
messages: [{ role: "user", content: "Read README", timestamp: 1 }],
});
assert.deepEqual(mapContextToChat(context), {
systemPrompt: "Inspect the repository.",
messages: [
{ role: "system", content: "Inspect the repository." },
{ role: "user", content: "Read README" },
],
tools: [read],
@@ -36,8 +36,8 @@ test("applies later instruction, section, and tool changes", () => {
],
};
assert.deepEqual(mapContextToChat(context), {
systemPrompt: "Inspect the repository.\n\nUse bash.\n\nDo not edit.",
messages: [
{ role: "system", content: "Inspect the repository.\n\nUse bash.\n\nDo not edit." },
{ role: "user", content: "Continue" },
],
tools: [bash],
@@ -45,5 +45,9 @@ test("applies later instruction, section, and tool changes", () => {
});
test("accepts an empty transcript", () => {
assert.deepEqual(mapContextToChat(normalizeContext({ messages: [] })), { messages: [], tools: [] });
assert.deepEqual(mapContextToChat(normalizeContext({ messages: [] })), {
systemPrompt: undefined,
messages: [],
tools: [],
});
});