|
@@ -92,6 +92,7 @@ export namespace SessionCompaction {
|
|
|
providerID: string
|
|
providerID: string
|
|
|
modelID: string
|
|
modelID: string
|
|
|
}
|
|
}
|
|
|
|
|
+ agent: string
|
|
|
abort: AbortSignal
|
|
abort: AbortSignal
|
|
|
}) {
|
|
}) {
|
|
|
const model = await Provider.getModel(input.model.providerID, input.model.modelID)
|
|
const model = await Provider.getModel(input.model.providerID, input.model.modelID)
|
|
@@ -101,7 +102,7 @@ export namespace SessionCompaction {
|
|
|
role: "assistant",
|
|
role: "assistant",
|
|
|
parentID: input.parentID,
|
|
parentID: input.parentID,
|
|
|
sessionID: input.sessionID,
|
|
sessionID: input.sessionID,
|
|
|
- mode: "build",
|
|
|
|
|
|
|
+ mode: input.agent,
|
|
|
summary: true,
|
|
summary: true,
|
|
|
path: {
|
|
path: {
|
|
|
cwd: Instance.directory,
|
|
cwd: Instance.directory,
|
|
@@ -199,7 +200,7 @@ export namespace SessionCompaction {
|
|
|
time: {
|
|
time: {
|
|
|
created: Date.now(),
|
|
created: Date.now(),
|
|
|
},
|
|
},
|
|
|
- agent: "build",
|
|
|
|
|
|
|
+ agent: input.agent,
|
|
|
model: input.model,
|
|
model: input.model,
|
|
|
})
|
|
})
|
|
|
await Session.updatePart({
|
|
await Session.updatePart({
|
|
@@ -222,6 +223,7 @@ export namespace SessionCompaction {
|
|
|
export const create = fn(
|
|
export const create = fn(
|
|
|
z.object({
|
|
z.object({
|
|
|
sessionID: Identifier.schema("session"),
|
|
sessionID: Identifier.schema("session"),
|
|
|
|
|
+ agent: z.string(),
|
|
|
model: z.object({
|
|
model: z.object({
|
|
|
providerID: z.string(),
|
|
providerID: z.string(),
|
|
|
modelID: z.string(),
|
|
modelID: z.string(),
|
|
@@ -233,7 +235,7 @@ export namespace SessionCompaction {
|
|
|
role: "user",
|
|
role: "user",
|
|
|
model: input.model,
|
|
model: input.model,
|
|
|
sessionID: input.sessionID,
|
|
sessionID: input.sessionID,
|
|
|
- agent: "build",
|
|
|
|
|
|
|
+ agent: input.agent,
|
|
|
time: {
|
|
time: {
|
|
|
created: Date.now(),
|
|
created: Date.now(),
|
|
|
},
|
|
},
|