fix(core): clarify user-executed shell history (#37515)
Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com>
This commit is contained in:
co-authored by
Aiden Cline
parent
bd79e24842
commit
9b3a4655f1
@@ -206,7 +206,7 @@ function toLLMMessage(message: SessionMessage.Info, model: ModelV2.Ref, provider
|
|||||||
Message.make({
|
Message.make({
|
||||||
id: message.id,
|
id: message.id,
|
||||||
role: "user",
|
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,
|
metadata: message.metadata,
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -124,7 +124,12 @@ describe("toLLMMessages", () => {
|
|||||||
)
|
)
|
||||||
expect(messages.slice(2).map((message) => message.content)).toEqual([
|
expect(messages.slice(2).map((message) => message.content)).toEqual([
|
||||||
[{ type: "text", text: "Synthetic context" }],
|
[{ 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",
|
type: "text",
|
||||||
|
|||||||
Reference in New Issue
Block a user