fix(app): preserve inline file mentions (#38663)

This commit is contained in:
Brendan Allan 2026-07-24 18:28:09 +08:00 committed by GitHub
commit b62806683e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 98 additions and 22 deletions

View file

@ -489,6 +489,9 @@ describe("prompt submit worktree selection", () => {
agents: [],
})
expect((promptInputs[0] as { id?: string }).id).toStartWith("msg_")
expect((promptInputs[0] as { legacyParts?: { id: string; type: string; text?: string }[] }).legacyParts).toEqual([
{ id: expect.stringMatching(/^prt_/), type: "text", text: "ls" },
])
})
test("submits slash commands through the current session API", async () => {

View file

@ -162,6 +162,7 @@ export async function sendFollowupDraft(input: FollowupSendInput) {
agent: input.draft.agent,
model: input.draft.model,
variant: input.draft.variant,
legacyParts: requestParts,
text: requestParts.flatMap((part) => (part.type === "text" ? [part.text] : [])).join("\n"),
files: requestParts.flatMap((part) => {
if (part.type !== "file") return []