fix(server): use a Cursor todo's title when its content is blank - #5073
Conversation
…lank `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) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Approved bc08c18 Straightforward bug fix changing nullish coalescing ( You can customize Macroscope's approvability policy. Learn more. |
## What's Changed * fix(web): increase tooltip z-index to overlay popovers and menus by @naMqe-h in pingdotgg/t3code#5326 * fix(server): use a Cursor todo's title when its content is blank by @arhxam in pingdotgg/t3code#5073 * fix(ssh): isolate managed tunnel processes by @nateEc in pingdotgg/t3code#4347 * fix(server): scrub AppImage XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminals by @arhxam in pingdotgg/t3code#5075 ## New Contributors * @naMqe-h made their first contribution in pingdotgg/t3code#5326 **Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260804.997...v0.0.32-nightly.20260804.998 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260804.998
What Changed
extractTodosAsPlan(apps/server/src/provider/acp/CursorAcpExtension.ts) now uses||instead of??when falling back from a todo'scontentto itstitle. 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 whosecontentis present but empty or whitespace (""/" ") keeps the empty string and never falls back totitle— and is then dropped by theif (step === "") return []guard. Bothcontentandtitleare optional inCursorTodo, 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
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 bc08c18. 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.