Skip to content

Commit f092baf

Browse files
authored
tweak: remove steering wrapper that can bust cache (#33039)
1 parent 3f1fffe commit f092baf

2 files changed

Lines changed: 3 additions & 19 deletions

File tree

packages/opencode/src/session/prompt.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,24 +1304,6 @@ export const layer = Layer.effect(
13041304
if (step === 1)
13051305
yield* summary.summarize({ sessionID, messageID: lastUser.id }).pipe(Effect.ignore, Effect.forkIn(scope))
13061306

1307-
if (step > 1 && lastFinished) {
1308-
for (const m of msgs) {
1309-
if (m.info.role !== "user" || m.info.id <= lastFinished.id) continue
1310-
for (const p of m.parts) {
1311-
if (p.type !== "text" || p.ignored || p.synthetic) continue
1312-
if (!p.text.trim()) continue
1313-
p.text = [
1314-
"<system-reminder>",
1315-
"The user sent the following message:",
1316-
p.text,
1317-
"",
1318-
"Please address this message and continue with your tasks.",
1319-
"</system-reminder>",
1320-
].join("\n")
1321-
}
1322-
}
1323-
}
1324-
13251307
yield* plugin.trigger("experimental.chat.messages.transform", {}, { messages: msgs })
13261308

13271309
const [skills, env, instructions, modelMsgs] = yield* Effect.all([

packages/opencode/test/session/prompt.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,9 @@ it.instance(
13461346

13471347
const inputs = yield* llm.inputs
13481348
expect(inputs).toHaveLength(2)
1349-
expect(JSON.stringify(inputs.at(-1)?.messages)).toContain("second")
1349+
const messages = inputs.at(-1)?.messages
1350+
if (!Array.isArray(messages)) throw new Error("expected LLM messages")
1351+
expect(messages.at(-1)).toEqual({ role: "user", content: "second" })
13501352
}),
13511353
3_000,
13521354
)

0 commit comments

Comments
 (0)