fix(server): use a Cursor todo's title when its content is blank
What Changed
extractTodosAsPlan (apps/server/src/provider/acp/CursorAcpExtension.ts) now uses || instead of ?? when falling back from a todo's content to its title. Added a regression test.
Why
The step was derived with todo.content?.trim() ?? todo.title?.trim() ?? "". ?? only falls back on null/undefined, so a todo whose content is present but empty or whitespace ("" / " ") keeps the empty string and never falls back to title — and is then dropped by the if (step === "") return [] guard. Both content and title are optional in CursorTodo, so a blank-content-with-title todo is a valid payload that silently loses a real plan step.
Using || makes a blank content fall back to the title (matching the trailing || "" default's intent); a missing/blank content with no title still yields "" and is dropped as before. The added test fails before and passes after.
Checklist
- [x] This PR is small and focused
- [x] I explained what changed and why
- [x] No UI changes
[!NOTE] Low Risk Small parsing fix in Cursor ACP todo-to-plan mapping with a targeted test; no auth, security, or broad behavioral surface beyond plan UI updates from
cursor/update_todos.Overview
extractTodosAsPlannow picks plan step text with||instead of??when combiningcontentandtitle. Empty or whitespace-onlycontentno longer blocks fallback totitle, so those todos are not dropped by the empty-step guard.A regression test covers blank
contentwith a realtitle, whitespacecontent, and both fields empty.Reviewed by Cursor Bugbot for commit bc08c186a2c6e2cde294b4014e90c0ea7363fcf8. Bugbot is set up for automated code reviews on this repo. Configure here.
[!NOTE]
Fix
extractTodosAsPlanto use a Cursor todo's title when content is blankIn CursorAcpExtension.ts, the fallback from
contenttotitleused??(nullish coalescing), so whitespace-only content suppressed a valid title. Switching to||(logical OR) ensures blank or whitespace-only content falls back to the title, preventing those todos from being silently dropped from the plan.Macroscope summarized bc08c18.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
afb29bad-d2f4-4f5f-a0d5-80a9e655237eYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- [ ] 🔍 Trigger review
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Approvability
Verdict: Approved bc08c18
Straightforward bug fix changing nullish coalescing (??) to logical OR (||) so that blank content correctly falls back to the title field. The change is well-tested and self-contained.
You can customize Macroscope's approvability policy. Learn more.