Skip to content

Commit 82b76e2

Browse files
arhxamclaude
andauthored
fix(server): use a Cursor todo's title when its content is blank (pingdotgg#5073)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 8a16cad commit 82b76e2

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎apps/server/src/provider/acp/CursorAcpExtension.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ describe("CursorAcpExtension", () => {
107107
});
108108
});
109109

110+
it("falls back to the title when content is present but blank", () => {
111+
expect(
112+
extractTodosAsPlan({
113+
toolCallId: "todos-2",
114+
todos: [
115+
{ id: "1", content: "", title: "Titled step", status: "pending" },
116+
{ id: "2", content: " ", title: "Whitespace content", status: "in_progress" },
117+
{ id: "3", content: "", title: "", status: "pending" },
118+
],
119+
merge: true,
120+
}),
121+
).toEqual({
122+
plan: [
123+
{ step: "Titled step", status: "pending" },
124+
{ step: "Whitespace content", status: "inProgress" },
125+
],
126+
});
127+
});
128+
110129
it("decodes Cursor list_available_models responses with per-model config options", () => {
111130
const decoded = CursorListAvailableModelsResponse.make({
112131
models: [

‎apps/server/src/provider/acp/CursorAcpExtension.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ export function extractTodosAsPlan(params: typeof CursorUpdateTodosRequest.Type)
9494
}>;
9595
} {
9696
const plan = params.todos.flatMap((todo) => {
97-
const step = todo.content?.trim() ?? todo.title?.trim() ?? "";
97+
// Fall back to the title when content is missing OR blank. `??` only
98+
// covers a missing content, so a present-but-empty content ("" or
99+
// whitespace) would shadow a real title and drop the step below.
100+
const step = todo.content?.trim() || todo.title?.trim() || "";
98101
if (step === "") {
99102
return [];
100103
}

0 commit comments

Comments
 (0)