fix(core): place model prompt before project instructions (#46829)

This commit is contained in:
Aiden Cline 2026-09-02 10:42:50 -05:00 committed by GitHub
parent 429387d158
commit 79c789be89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -54,7 +54,7 @@ function make(
const prompt = getPrompt(`${model?.modelID ?? event.model.id} ${model?.family ?? ""}`.toLowerCase())
if (!prompt) return
if (options.operation === "append") {
event.system.push(SystemPart.make(prompt))
event.system.splice(1, 0, SystemPart.make(prompt))
return
}
event.system[0] = { ...system, text: prompt }

View file

@ -1590,8 +1590,8 @@ describe("SessionRunnerLLM", () => {
expect(s.requests.at(-1)?.system.map((part) => part.text)).toEqual([
defaultSystem,
"Initial context",
expect.stringContaining("# Delegation"),
"Initial context",
])
})
@ -1611,8 +1611,8 @@ describe("SessionRunnerLLM", () => {
expect(s.requests.at(-1)?.system.map((part) => part.text)).toEqual([
defaultSystem,
"Initial context",
expect.stringContaining("# Delegation"),
"Initial context",
])
})