Repository navigation
Commit bc08c18
fix(server): fall back to a Cursor todo's title when its content is blank
`extractTodosAsPlan` derives each plan step with
`todo.content?.trim() ?? todo.title?.trim() ?? ""`. Because `??` only falls
back on null/undefined, a todo whose `content` is present but empty or
whitespace (`""` / `" "`) keeps the empty string and never falls back to the
`title`, so a real step is dropped by the `if (step === "") return []` guard
below. Both `content` and `title` are optional in `CursorTodo`, so a
blank-content-with-title todo is a valid payload.
Use `||` so a blank content falls back to the title, matching the evident
intent (and the trailing `|| ""` default). A missing/blank content with no
title still yields "" and is dropped as before. Added a regression test.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>1 parent e259dd2 commit bc08c18
2 files changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
110 | 129 | | |
111 | 130 | | |
112 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
0 commit comments