|
@@ -370,6 +370,7 @@ export namespace Session {
|
|
|
const l = log.clone().tag("session", input.sessionID)
|
|
const l = log.clone().tag("session", input.sessionID)
|
|
|
l.info("chatting")
|
|
l.info("chatting")
|
|
|
|
|
|
|
|
|
|
+ const inputMode = input.mode ?? "build"
|
|
|
const userMsg: MessageV2.Info = {
|
|
const userMsg: MessageV2.Info = {
|
|
|
id: input.messageID ?? Identifier.ascending("message"),
|
|
id: input.messageID ?? Identifier.ascending("message"),
|
|
|
role: "user",
|
|
role: "user",
|
|
@@ -494,7 +495,7 @@ export namespace Session {
|
|
|
]
|
|
]
|
|
|
}),
|
|
}),
|
|
|
).then((x) => x.flat())
|
|
).then((x) => x.flat())
|
|
|
- if (input.mode === "plan")
|
|
|
|
|
|
|
+ if (inputMode === "plan")
|
|
|
userParts.push({
|
|
userParts.push({
|
|
|
id: Identifier.ascending("part"),
|
|
id: Identifier.ascending("part"),
|
|
|
messageID: userMsg.id,
|
|
messageID: userMsg.id,
|
|
@@ -617,7 +618,7 @@ export namespace Session {
|
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const mode = await Mode.get(input.mode ?? "build")
|
|
|
|
|
|
|
+ const mode = await Mode.get(inputMode)
|
|
|
let system = input.providerID === "anthropic" ? [PROMPT_ANTHROPIC_SPOOF.trim()] : []
|
|
let system = input.providerID === "anthropic" ? [PROMPT_ANTHROPIC_SPOOF.trim()] : []
|
|
|
system.push(...(mode.prompt ? [mode.prompt] : SystemPrompt.provider(input.modelID)))
|
|
system.push(...(mode.prompt ? [mode.prompt] : SystemPrompt.provider(input.modelID)))
|
|
|
system.push(...(await SystemPrompt.environment()))
|
|
system.push(...(await SystemPrompt.environment()))
|
|
@@ -630,6 +631,7 @@ export namespace Session {
|
|
|
id: Identifier.ascending("message"),
|
|
id: Identifier.ascending("message"),
|
|
|
role: "assistant",
|
|
role: "assistant",
|
|
|
system,
|
|
system,
|
|
|
|
|
+ mode: inputMode,
|
|
|
path: {
|
|
path: {
|
|
|
cwd: app.path.cwd,
|
|
cwd: app.path.cwd,
|
|
|
root: app.path.root,
|
|
root: app.path.root,
|
|
@@ -1122,6 +1124,7 @@ export namespace Session {
|
|
|
role: "assistant",
|
|
role: "assistant",
|
|
|
sessionID: input.sessionID,
|
|
sessionID: input.sessionID,
|
|
|
system,
|
|
system,
|
|
|
|
|
+ mode: "build",
|
|
|
path: {
|
|
path: {
|
|
|
cwd: app.path.cwd,
|
|
cwd: app.path.cwd,
|
|
|
root: app.path.root,
|
|
root: app.path.root,
|