t3code icon indicating copy to clipboard operation
t3code copied to clipboard

fix(server): use a Cursor todo's title when its content is blank

Open arhxam opened this issue 4 months ago • 2 comments

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

Open in Devin Review

[!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 extractTodosAsPlan now picks plan step text with || instead of ?? when combining content and title. Empty or whitespace-only content no longer blocks fallback to title, so those todos are not dropped by the empty-step guard.

A regression test covers blank content with a real title, whitespace content, 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 extractTodosAsPlan to use a Cursor todo's title when content is blank

In CursorAcpExtension.ts, the fallback from content to title used ?? (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.

arhxam avatar Jul 31 '26 06:07 arhxam

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: afb29bad-d2f4-4f5f-a0d5-80a9e655237e

You can disable this status message by setting the reviews.review_status to false in 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Jul 31 '26 06:07 coderabbitai[bot]

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.

macroscopeapp[bot] avatar Jul 31 '26 06:07 macroscopeapp[bot]