소스 검색

fix(core): clarify user-executed shell history (#37515)

Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com>
opencode-agent[bot] 4 주 전
부모
커밋
9b3a4655f1
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      packages/core/src/session/runner/to-llm-message.ts
  2. 6 1
      packages/core/test/session-runner-message.test.ts

+ 1 - 1
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,
         }),
       ]

+ 6 - 1
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",