diff --git a/packages/core/src/session/runner/to-llm-message.ts b/packages/core/src/session/runner/to-llm-message.ts index db3ce25fe1a1..e91eef2c28a7 100644 --- a/packages/core/src/session/runner/to-llm-message.ts +++ b/packages/core/src/session/runner/to-llm-message.ts @@ -206,7 +206,7 @@ function toLLMMessage(message: SessionMessage.Info, model: ModelV2.Ref, provider Message.make({ id: message.id, role: "user", - content: `Shell command: ${message.command}\n\n${message.output?.output ?? ""}`, + content: `The following shell command was executed by the user:\n\nCommand:\n${message.command}\n\nOutput:\n${message.output?.output ?? ""}`, metadata: message.metadata, }), ] diff --git a/packages/core/test/session-runner-message.test.ts b/packages/core/test/session-runner-message.test.ts index 8ddec2fae8e3..fe70ac5943a5 100644 --- a/packages/core/test/session-runner-message.test.ts +++ b/packages/core/test/session-runner-message.test.ts @@ -124,7 +124,12 @@ describe("toLLMMessages", () => { ) expect(messages.slice(2).map((message) => message.content)).toEqual([ [{ type: "text", text: "Synthetic context" }], - [{ type: "text", text: "Shell command: pwd\n\n/project" }], + [ + { + type: "text", + text: "The following shell command was executed by the user:\n\nCommand:\npwd\n\nOutput:\n/project", + }, + ], [ { type: "text",