fix(sessions): fold Cursor Tasks under Agent Sub-Sessions like Codex#262
Merged
wxtsky merged 3 commits intoJul 23, 2026
Merged
Conversation
Cursor IDE Tasks use a child session_id while transcript_path still points at the parent chat, which created duplicate cards. Honor separate/merge/hide, keep closed subagent ids across Stop (and idle-orphan merge drops), deny late Permission/AskUserQuestion/Question for closed agent ids, drop idle orphans without resuscitating via a shared IDE pid, fill missing parent identity from merge-first Task hooks, reopen Cursor Tasks via beforeSubmitPrompt after Stop, keep the parent active while folded Tasks run, and avoid dual-tailing the parent transcript when splitting to separate cards.
Keep folded deny/answer from idling the parent, drop idle orphans without overwriting live Tasks, and only self-tombstone foldable separate Task cards.
Async XCTest teardown released AppState off MainActor and trapped in assumeIsolated; use weak-boxed FSEvents teardown so discovery stays safe.
nguyenvanduocit
pushed a commit
to nguyenvanduocit/CodeIsland
that referenced
this pull request
Jul 15, 2026
…atch added to T-073 No new commits to wxtsky/CodeIsland since v1.0.30 (Jul 10). One new open PR wxtsky#262 (Jul 14): fix(appstate) ProjectsWatcherBox for FSEvents teardown safety — noted as prerequisite for T-073 implementation. vibe-island unchanged. No new GitHub issues created. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X1rG9TcKyFd2mpEVXb9n6k
nguyenvanduocit
pushed a commit
to nguyenvanduocit/CodeIsland
that referenced
this pull request
Jul 16, 2026
Upstream quiet since v1.0.30 (Jul 10). One new watch item: - T-076: panel intermittently shifts from notch to upper-left corner on macOS 27.0 beta (issue wxtsky#263, M5 Pro, no upstream fix yet) Skip: PR wxtsky#264 (OMP), PR wxtsky#262 (Cursor Tasks), issue wxtsky#265 (Cursor) — all non-Claude CLIs or Cursor-specific. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P5RZPP2LLwKBjbXuqKxDjf
Owner
|
Merged (d041a14) — impressive test coverage, and the merge-tree analysis confirmed it composes cleanly with #274. Review left three LOW-severity follow-up notes (none blocking, recorded here for visibility): (a) the new |
wxtsky
added a commit
that referenced
this pull request
Jul 23, 2026
Cursor's AskQuestion tool has no hook channel: the question is asked and
answered entirely inside Cursor's own UI while the registered hooks go
silent, so the session card sat on "thinking" forever and the question
never appeared. There is also no channel to answer from CodeIsland, so
this is a display-only wait derived from the agent transcript.
- JSONLTailer: recognize Cursor's role-keyed transcript lines
({"role":...,"message":{"content":[...]}}) via an O(1) role-prefix
probe and derive a CursorQuestionSignal — pending when the trailing
assistant entry carries an unanswered AskQuestion tool_use (args
{title, questions[].prompt, options[].label}, snake_case or camelCase,
run_async questions excluded), cleared when any newer entry supersedes
it. Chat text is deliberately not extracted from this shape; hooks
already stream it and the transcript copies differ cosmetically.
- AppState: apply the signal to main-agent Cursor sessions only
(transcript parent == session id, so #262 folded Task cards are never
touched): flip processing/running into .waitingQuestion with the
question text, resume as .processing once the transcript moves on;
hook activity resumes via the existing wasWaiting drain. Attach-time
backfill recovers an already-stuck question after app restart or
discovery (recency-gated to 30 min).
- SessionCard: show the question plus a localized "answer in Cursor"
hint (7 languages) instead of the endless thinking indicator; play the
approval chime on a fresh wait; seed the multi preview scenario.
Fixes #265
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
separate/merge/hide) for Cursorcursor/cursor-clihooks whosetranscript_pathis under…/agent-transcripts/<parentId>/…whilesession_idis a child. Merge rewrites to the parent +agent_id; hide drops the child; separate (default) keeps a separate card — no forced merge.UserPromptSubmit/beforeSubmitPrompt. When splitting to separate, do not tail the parent transcript twice.cliPid. PersistclosedSubagentIds. Settings copy mentions Cursor Task/subagent.AppStatedeinitoff the main actor (async XCTest / ARC). FSEvents callbacks hold a weak-boxed watcher so queued main-queue deliveries stay safe; avoidsMainActor.assumeIsolatedtraps.CursorSessionFoldingTests,AppStateCursorSubsessionTests,SessionPersistenceTests,AppStateDeinitTests.中文说明
cursor/cursor-cli)在「子 session_id + transcript 仍指向父对话」时,走同一套 Agent 子会话设置。合并 → 父 session +agent_id;隐藏 → 丢弃;默认独立显示,不强制合并。cliPid;持久化closedSubagentIds;设置文案补充 Cursor Task/subagent。deinit(异步 XCTest / ARC)。FSEvents 经弱引用 box 回调,避免MainActor.assumeIsolated崩溃。AppStateDeinitTests。Test Plan
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer—CursorSessionFoldingTests(24),AppStateCursorSubsessionTests(26),SessionPersistenceTests(6),AppStateDeinitTests(1) — all passedL10n+SettingsDefaults.pluginSessionMode == "separate")AfterAgentResponse/Stop(unit coverage: fold + parent keeps active).runningwith toolAgent, not.idle(unit coverage:testMergedPermissionMarksSubagentWaitingApproval)AppStateno longer SIGTRAP on teardown (AppStateDeinitTestspassed)