Skip to content

fix(cursor): fold merge/hide Tasks via safe _ppid parent fallback - #296

Open
zephyr110 wants to merge 8 commits into
wxtsky:mainfrom
zephyr110:fix/cursor-ppid-merge-fallback
Open

fix(cursor): fold merge/hide Tasks via safe _ppid parent fallback#296
zephyr110 wants to merge 8 commits into
wxtsky:mainfrom
zephyr110:fix/cursor-ppid-merge-fallback

Conversation

@zephyr110

@zephyr110 zephyr110 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Depends on

#285 — merge first; until then the diff vs main includes it.

Summary

  • Cursor merge/hide Tasks without foldable transcript_path: fold (or hide) via a narrow _ppid parent fallback — unique same-PID Cursor card only; never guess when ambiguous.
  • Wrong parent under _ppid: prefer the main chat over an orphan Task (including idle mains); never parent onto a foldable Task card.
  • Stale parent chat after merge: keep folded Task prompts/replies on the parent card; don’t _ppid-fold an established main onto a sibling Task; dedupe Cursor transcript vs hook text.
  • Ghost Claude cards from Cursor Tasks: Claude-format hooks without --source no longer leave default-claude Task cards beside the real Cursor session — rebrand + fold via Cursor agent-transcripts paths.
  • Mascot vs badge mismatch: Cursor sessions no longer show the default Claude mascot next to a Cursor badge; CLI-in-foreign-IDE badges follow the CLI brand.

中文说明

  • 无 foldable transcript_path 的 Cursor Task: 用收紧的 _ppid 兜底合并/隐藏——只认唯一同 PID 父卡,对不上就不猜。
  • _ppid 认错父卡: 优先主会话(含 idle),不把孤儿 Task 当父卡。
  • 合并后父卡对话停更: 折叠 Task 的问答上浮到父卡;禁止把已有主卡折进 sibling Task;去重 transcript / hook 重复文本。
  • Cursor Task 变成幽灵 Claude 卡:--source 的 Claude 格式 hook 不再留下默认 claude 的 Task 卡——按 Cursor agent-transcripts 路径重标并折叠。
  • 吉祥物与 badge 不一致: Cursor 会话不再左侧 Claude、右侧 Cursor;CLI 跑在别的 IDE 里时 badge 跟 CLI。

Test Plan

  • CursorSessionFoldingTests / HookServerCursorPpidFallbackTests / HookServerCursorProbeTests
  • AppStateCursorSubsessionTests — misbranded Claude-default Task rebrand + merge
  • MascotSourceConsistencyTests / transcript dedupe / Codex reply gate
  • Manual — merge/hide Task without foldable transcript_path
  • Manual — idle main + running orphan Task folds onto main
  • Manual — Cursor Task no longer appears as a separate Claude card
  • Manual — Cursor mascot + badge both Cursor; Claude-in-Cursor both Claude

Cap live closed-subagent ids with ordered O(1) lookups, tighten the Cursor
routing probe, and report Kimi hooks only for the install-target config so
migrated users are not false-positive "installed".
When transcript_path cannot name a parent, resolve a unique same-PID
Cursor card so Agent Sub-Sessions merge/hide still work for IDE and CLI.
Do not _ppid-fold an already-established Cursor card onto a sibling Task,
surface folded Task prompts/replies on the parent card, and refresh chat
from role-keyed transcripts (stripping timestamp/user_query wrappers).
… text

Keep Codex/plugin subagent prompts off the parent card, and compare
normalized Cursor transcript chat so hook + tailer copies do not double up.
Infer mascot from termBundleId when hook source is empty, and show the
CLI brand (not host IDE) when a foreign agent runs inside Cursor/etc.
Idle main + running Task sharing an IDE pid previously folded new Tasks
onto the orphan card. Exclude foldable Task cards and prefer main-looking
or older idle parents instead.
Add applyTranscriptDelta normalized-wrapper dedupe cases, assert Codex
AfterAgentResponse does not overwrite parent chat, and test terminalBadgeLabel
used by the session badge.
Cursor Tasks that fire Claude-format hooks without --source kept the
default source=claude and showed as ghost Claude cards. Detect Cursor
agent-transcript paths, rebrand to cursor, and fold under merge/hide.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant