Merge pull request #3986 from code-yeongyu/fix/continuation-message-dispatch
fix(continuation): mark resumed prompts synthetic
This commit is contained in:
@@ -30,17 +30,17 @@
|
|||||||
"zod": "^4.3.0",
|
"zod": "^4.3.0",
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"oh-my-opencode-darwin-arm64": "4.0.0",
|
"oh-my-opencode-darwin-arm64": "4.1.0",
|
||||||
"oh-my-opencode-darwin-x64": "4.0.0",
|
"oh-my-opencode-darwin-x64": "4.1.0",
|
||||||
"oh-my-opencode-darwin-x64-baseline": "4.0.0",
|
"oh-my-opencode-darwin-x64-baseline": "4.1.0",
|
||||||
"oh-my-opencode-linux-arm64": "4.0.0",
|
"oh-my-opencode-linux-arm64": "4.1.0",
|
||||||
"oh-my-opencode-linux-arm64-musl": "4.0.0",
|
"oh-my-opencode-linux-arm64-musl": "4.1.0",
|
||||||
"oh-my-opencode-linux-x64": "4.0.0",
|
"oh-my-opencode-linux-x64": "4.1.0",
|
||||||
"oh-my-opencode-linux-x64-baseline": "4.0.0",
|
"oh-my-opencode-linux-x64-baseline": "4.1.0",
|
||||||
"oh-my-opencode-linux-x64-musl": "4.0.0",
|
"oh-my-opencode-linux-x64-musl": "4.1.0",
|
||||||
"oh-my-opencode-linux-x64-musl-baseline": "4.0.0",
|
"oh-my-opencode-linux-x64-musl-baseline": "4.1.0",
|
||||||
"oh-my-opencode-windows-x64": "4.0.0",
|
"oh-my-opencode-windows-x64": "4.1.0",
|
||||||
"oh-my-opencode-windows-x64-baseline": "4.0.0",
|
"oh-my-opencode-windows-x64-baseline": "4.1.0",
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"zod": "^4.0.0",
|
"zod": "^4.0.0",
|
||||||
@@ -248,27 +248,27 @@
|
|||||||
|
|
||||||
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||||
|
|
||||||
"oh-my-opencode-darwin-arm64": ["oh-my-opencode-darwin-arm64@4.0.0", "", { "os": "darwin", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-t7b65Oucpa5RrbRrkc37xlUu4jWPh3WgxSi5yhJlXHf0HuUIzmw4Lb+3Z/0ZzdcC/0pbdiPNnE7zxAlcZVZscQ=="],
|
"oh-my-opencode-darwin-arm64": ["oh-my-opencode-darwin-arm64@4.1.0", "", { "os": "darwin", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-0GaAhgMLRdoftNs1OR0NCii6rhZUUSb5sURHWcVnlJ6Ndqcm1c9ftkPr6f6cDIg2F/vvjfxP14FULtEvAzLTMQ=="],
|
||||||
|
|
||||||
"oh-my-opencode-darwin-x64": ["oh-my-opencode-darwin-x64@4.0.0", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-KySGNCvz1yUBKR9euzFgRdlqmc5VnhPxNl6dbVbNrjBkoXjqdDgWK4+FuTjRnaoEH8I5qkpLenmDVYDWHUuxzA=="],
|
"oh-my-opencode-darwin-x64": ["oh-my-opencode-darwin-x64@4.1.0", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-4Zm/oX2OECaKFxYX8VPryfChFW8lem2q3Tn4sCrn7aE6AB8xWq6VCe9+O/mN3EW1Z1WJC/s8/yqwX6lit7Qsxw=="],
|
||||||
|
|
||||||
"oh-my-opencode-darwin-x64-baseline": ["oh-my-opencode-darwin-x64-baseline@4.0.0", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-BDzcEMxPCKD6/HIRBwCzQWUDgWLIXLjWazOVTYHb8ZsZS+UiFW9bPMs92Qj8NN8Nt1WzhTI91AxG1j+82MWdow=="],
|
"oh-my-opencode-darwin-x64-baseline": ["oh-my-opencode-darwin-x64-baseline@4.1.0", "", { "os": "darwin", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-VHC9Zh/fzIMmeVbHblaVictDUfiQGByY3KDC2rkojEazTFB9WYcSGIp6W9RhxA/fg1OCGYskDIbdhmmEz2KDLQ=="],
|
||||||
|
|
||||||
"oh-my-opencode-linux-arm64": ["oh-my-opencode-linux-arm64@4.0.0", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-9CRfdF6ZDtBjTw2R1u6K12GVaUkWOrSavQ1+r2oHR05qzXKuFB9fL7cX6XFC1nJ0sdrzbPS7Wb95NTNT57f3sQ=="],
|
"oh-my-opencode-linux-arm64": ["oh-my-opencode-linux-arm64@4.1.0", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-4ou8Z2J9dquzCBKIZQ/UnIRxqou7lU2yW9dYy1Soh4XwRKFqTXAEmGNRVr/2uKBIPxu4cm3sfw5ixhIPYly3Eg=="],
|
||||||
|
|
||||||
"oh-my-opencode-linux-arm64-musl": ["oh-my-opencode-linux-arm64-musl@4.0.0", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-DtASaFt42Q7cGWniR8zAiMy+Lw1LQa715HBA9IceuqX5V+T5zKB+CdjAw+/TH2RSDe05sp0Jvr8sCgSxPvH6hg=="],
|
"oh-my-opencode-linux-arm64-musl": ["oh-my-opencode-linux-arm64-musl@4.1.0", "", { "os": "linux", "cpu": "arm64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-NG2x8CMOP6E0UAAuJhWwfsr4rmQuXNkp4sOHftfeiq0IcecNuj10zkb73TkNhGrKJg5CXnuqMpew1p80KuEl7w=="],
|
||||||
|
|
||||||
"oh-my-opencode-linux-x64": ["oh-my-opencode-linux-x64@4.0.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-CNkI+nMK5tk94cDXSe9y5MZNTI/sSof2qGy69pUZz9kG6NMqXx6QeqCx36J66xacW3Oxa7Pvvcu+7heaNpL9Bw=="],
|
"oh-my-opencode-linux-x64": ["oh-my-opencode-linux-x64@4.1.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-8ljrAKgweTc1XrdkSR+UluYasb8flJTVBfqyamKTVRc7I8tIskkrp43/QSLCjJRT6v7Ejx1PYe9MOGDPQBrlMQ=="],
|
||||||
|
|
||||||
"oh-my-opencode-linux-x64-baseline": ["oh-my-opencode-linux-x64-baseline@4.0.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-rFpWgevtWNdflrTjcsFXUuELwKZGY6jOJ0HaXm1WZ406gswXfqR8VEUlrUYps6toycstZsdPuQXGSgbD8SfYKQ=="],
|
"oh-my-opencode-linux-x64-baseline": ["oh-my-opencode-linux-x64-baseline@4.1.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-oPPHWAUiYvoykozC3JQl91PGilY7bN0GCdTN+Dq+oj8cdLnfXjULwtdUm9y3gpN9yWy9d/IB7McvM2pFCKy6Bw=="],
|
||||||
|
|
||||||
"oh-my-opencode-linux-x64-musl": ["oh-my-opencode-linux-x64-musl@4.0.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-hyCZ9GCi2RiqI1gqH9S8VZPqDz+c0EUT6ne1spTZBMS6qseSPOIztn+ZoplBXAgsOvEGum45ydcYFjkvLaqNFA=="],
|
"oh-my-opencode-linux-x64-musl": ["oh-my-opencode-linux-x64-musl@4.1.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-FAiyeKOO+38B3XR0vb3MiBnCgEl9un42KClQ/3ggCPV4f5uMzu5tVa6rlPHMATxryl4uk6ysdFeWr4XXN3ci6A=="],
|
||||||
|
|
||||||
"oh-my-opencode-linux-x64-musl-baseline": ["oh-my-opencode-linux-x64-musl-baseline@4.0.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-u8w5WP5eGH0kUnQKHJFgVzQaf/sE6cOctIDzEr04D2k2A3khRmItwaJ+0o84GeXTjCnXtAeX2SFn1hut+H6Rgg=="],
|
"oh-my-opencode-linux-x64-musl-baseline": ["oh-my-opencode-linux-x64-musl-baseline@4.1.0", "", { "os": "linux", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode" } }, "sha512-9DChW9j0iCx3xO/oL2LXZmKaR8L/sYH6Se0v9zv7RS9kU4gxvS9Gd4kzJoFnSKiw/2xUpjjkHk/SPxsoytvQ3A=="],
|
||||||
|
|
||||||
"oh-my-opencode-windows-x64": ["oh-my-opencode-windows-x64@4.0.0", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-+aRlStPSkaHs9awlrhHQ4/em5SmyHQVbNY15y4dfs/OHKdFtDbFQDrS22dqqpBOHmucESf96mEzAs9RGfUvzOA=="],
|
"oh-my-opencode-windows-x64": ["oh-my-opencode-windows-x64@4.1.0", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-F6X1elfOA0rOSC8nB+Od4/9sHz0NNv6hIiZ6XkuqPBSWD5DymtjYjHIRKfumR9mYxkDOVp4ajU4hdLtO3tcxgA=="],
|
||||||
|
|
||||||
"oh-my-opencode-windows-x64-baseline": ["oh-my-opencode-windows-x64-baseline@4.0.0", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-VonuZat8PK3TKPufpjQsrkIy3L1+N5yVBl/na43n1E6GNrLe5Qv3TBqfDFewAS/Ogv2P3uh5FIn3v7DhF8Bh+A=="],
|
"oh-my-opencode-windows-x64-baseline": ["oh-my-opencode-windows-x64-baseline@4.1.0", "", { "os": "win32", "cpu": "x64", "bin": { "oh-my-opencode": "bin/oh-my-opencode.exe" } }, "sha512-91RFjv+sGJqQ/tgun0sV+xpkOcgoJ8Pv/mTN5qPyivJtIsTceSUqoJyHyz3tmpyckdKLl46NmzF1DLWCRUIwCA=="],
|
||||||
|
|
||||||
"on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
|
"on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,11 @@ describe("injectBoulderContinuation", () => {
|
|||||||
body?: {
|
body?: {
|
||||||
model?: { providerID: string; modelID: string }
|
model?: { providerID: string; modelID: string }
|
||||||
variant?: string
|
variant?: string
|
||||||
|
noReply?: boolean
|
||||||
|
parts?: Array<{
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
}
|
}
|
||||||
}> = []
|
}> = []
|
||||||
const promptAsyncMock = mock(async (request: unknown) => {
|
const promptAsyncMock = mock(async (request: unknown) => {
|
||||||
@@ -219,5 +224,9 @@ describe("injectBoulderContinuation", () => {
|
|||||||
modelID: "claude-sonnet-4-20250514",
|
modelID: "claude-sonnet-4-20250514",
|
||||||
})
|
})
|
||||||
expect(capturedRequests[0]?.body?.variant).toBe("max")
|
expect(capturedRequests[0]?.body?.variant).toBe("max")
|
||||||
|
expect(capturedRequests[0]?.body?.noReply).toBeUndefined()
|
||||||
|
const promptPart = capturedRequests[0]?.body?.parts?.[0]
|
||||||
|
expect(promptPart?.synthetic).toBe(true)
|
||||||
|
expect(promptPart?.metadata?.compaction_continue).toBe(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
resolveRegisteredAgentName,
|
resolveRegisteredAgentName,
|
||||||
} from "../../features/claude-code-session-state"
|
} from "../../features/claude-code-session-state"
|
||||||
import { log } from "../../shared/logger"
|
import { log } from "../../shared/logger"
|
||||||
import { createInternalAgentTextPart, resolveInheritedPromptTools } from "../../shared"
|
import { createInternalAgentContinuationTextPart, resolveInheritedPromptTools } from "../../shared"
|
||||||
import { HOOK_NAME } from "./hook-name"
|
import { HOOK_NAME } from "./hook-name"
|
||||||
import { BOULDER_CONTINUATION_PROMPT } from "./system-reminder-templates"
|
import { BOULDER_CONTINUATION_PROMPT } from "./system-reminder-templates"
|
||||||
import { resolveRecentPromptContextForSession } from "./recent-model-resolver"
|
import { resolveRecentPromptContextForSession } from "./recent-model-resolver"
|
||||||
@@ -89,7 +89,7 @@ export async function injectBoulderContinuation(input: {
|
|||||||
...(launchModel ? { model: launchModel } : {}),
|
...(launchModel ? { model: launchModel } : {}),
|
||||||
...(launchVariant ? { variant: launchVariant } : {}),
|
...(launchVariant ? { variant: launchVariant } : {}),
|
||||||
...(inheritedTools ? { tools: inheritedTools } : {}),
|
...(inheritedTools ? { tools: inheritedTools } : {}),
|
||||||
parts: [createInternalAgentTextPart(prompt)],
|
parts: [createInternalAgentContinuationTextPart(prompt)],
|
||||||
},
|
},
|
||||||
query: { directory: ctx.directory },
|
query: { directory: ctx.directory },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -71,8 +71,26 @@ describe("handleAtlasSessionIdle completion nudge", () => {
|
|||||||
|
|
||||||
writeBoulderState(testDirectory, boulder)
|
writeBoulderState(testDirectory, boulder)
|
||||||
|
|
||||||
const promptRequests: Array<{ body?: { parts?: Array<{ text?: string }> } }> = []
|
const promptRequests: Array<{
|
||||||
const promptAsyncMock = mock(async (request: { body?: { parts?: Array<{ text?: string }> } }) => {
|
body?: {
|
||||||
|
noReply?: boolean
|
||||||
|
parts?: Array<{
|
||||||
|
text?: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
}> = []
|
||||||
|
const promptAsyncMock = mock(async (request: {
|
||||||
|
body?: {
|
||||||
|
noReply?: boolean
|
||||||
|
parts?: Array<{
|
||||||
|
text?: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
}) => {
|
||||||
promptRequests.push(request)
|
promptRequests.push(request)
|
||||||
return { data: {} }
|
return { data: {} }
|
||||||
})
|
})
|
||||||
@@ -118,6 +136,9 @@ describe("handleAtlasSessionIdle completion nudge", () => {
|
|||||||
expect(promptText).toContain("- 1 Parse input: 1m 1s")
|
expect(promptText).toContain("- 1 Parse input: 1m 1s")
|
||||||
expect(promptText).toContain("- 2 Save output: 4s")
|
expect(promptText).toContain("- 2 Save output: 4s")
|
||||||
expect(promptText).not.toContain("{ELAPSED_HUMAN}")
|
expect(promptText).not.toContain("{ELAPSED_HUMAN}")
|
||||||
|
expect(promptRequests[0]?.body?.noReply).toBeUndefined()
|
||||||
|
expect(promptRequests[0]?.body?.parts?.[0]?.synthetic).toBe(true)
|
||||||
|
expect(promptRequests[0]?.body?.parts?.[0]?.metadata?.compaction_continue).toBe(true)
|
||||||
|
|
||||||
const persistedState = getState(SESSION_ID)
|
const persistedState = getState(SESSION_ID)
|
||||||
expect(persistedState.boulderCompletionNudgedAt?.[workId]).toBeNumber()
|
expect(persistedState.boulderCompletionNudgedAt?.[workId]).toBeNumber()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
} from "../../features/claude-code-session-state"
|
} from "../../features/claude-code-session-state"
|
||||||
import { getLastAgentFromSession } from "./session-last-agent"
|
import { getLastAgentFromSession } from "./session-last-agent"
|
||||||
import { isSessionInBoulderLineage } from "./boulder-session-lineage"
|
import { isSessionInBoulderLineage } from "./boulder-session-lineage"
|
||||||
import { createInternalAgentTextPart } from "../../shared"
|
import { createInternalAgentContinuationTextPart } from "../../shared"
|
||||||
import { getAgentConfigKey } from "../../shared/agent-display-names"
|
import { getAgentConfigKey } from "../../shared/agent-display-names"
|
||||||
import { log } from "../../shared/logger"
|
import { log } from "../../shared/logger"
|
||||||
import { settleAfterSessionIdle } from "../shared/session-idle-settle"
|
import { settleAfterSessionIdle } from "../shared/session-idle-settle"
|
||||||
@@ -287,7 +287,7 @@ export async function handleAtlasSessionIdle(input: {
|
|||||||
path: { id: sessionID },
|
path: { id: sessionID },
|
||||||
body: {
|
body: {
|
||||||
agent: atlasAgent,
|
agent: atlasAgent,
|
||||||
parts: [createInternalAgentTextPart(prompt)],
|
parts: [createInternalAgentContinuationTextPart(prompt)],
|
||||||
},
|
},
|
||||||
query: { directory: ctx.directory },
|
query: { directory: ctx.directory },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,15 +61,33 @@ describe("ralph-loop continuation prompt injector", () => {
|
|||||||
|
|
||||||
test("#given inherited message agent has ZWSP prefix #when injecting continuation prompt #then promptAsync receives normalized agent", async () => {
|
test("#given inherited message agent has ZWSP prefix #when injecting continuation prompt #then promptAsync receives normalized agent", async () => {
|
||||||
// given
|
// given
|
||||||
let promptBody: { agent?: string } | undefined
|
let promptBody: { agent?: string; noReply?: boolean } | undefined
|
||||||
|
let promptPart:
|
||||||
|
| {
|
||||||
|
text: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}
|
||||||
|
| undefined
|
||||||
const ctx = {
|
const ctx = {
|
||||||
client: {
|
client: {
|
||||||
session: {
|
session: {
|
||||||
messages: async () => ({
|
messages: async () => ({
|
||||||
data: [{ info: { agent: "\u200bSisyphus - Ultraworker" } }],
|
data: [{ info: { agent: "\u200bSisyphus - Ultraworker" } }],
|
||||||
}),
|
}),
|
||||||
promptAsync: async (input: { body: { agent?: string } }) => {
|
promptAsync: async (input: {
|
||||||
|
body: {
|
||||||
|
agent?: string
|
||||||
|
noReply?: boolean
|
||||||
|
parts?: Array<{
|
||||||
|
text: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
}) => {
|
||||||
promptBody = input.body
|
promptBody = input.body
|
||||||
|
promptPart = input.body.parts?.[0]
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -87,6 +105,9 @@ describe("ralph-loop continuation prompt injector", () => {
|
|||||||
// then
|
// then
|
||||||
expect(promptBody?.agent).toBe("sisyphus")
|
expect(promptBody?.agent).toBe("sisyphus")
|
||||||
expect(promptBody?.agent).not.toContain("\u200b")
|
expect(promptBody?.agent).not.toContain("\u200b")
|
||||||
|
expect(promptBody?.noReply).toBeUndefined()
|
||||||
|
expect(promptPart?.synthetic).toBe(true)
|
||||||
|
expect(promptPart?.metadata?.compaction_continue).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("#given inherited message agent has no ZWSP prefix #when injecting continuation prompt #then promptAsync receives normalized agent", async () => {
|
test("#given inherited message agent has no ZWSP prefix #when injecting continuation prompt #then promptAsync receives normalized agent", async () => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { findNearestMessageWithFields } from "../../features/hook-message-inject
|
|||||||
import { getMessageDir } from "./message-storage-directory"
|
import { getMessageDir } from "./message-storage-directory"
|
||||||
import { withTimeout } from "./with-timeout"
|
import { withTimeout } from "./with-timeout"
|
||||||
import {
|
import {
|
||||||
createInternalAgentTextPart,
|
createInternalAgentContinuationTextPart,
|
||||||
isRecord,
|
isRecord,
|
||||||
normalizeSDKResponse,
|
normalizeSDKResponse,
|
||||||
resolveInheritedPromptTools,
|
resolveInheritedPromptTools,
|
||||||
@@ -126,7 +126,7 @@ export async function injectContinuationPrompt(
|
|||||||
...(launchModel ? { model: launchModel } : {}),
|
...(launchModel ? { model: launchModel } : {}),
|
||||||
...(launchVariant ? { variant: launchVariant } : {}),
|
...(launchVariant ? { variant: launchVariant } : {}),
|
||||||
...(inheritedTools ? { tools: inheritedTools } : {}),
|
...(inheritedTools ? { tools: inheritedTools } : {}),
|
||||||
parts: [createInternalAgentTextPart(options.prompt)],
|
parts: [createInternalAgentContinuationTextPart(options.prompt)],
|
||||||
},
|
},
|
||||||
query: { directory: options.directory },
|
query: { directory: options.directory },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -74,7 +74,14 @@ describe("session-recovery resume", () => {
|
|||||||
expect(promptBody?.variant).toBe("max")
|
expect(promptBody?.variant).toBe("max")
|
||||||
expect(promptBody?.tools).toEqual({ question: false, bash: true })
|
expect(promptBody?.tools).toEqual({ question: false, bash: true })
|
||||||
expect(Array.isArray(promptBody?.parts)).toBe(true)
|
expect(Array.isArray(promptBody?.parts)).toBe(true)
|
||||||
const firstPart = (promptBody?.parts as Array<{ text?: string }>)?.[0]
|
const firstPart = (promptBody?.parts as Array<{
|
||||||
|
text?: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>)?.[0]
|
||||||
expect(firstPart?.text).toContain(OMO_INTERNAL_INITIATOR_MARKER)
|
expect(firstPart?.text).toContain(OMO_INTERNAL_INITIATOR_MARKER)
|
||||||
|
expect(firstPart?.synthetic).toBe(true)
|
||||||
|
expect(firstPart?.metadata?.compaction_continue).toBe(true)
|
||||||
|
expect(promptBody?.noReply).toBeUndefined()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { createOpencodeClient } from "@opencode-ai/sdk"
|
import type { createOpencodeClient } from "@opencode-ai/sdk"
|
||||||
import type { MessageData, ResumeConfig } from "./types"
|
import type { MessageData, ResumeConfig } from "./types"
|
||||||
import { createInternalAgentTextPart, resolveInheritedPromptTools } from "../../shared"
|
import { createInternalAgentContinuationTextPart, resolveInheritedPromptTools } from "../../shared"
|
||||||
|
|
||||||
const RECOVERY_RESUME_TEXT = "[session recovered - continuing previous task]"
|
const RECOVERY_RESUME_TEXT = "[session recovered - continuing previous task]"
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ export async function resumeSession(client: Client, config: ResumeConfig): Promi
|
|||||||
await client.session.promptAsync({
|
await client.session.promptAsync({
|
||||||
path: { id: config.sessionID },
|
path: { id: config.sessionID },
|
||||||
body: {
|
body: {
|
||||||
parts: [createInternalAgentTextPart(RECOVERY_RESUME_TEXT)],
|
parts: [createInternalAgentContinuationTextPart(RECOVERY_RESUME_TEXT)],
|
||||||
agent: config.agent,
|
agent: config.agent,
|
||||||
...(launchModel ? { model: launchModel } : {}),
|
...(launchModel ? { model: launchModel } : {}),
|
||||||
...(launchVariant ? { variant: launchVariant } : {}),
|
...(launchVariant ? { variant: launchVariant } : {}),
|
||||||
|
|||||||
@@ -46,7 +46,14 @@ describe("injectContinuation", () => {
|
|||||||
test("inherits tools from resolved message info when reinjecting", async () => {
|
test("inherits tools from resolved message info when reinjecting", async () => {
|
||||||
// given
|
// given
|
||||||
let capturedTools: Record<string, boolean> | undefined
|
let capturedTools: Record<string, boolean> | undefined
|
||||||
let capturedText: string | undefined
|
let capturedPart:
|
||||||
|
| {
|
||||||
|
text: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}
|
||||||
|
| undefined
|
||||||
|
let capturedNoReply: boolean | undefined
|
||||||
const ctx = {
|
const ctx = {
|
||||||
directory: "/tmp/test",
|
directory: "/tmp/test",
|
||||||
client: {
|
client: {
|
||||||
@@ -55,11 +62,18 @@ describe("injectContinuation", () => {
|
|||||||
promptAsync: async (input: {
|
promptAsync: async (input: {
|
||||||
body: {
|
body: {
|
||||||
tools?: Record<string, boolean>
|
tools?: Record<string, boolean>
|
||||||
parts?: Array<{ type: string; text: string }>
|
noReply?: boolean
|
||||||
|
parts?: Array<{
|
||||||
|
type: string
|
||||||
|
text: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
}
|
}
|
||||||
}) => {
|
}) => {
|
||||||
capturedTools = input.body.tools
|
capturedTools = input.body.tools
|
||||||
capturedText = input.body.parts?.[0]?.text
|
capturedNoReply = input.body.noReply
|
||||||
|
capturedPart = input.body.parts?.[0]
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -83,7 +97,10 @@ describe("injectContinuation", () => {
|
|||||||
|
|
||||||
// then
|
// then
|
||||||
expect(capturedTools).toEqual({ question: false, bash: true })
|
expect(capturedTools).toEqual({ question: false, bash: true })
|
||||||
expect(capturedText).toContain(OMO_INTERNAL_INITIATOR_MARKER)
|
expect(capturedNoReply).toBeUndefined()
|
||||||
|
expect(capturedPart?.text).toContain(OMO_INTERNAL_INITIATOR_MARKER)
|
||||||
|
expect(capturedPart?.synthetic).toBe(true)
|
||||||
|
expect(capturedPart?.metadata?.compaction_continue).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("skips injection when agent is plan (prevents Plan Mode infinite loop)", async () => {
|
test("skips injection when agent is plan (prevents Plan Mode infinite loop)", async () => {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
resolveRegisteredAgentName,
|
resolveRegisteredAgentName,
|
||||||
} from "../../features/claude-code-session-state"
|
} from "../../features/claude-code-session-state"
|
||||||
import {
|
import {
|
||||||
createInternalAgentTextPart,
|
createInternalAgentContinuationTextPart,
|
||||||
normalizeSDKResponse,
|
normalizeSDKResponse,
|
||||||
resolveInheritedPromptTools,
|
resolveInheritedPromptTools,
|
||||||
} from "../../shared"
|
} from "../../shared"
|
||||||
@@ -191,7 +191,7 @@ ${todoList}`
|
|||||||
...(launchModel ? { model: launchModel } : {}),
|
...(launchModel ? { model: launchModel } : {}),
|
||||||
...(launchVariant ? { variant: launchVariant } : {}),
|
...(launchVariant ? { variant: launchVariant } : {}),
|
||||||
...(inheritedTools ? { tools: inheritedTools } : {}),
|
...(inheritedTools ? { tools: inheritedTools } : {}),
|
||||||
parts: [createInternalAgentTextPart(prompt)],
|
parts: [createInternalAgentContinuationTextPart(prompt)],
|
||||||
},
|
},
|
||||||
query: { directory: ctx.directory },
|
query: { directory: ctx.directory },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -18,14 +18,26 @@ function setupConnectedProviderCacheMocks(): void {
|
|||||||
type PromptBody = {
|
type PromptBody = {
|
||||||
path: { id: string }
|
path: { id: string }
|
||||||
body: {
|
body: {
|
||||||
parts: Array<{ type: "text"; text: string }>
|
parts: Array<{
|
||||||
|
type: "text"
|
||||||
|
text: string
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
agent?: string
|
agent?: string
|
||||||
model?: { providerID: string; modelID: string }
|
model?: { providerID: string; modelID: string }
|
||||||
variant?: string
|
variant?: string
|
||||||
|
noReply?: boolean
|
||||||
}
|
}
|
||||||
query: { directory: string }
|
query: { directory: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function expectSyntheticContinuation(body: PromptBody["body"]): void {
|
||||||
|
expect(body.noReply).toBeUndefined()
|
||||||
|
expect(body.parts[0]?.synthetic).toBe(true)
|
||||||
|
expect(body.parts[0]?.metadata?.compaction_continue).toBe(true)
|
||||||
|
}
|
||||||
|
|
||||||
describe("createEventHandler - model-fallback auto-continuation pins agent/model/variant", () => {
|
describe("createEventHandler - model-fallback auto-continuation pins agent/model/variant", () => {
|
||||||
const createHandler = (args?: {
|
const createHandler = (args?: {
|
||||||
hooks?: any
|
hooks?: any
|
||||||
@@ -127,6 +139,7 @@ describe("createEventHandler - model-fallback auto-continuation pins agent/model
|
|||||||
providerID: "anthropic",
|
providerID: "anthropic",
|
||||||
modelID: "claude-opus-4-7",
|
modelID: "claude-opus-4-7",
|
||||||
})
|
})
|
||||||
|
expectSyntheticContinuation(body)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("pins agent/model on promptAsync body when continuing after session.error fallback", async () => {
|
test("pins agent/model on promptAsync body when continuing after session.error fallback", async () => {
|
||||||
@@ -167,6 +180,7 @@ describe("createEventHandler - model-fallback auto-continuation pins agent/model
|
|||||||
providerID: "anthropic",
|
providerID: "anthropic",
|
||||||
modelID: "claude-opus-4-7",
|
modelID: "claude-opus-4-7",
|
||||||
})
|
})
|
||||||
|
expectSyntheticContinuation(body)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("pins agent/model on fallback prompt() body when promptAsync is not available (session.status)", async () => {
|
test("pins agent/model on fallback prompt() body when promptAsync is not available (session.status)", async () => {
|
||||||
@@ -223,6 +237,7 @@ describe("createEventHandler - model-fallback auto-continuation pins agent/model
|
|||||||
providerID: "anthropic",
|
providerID: "anthropic",
|
||||||
modelID: "claude-opus-4-7",
|
modelID: "claude-opus-4-7",
|
||||||
})
|
})
|
||||||
|
expectSyntheticContinuation(body)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("pins variant from agent config when present", async () => {
|
test("pins variant from agent config when present", async () => {
|
||||||
@@ -268,5 +283,6 @@ describe("createEventHandler - model-fallback auto-continuation pins agent/model
|
|||||||
expect(promptAsyncBodies.length).toBe(1)
|
expect(promptAsyncBodies.length).toBe(1)
|
||||||
const body = promptAsyncBodies[0]!.body
|
const body = promptAsyncBodies[0]!.body
|
||||||
expect(body.variant).toBe("thinking")
|
expect(body.variant).toBe("thinking")
|
||||||
|
expectSyntheticContinuation(body)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1470,6 +1470,15 @@ describe("createEventHandler - session recovery compaction", () => {
|
|||||||
const sessionID = "ses_recovery_compaction"
|
const sessionID = "ses_recovery_compaction"
|
||||||
setMainSession(sessionID)
|
setMainSession(sessionID)
|
||||||
const callOrder: string[] = []
|
const callOrder: string[] = []
|
||||||
|
const promptBodies: Array<{
|
||||||
|
body?: {
|
||||||
|
noReply?: boolean
|
||||||
|
parts?: Array<{
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
}> = []
|
||||||
|
|
||||||
const eventHandler = createEventHandler({
|
const eventHandler = createEventHandler({
|
||||||
ctx: asEventHandlerContext({
|
ctx: asEventHandlerContext({
|
||||||
@@ -1481,8 +1490,9 @@ describe("createEventHandler - session recovery compaction", () => {
|
|||||||
callOrder.push("summarize")
|
callOrder.push("summarize")
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
prompt: async () => {
|
prompt: async (input: { body?: { noReply?: boolean; parts?: Array<{ synthetic?: boolean; metadata?: Record<string, unknown> }> } }) => {
|
||||||
callOrder.push("prompt")
|
callOrder.push("prompt")
|
||||||
|
promptBodies.push(input)
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1513,12 +1523,24 @@ describe("createEventHandler - session recovery compaction", () => {
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
expect(callOrder).toEqual(["summarize", "prompt"])
|
expect(callOrder).toEqual(["summarize", "prompt"])
|
||||||
|
expect(promptBodies[0]?.body?.noReply).toBeUndefined()
|
||||||
|
expect(promptBodies[0]?.body?.parts?.[0]?.synthetic).toBe(true)
|
||||||
|
expect(promptBodies[0]?.body?.parts?.[0]?.metadata?.compaction_continue).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("sends continue even if compaction fails", async () => {
|
it("sends continue even if compaction fails", async () => {
|
||||||
const sessionID = "ses_recovery_compaction_fail"
|
const sessionID = "ses_recovery_compaction_fail"
|
||||||
setMainSession(sessionID)
|
setMainSession(sessionID)
|
||||||
const callOrder: string[] = []
|
const callOrder: string[] = []
|
||||||
|
const promptBodies: Array<{
|
||||||
|
body?: {
|
||||||
|
noReply?: boolean
|
||||||
|
parts?: Array<{
|
||||||
|
synthetic?: boolean
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
}> = []
|
||||||
|
|
||||||
const eventHandler = createEventHandler({
|
const eventHandler = createEventHandler({
|
||||||
ctx: asEventHandlerContext({
|
ctx: asEventHandlerContext({
|
||||||
@@ -1530,8 +1552,9 @@ describe("createEventHandler - session recovery compaction", () => {
|
|||||||
callOrder.push("summarize")
|
callOrder.push("summarize")
|
||||||
throw new Error("compaction failed")
|
throw new Error("compaction failed")
|
||||||
},
|
},
|
||||||
prompt: async () => {
|
prompt: async (input: { body?: { noReply?: boolean; parts?: Array<{ synthetic?: boolean; metadata?: Record<string, unknown> }> } }) => {
|
||||||
callOrder.push("prompt")
|
callOrder.push("prompt")
|
||||||
|
promptBodies.push(input)
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1562,6 +1585,9 @@ describe("createEventHandler - session recovery compaction", () => {
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
expect(callOrder).toEqual(["summarize", "prompt"])
|
expect(callOrder).toEqual(["summarize", "prompt"])
|
||||||
|
expect(promptBodies[0]?.body?.noReply).toBeUndefined()
|
||||||
|
expect(promptBodies[0]?.body?.parts?.[0]?.synthetic).toBe(true)
|
||||||
|
expect(promptBodies[0]?.body?.parts?.[0]?.metadata?.compaction_continue).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("continues dispatching later event hooks when an earlier hook throws", async () => {
|
it("continues dispatching later event hooks when an earlier hook throws", async () => {
|
||||||
|
|||||||
+15
-5
@@ -25,7 +25,7 @@ import {
|
|||||||
clearBackgroundOutputConsumptionsForTaskSession,
|
clearBackgroundOutputConsumptionsForTaskSession,
|
||||||
restoreBackgroundOutputConsumption,
|
restoreBackgroundOutputConsumption,
|
||||||
} from "../shared/background-output-consumption";
|
} from "../shared/background-output-consumption";
|
||||||
import { resetMessageCursor } from "../shared";
|
import { createInternalAgentContinuationTextPart, resetMessageCursor } from "../shared";
|
||||||
import { getAgentConfigKey } from "../shared/agent-display-names";
|
import { getAgentConfigKey } from "../shared/agent-display-names";
|
||||||
import { readConnectedProvidersCache } from "../shared/connected-providers-cache";
|
import { readConnectedProvidersCache } from "../shared/connected-providers-cache";
|
||||||
import { invalidateContextWindowUsageCache } from "../shared/dynamic-truncator";
|
import { invalidateContextWindowUsageCache } from "../shared/dynamic-truncator";
|
||||||
@@ -162,7 +162,12 @@ export function createEventHandler(args: {
|
|||||||
promptAsync?: (input: {
|
promptAsync?: (input: {
|
||||||
path: { id: string };
|
path: { id: string };
|
||||||
body: {
|
body: {
|
||||||
parts: Array<{ type: "text"; text: string }>;
|
parts: Array<{
|
||||||
|
type: "text";
|
||||||
|
text: string;
|
||||||
|
synthetic?: boolean;
|
||||||
|
metadata?: Record<string, unknown>;
|
||||||
|
}>;
|
||||||
agent?: string;
|
agent?: string;
|
||||||
model?: { providerID: string; modelID: string };
|
model?: { providerID: string; modelID: string };
|
||||||
variant?: string;
|
variant?: string;
|
||||||
@@ -172,7 +177,12 @@ export function createEventHandler(args: {
|
|||||||
prompt: (input: {
|
prompt: (input: {
|
||||||
path: { id: string };
|
path: { id: string };
|
||||||
body: {
|
body: {
|
||||||
parts: Array<{ type: "text"; text: string }>;
|
parts: Array<{
|
||||||
|
type: "text";
|
||||||
|
text: string;
|
||||||
|
synthetic?: boolean;
|
||||||
|
metadata?: Record<string, unknown>;
|
||||||
|
}>;
|
||||||
agent?: string;
|
agent?: string;
|
||||||
model?: { providerID: string; modelID: string };
|
model?: { providerID: string; modelID: string };
|
||||||
variant?: string;
|
variant?: string;
|
||||||
@@ -383,7 +393,7 @@ export function createEventHandler(args: {
|
|||||||
...(launchAgent ? { agent: launchAgent } : {}),
|
...(launchAgent ? { agent: launchAgent } : {}),
|
||||||
...(launchModel ? { model: launchModel } : {}),
|
...(launchModel ? { model: launchModel } : {}),
|
||||||
...(launchVariant ? { variant: launchVariant } : {}),
|
...(launchVariant ? { variant: launchVariant } : {}),
|
||||||
parts: [{ type: "text" as const, text: "continue" }],
|
parts: [createInternalAgentContinuationTextPart("continue")],
|
||||||
},
|
},
|
||||||
query: { directory: pluginContext.directory },
|
query: { directory: pluginContext.directory },
|
||||||
};
|
};
|
||||||
@@ -772,7 +782,7 @@ export function createEventHandler(args: {
|
|||||||
await pluginContext.client.session
|
await pluginContext.client.session
|
||||||
.prompt({
|
.prompt({
|
||||||
path: { id: sessionID },
|
path: { id: sessionID },
|
||||||
body: { parts: [{ type: "text", text: "continue" }] },
|
body: { parts: [createInternalAgentContinuationTextPart("continue")] },
|
||||||
query: { directory: pluginContext.directory },
|
query: { directory: pluginContext.directory },
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { describe, expect, test } from "bun:test"
|
import { describe, expect, test } from "bun:test"
|
||||||
import {
|
import {
|
||||||
OMO_INTERNAL_INITIATOR_MARKER,
|
OMO_INTERNAL_INITIATOR_MARKER,
|
||||||
|
createInternalAgentContinuationTextPart,
|
||||||
createInternalAgentTextPart,
|
createInternalAgentTextPart,
|
||||||
stripInternalInitiatorMarkers,
|
stripInternalInitiatorMarkers,
|
||||||
} from "./internal-initiator-marker"
|
} from "./internal-initiator-marker"
|
||||||
@@ -19,6 +20,18 @@ describe("internal-initiator-marker", () => {
|
|||||||
expect(part.text).toBe(`Hello world\n${OMO_INTERNAL_INITIATOR_MARKER}`)
|
expect(part.text).toBe(`Hello world\n${OMO_INTERNAL_INITIATOR_MARKER}`)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("#given regular internal text #when creating a text part #then leaves it visible as a normal message part", () => {
|
||||||
|
// given
|
||||||
|
const text = "Visible notification"
|
||||||
|
|
||||||
|
// when
|
||||||
|
const part = createInternalAgentTextPart(text)
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect("synthetic" in part).toBe(false)
|
||||||
|
expect("metadata" in part).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
test("#given text already ending with the marker #when creating a text part #then does not duplicate the marker", () => {
|
test("#given text already ending with the marker #when creating a text part #then does not duplicate the marker", () => {
|
||||||
// given
|
// given
|
||||||
const text = `Already marked\n${OMO_INTERNAL_INITIATOR_MARKER}`
|
const text = `Already marked\n${OMO_INTERNAL_INITIATOR_MARKER}`
|
||||||
@@ -71,6 +84,22 @@ describe("internal-initiator-marker", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("createInternalAgentContinuationTextPart", () => {
|
||||||
|
test("#given continuation text #when creating a text part #then marks it as an agent continuation", () => {
|
||||||
|
// given
|
||||||
|
const text = "Continue the loop"
|
||||||
|
|
||||||
|
// when
|
||||||
|
const part = createInternalAgentContinuationTextPart(text)
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect(part.type).toBe("text")
|
||||||
|
expect(part.text).toBe(`Continue the loop\n${OMO_INTERNAL_INITIATOR_MARKER}`)
|
||||||
|
expect(part.synthetic).toBe(true)
|
||||||
|
expect(part.metadata.compaction_continue).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe("stripInternalInitiatorMarkers", () => {
|
describe("stripInternalInitiatorMarkers", () => {
|
||||||
test("#given text with no markers #when stripping #then returns text trimmed at the end", () => {
|
test("#given text with no markers #when stripping #then returns text trimmed at the end", () => {
|
||||||
// given
|
// given
|
||||||
|
|||||||
@@ -16,3 +16,16 @@ export function createInternalAgentTextPart(text: string): {
|
|||||||
text: `${cleanText}\n${OMO_INTERNAL_INITIATOR_MARKER}`,
|
text: `${cleanText}\n${OMO_INTERNAL_INITIATOR_MARKER}`,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function createInternalAgentContinuationTextPart(text: string): {
|
||||||
|
type: "text"
|
||||||
|
text: string
|
||||||
|
synthetic: true
|
||||||
|
metadata: { compaction_continue: true }
|
||||||
|
} {
|
||||||
|
return {
|
||||||
|
...createInternalAgentTextPart(text),
|
||||||
|
synthetic: true,
|
||||||
|
metadata: { compaction_continue: true },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user