Skip to content

Cursor 3.8+ DOM shifted after v0.1.47: AI messages lost data-message-index; questionnaire buttons now atomic-CSS #44

Closed

Description

@habruzzo

Summary

Running CursorRemote 0.1.48 against Cursor 3.8+. Two related regressions from Cursor's virtualized/atomic-CSS DOM refactor:

  1. AI messages are silently dropped again — Cursor's DOM shifted after v0.1.47 (Messages not extracted on Cursor 3.8.x: chat DOM switched to virtualized list, data-flat-index removed #36) shipped, and the fallback chain never activates in the current mixed DOM.
  2. The questionnaire widget (Skip/Continue and options) is unusable — the extractor produces fragile positional selector paths that click random descendants.

Refs: #36 (fixed by v0.1.47), #43 (separate: virtualization scrollback).

Environment

  • Cursor 3.8+ (macOS)
  • CursorRemote 0.1.48 (marketplace, universal)
  • Only the extension-spawned relay, no standalone server

Issue 1: AI messages silently dropped again after v0.1.47

v0.1.47 landed a fallback chain (via #38/#39) to handle the Cursor 3.8+ virtualized DOM, and #36 was closed. Since then, Cursor's DOM shifted again: data-message-index was removed from AI wrappers while remaining on human wrappers. The v0.1.47 fallback chain never activates in this mixed DOM.

Compare the probe in #36 (Jun 21) with a live probe on my workbench today (Jul 7):

Attribute #36 probe today
data-message-index 20 2 (humans only)
data-message-id 20 5
data-message-role 29 5

What the bundle does

dist/server/bundle.mjs currently has this fallback chain:

let Z = Array.from(H.querySelectorAll("[data-flat-index], [data-message-index]"));
if (Z.length === 0) Z = Array.from(H.querySelectorAll(".composer-rendered-message[data-message-role]"));
if (Z.length === 0) Z = Array.from(H.querySelectorAll("[data-message-role][data-message-id]"));

Live selector match counts (Jul 7)

Selector Matches What it catches
[data-flat-index] 0 (removed)
[data-message-index] 2 human turns only
.composer-rendered-message[data-message-role] 2 human turns only
[data-message-role][data-message-id] 5 both human + ai
  • Human messages still carry data-message-index and data-message-role="human" and data-message-kind="human".
  • AI messages now carry only data-message-role="ai" + data-message-id + data-react-transcript-row-kind (e.g. "assistantMarkdown"). They no longer have data-message-index or data-message-kind, and they're wrapped in a .virtualized-composer-messages-row with data-find-row-key="assistant-markdown:<uuid>".

Why the fix doesn't kick in

The primary selector [data-flat-index], [data-message-index] returns 2 elements (both human), so Z.length !== 0 and neither fallback runs. The extractor returns "2 human messages" and everything else (assistant text, tool cards, plans, thoughts, todos) is dropped. Log evidence from a session with 20+ turns:

[dom-extractor] First successful extraction:
  status: waiting_approval
  messages: 1
  approvals: 1
  chatTabs: 17
  last element (human): "..."

approvals, chatTabs, mode, model, inputAvailable all extract correctly — approvals use .ui-shell-tool-call__run-btn etc. which still work — so this is definitely a message-selector-only regression.

Second-order problem: data-message-kind also missing on AI

Even if the fallback fires, the classifier branches on data-message-kind:

if (k === "ai" && M === "assistant") { let _e = _.querySelector(".markdown-root"); ... }
if (k === "ai" && M === "tool")      { ... }

In Cursor 3.8+, AI wrappers have data-message-kind = null. The equivalent info is on data-react-transcript-row-kind ("assistantMarkdown", plus "workGroup", "turnActions", "activityGroup", "activity", "tailStatus" observed). So both the selector and the classifier need updates.

Suggested fix

Merge the selector chain instead of short-circuit fallback, and map the new row-kind attribute:

// Merge (dedupe by element identity):
const seen = new Set();
const Z = [
  ...document.querySelectorAll("[data-flat-index], [data-message-index]"),
  ...document.querySelectorAll(".composer-rendered-message[data-message-role]"),
  ...document.querySelectorAll("[data-message-role='ai'][data-message-id]"), // 3.8+ AI rows
  ...document.querySelectorAll("[data-message-role][data-message-id]"),      // last-resort
].filter(el => !seen.has(el) && seen.add(el));

// When reading kind, add row-kind mapping:
const ROW_KIND_MAP = { assistantMarkdown: "assistant" /* extend once toolCall etc are confirmed */ };
const M = D.getAttribute("data-message-kind")
       || ROW_KIND_MAP[D.getAttribute("data-react-transcript-row-kind")]
       || null;

I verified locally that a minimal version of this (adding [data-message-role='ai'][data-message-id] to the primary selector and the data-react-transcript-row-kind fallback for the kind attribute) takes messages from 1 → 3+ and correctly renders assistant markdown with the existing .markdown-root path. .markdown-root still exists as a descendant of AI wrappers, so the current assistant-parsing code works unchanged.

The toolCall / other row-kind values would need probing to complete the map (I never saw one in my session).


Issue 2: Questionnaire interaction — atomic-CSS + moved DOM

What the bundle does

let nl = document.querySelector(".composer-questionnaire-toolbar");
if (nl) {
  const M = nl.querySelector(".composer-questionnaire-toolbar-actions");
  if (M) {
    const R = M.querySelector(".composer-skip-button"); R && (A = m(R));
    const j = M.querySelector(".composer-run-button");  j && (D = m(j), k = j.getAttribute("data-disabled") === "true");
  }
  // options via .composer-questionnaire-toolbar-option / -option-letter / -option-label
}

What Cursor 3.8+ looks like

All eleven composer-questionnaire-* classes the extractor uses return 0 matches during an active questionnaire:

.composer-questionnaire-toolbar               -> 0
.composer-questionnaire-toolbar-actions       -> 0
.composer-skip-button                         -> 0
.composer-run-button                          -> 0
.composer-questionnaire-toolbar-question      -> 0
.composer-questionnaire-toolbar-option        -> 0
.composer-questionnaire-toolbar-option-letter -> 0
.composer-questionnaire-toolbar-option-label  -> 0
.composer-questionnaire-toolbar-question-active -> 0
.composer-questionnaire-toolbar-question-number -> 0
.composer-questionnaire-toolbar-option-freeform -> 0

Observed in the DOM instead:

  • Post-answer display uses the new prefix: .user-questionnaire-answers-body, .user-questionnaire-answer-item, .user-questionnaire-question-text, .user-questionnaire-answer-text, .user-questionnaire-answer-value.
  • A "Skip" button briefly seen carries atomic CSS only: ui-button ui-9f619 ui-3nfvp2 ui-6s0dn4 ui-l56j7k ui-11twubx. No id, no role, no aria-label, no data-attrs.
  • MutationObserver + 200ms setInterval snapshot scoped to #composer-toolbar-section never observed the active Skip/Continue in-document during a full tool-call → tap-Continue → dismiss cycle. Best guess: the interactive form renders through a React portal / webview host that isn't queryable from the workbench page context. The .user-questionnaire-answers-body (post-answer) element IS in the main page, so the interactive counterpart is likely nearby but only during the tool-call's pending window.

Observable symptom

Every phone tap goes through as command:click_action with a positional selector rooted at #composer-toolbar-section, e.g.

[relay] Command: click_action ...
[command-executor] Clicked action: div#composer-toolbar-section > div > div:nth-of-type(2) > di...

Same selector sent twice, no dismissal, then the user taps again and the third click has nth-of-type(3) and finally works. Reproduces every time — every questionnaire requires 2-3 taps of the same button before the widget dismisses.

That's the m() helper falling back to a positional path after the class-based querySelector returned null. Since Cursor's DOM re-renders shift child counts between clicks, the nth-of-type(N) target keeps landing on inert siblings.

Suggested direction

The class-only approach won't work anymore because Cursor is using compiled atomic CSS. Some options:

  1. Text-content targeting — walk button[class*="ui-button"] and match on textContent.trim() === "Skip" / "Continue", scoped to the nearest [class*="user-questionnaire" i] ancestor (or whatever the new toolbar class is once located).
  2. aria-label on the buttons — if Cursor adds them (they aren't there today), that'd be the ideal stable hook.
  3. Track down where the active widget actually mounts. A MutationObserver installed before the tool call in the same tick may reveal it. (I tried this from CDP but couldn't get inside whichever portal/iframe hosts it.)

The m() selector-path builder should also refuse to emit an nth-of-type()-only path for interactive elements — better to return "" and let the client show "Skip/Continue temporarily unavailable" than silently click a wrong sibling.


Repro summary

  1. Update Cursor to any 3.8+ build (recent-enough that AI wrappers no longer carry data-message-index).
  2. Install CursorRemote 0.1.48.
  3. Start a chat, do anything that produces >1 assistant reply.
  4. On phone: only your own prompts render. (Issue 1)
  5. When the agent asks a multi-choice question, tap Continue on the phone. It takes 2-3 taps before the widget dismisses; each tap is logged as a click_action on a positional path. (Issue 2)

Activity

  1. len5ky commented on Jul 7, 2026

    @len5ky
    Owner

    This is a superb report — the probe tables pinpoint it exactly, thank you. Confirmed on our side: the v0.1.47 fallback chain gates on zero primary matches, so a mixed DOM (humans keeping data-message-index, AI rows carrying only data-message-role + data-message-id) never activates it. That gate was a deliberately conservative choice when we couldn't live-test; your data is what we needed to do it properly.

    Fix in progress for v0.1.49, along the lines you suggested:

    • merged selector tiers with identity + nested-ancestor dedupe instead of the short-circuit chain, so mixed DOMs extract both populations in document order;
    • data-react-transcript-row-kind mapped as the fallback for data-message-kind (starting with assistantMarkdown → assistant);
    • for the questionnaire taps: the executor will verify the resolved element's text matches the action label before clicking, with a text-content fallback search instead of trusting a bare nth-of-type path — that should kill the 2-3-taps-on-inert-siblings behavior even before we track down where the active widget actually mounts.

    Two things you could help with, since you clearly have a live 3.8+ probe setup: (1) if you catch a tool-call row, the data-react-transcript-row-kind value it carries, and (2) any sighting of the active questionnaire widget in-document (your portal theory sounds right — a MutationObserver installed before the tool call is our next guess too). I'll ping here when 0.1.49 is out so you can confirm on your workbench.

  2. habruzzo commented on Jul 7, 2026

    @habruzzo
    Author

    Got both. Portal theory was almost right — it's actually a timing thing, not a scoping thing: the widget IS in the main workbench document under #composer-toolbar-section, but its insertion is fast enough that periodic document.querySelector polling misses it. A MutationObserver armed on document.body before the widget appears catches it every time.

    1. Tool-call row-kind

    Tool calls carry data-react-transcript-row-kind="activity" (not "toolCall"). They're distinguished from other activity rows by the data-find-row-key prefix on the same element:

    data-react-transcript-row-kind data-find-row-key prefix Meaning
    workGroup work-group: turn wrapper
    assistantMarkdown assistant-markdown: assistant text → "assistant"
    turnActions turn-actions: retry/edit bar
    activityGroup activity-group: thoughts/tools wrapper
    activity tool-placeholder: tool call → "tool"
    activity activity-group:...:thinking thinking step

    Sample tool-call row (from a Write invocation):

    data-react-transcript-row-kind="activity"
    data-find-row-key="tool-placeholder:3133edc6-4ba8-403b-ac66-aa72f046dd18:tool:toolu_bdrk_01254qY2dMGT9wjUTr36jKpi"
    data-message-role=null
    data-message-kind=null
    

    Also seen: row-key prefixes human:, synthetic:.

    Suggested kind map for the new DOM:

    const row = el.closest('[data-find-row-key]');
    const key = row?.getAttribute('data-find-row-key') ?? '';
    const kind =
      el.getAttribute('data-message-kind') ||
      ({
        assistantMarkdown: 'assistant',
        activity: key.startsWith('tool-placeholder:') ? 'tool' : 'thought',
      })[el.getAttribute('data-react-transcript-row-kind')] ||
      null;

    2. Active questionnaire widget

    Confirmed live in document under #composer-toolbar-section. Here's the exact structure of an active widget, captured by a MutationObserver installed before I emitted an AskQuestion call from the agent side:

    #composer-toolbar-section.hide-if-empty.has-pending-questionnaire
      div.composer-questionnaire-toolbar[tabindex="-1"]
        div.composer-questionnaire-toolbar-header
          span.codicon.codicon-chat-question.composer-questionnaire-toolbar-icon
          span.composer-questionnaire-toolbar-title.make-shine        "Questions"
          div.composer-questionnaire-toolbar-stepper
            div.anysphere-icon-button…  (chevron-up)
            span.composer-questionnaire-toolbar-stepper-label         "1 of 1"
            div.anysphere-icon-button…  (chevron-down)
        div.composer-questionnaire-toolbar-scroll-container
          …
            div.composer-questionnaire-toolbar-questions
              div.composer-questionnaire-toolbar-question.composer-questionnaire-toolbar-question-active
                div.composer-questionnaire-toolbar-question-label
                  div.composer-questionnaire-toolbar-question-number  "1."
                  div.ui-markdown.ui-…   (question body)
                div.composer-questionnaire-toolbar-options
                  div.composer-questionnaire-toolbar-option[role="button"]
                    button.composer-questionnaire-toolbar-option-letter[type="button"]  "A"
                    span.composer-questionnaire-toolbar-option-label                    "A"
                  div.composer-questionnaire-toolbar-option[role="button"]
                    button.composer-questionnaire-toolbar-option-letter[type="button"]  "B"
                    span.composer-questionnaire-toolbar-option-label                    "B"
                  div.composer-questionnaire-toolbar-option.composer-questionnaire-toolbar-option-freeform[role="button"]
                    button.composer-questionnaire-toolbar-option-letter[type="button"]  "C"
                    textarea.composer-questionnaire-toolbar-freeform-input
        div.composer-questionnaire-toolbar-actions      "SkipEscContinue⏎"
          div.flex.…[data-click-ready="true"]                                        <-- Skip
            span
              span.truncate                              "Skip"
              span.opacity-50.keybinding-font-settings   "Esc"
          div.flex.…[data-disabled="true"][data-click-ready="false"]                 <-- Continue
            span
              span.truncate                              "Continue"
              span.opacity-50.keybinding-font-settings   "⏎"
    

    What still works

    Every .composer-questionnaire-toolbar-* class the extractor uses is intact except the action buttons:

    • ✅ .composer-questionnaire-toolbar
    • ✅ .composer-questionnaire-toolbar-header / -title / -icon / -stepper / -stepper-label / -stepper-icon
    • ✅ .composer-questionnaire-toolbar-scroll-container (+ -at-bottom)
    • ✅ .composer-questionnaire-toolbar-questions
    • ✅ .composer-questionnaire-toolbar-question + -active
    • ✅ .composer-questionnaire-toolbar-question-label / -number
    • ✅ .composer-questionnaire-toolbar-options
    • ✅ .composer-questionnaire-toolbar-option (+ -freeform)
    • ✅ .composer-questionnaire-toolbar-option-letter (still a real <button>)
    • ✅ .composer-questionnaire-toolbar-option-label
    • ✅ .composer-questionnaire-toolbar-freeform-input
    • ✅ .composer-questionnaire-toolbar-actions

    What's broken (the entire cause of the Skip/Continue bug)

    • ❌ .composer-skip-button — button was replaced with a generic div.flex.…[data-click-ready]
    • ❌ .composer-run-button — same

    Both live as direct children of .composer-questionnaire-toolbar-actions, with the clickable element identifiable in several stable ways:

    • Descendant span.truncate has text exactly "Skip" or "Continue"
    • data-click-ready attribute exists on the outer div (value "true"/"false" reflects live enablement)
    • data-disabled="true" on the outer div when disabled (Continue is disabled until an option is selected)
    • Position: Skip is :first-child, Continue is :nth-child(2) — but text is safer since the ordering isn't guaranteed by anything semantic

    Suggested selectors:

    const actions = document.querySelector('.composer-questionnaire-toolbar-actions');
    const findByLabel = (label) =>
      Array.from(actions?.children ?? []).find(
        (d) => d.querySelector('span.truncate')?.textContent.trim() === label
      );
    const skipEl = findByLabel('Skip');       // click target
    const continueEl = findByLabel('Continue');
    const continueDisabled = continueEl?.getAttribute('data-disabled') === 'true';

    data-click-ready looks like a first-class hook Cursor added specifically for click-driving, so an alternative that's probably future-proof:

    actions.querySelectorAll(':scope > div[data-click-ready]');  // [Skip, Continue] in that order

    Happy to re-verify against 0.1.49 whenever you cut it.


    obv cursor has been writing these reports because ive been working with it to debug, but just wanted to say as a human, this is a great resource and i appreciate your work on it :)

  3. added a commit that references this issue on Jul 7, 2026
  4. len5ky commented on Jul 7, 2026

    @len5ky
    Owner

    v0.1.49 is out (Open VSX + GitHub release) with both fixes:

    Issue 1: extraction now uses a merged union selector (flat-index, message-index, role-based, role+id tiers in one query) with nested-ancestor de-dupe instead of the zero-match gate, so mixed DOMs pick up both populations in document order. data-react-transcript-row-kind="assistantMarkdown" maps to the assistant classifier; the other row-kinds you observed (workGroup, turnActions, activityGroup, activity, tailStatus) are deliberately left unmapped until probed, and flow through as before. The pre-3.8 path is pinned by a unit-tested invariant.

    Issue 2: the executor now verifies the resolved element's text against the action label (glyph/shortcut-text normalized) and prefers a scoped text-content match over a bare positional path; when it can't prove a better candidate it falls back to the legacy click, so nothing changes for setups where selectors still resolve correctly. One known limitation, matching your portal theory: the fallback searches within the selector's root (e.g. #composer-toolbar-section) — if the live widget mounts outside it, the tap fails with a clear "action target not found" instead of mis-clicking, and we'll need your probe data to go further.

    Since you have the live workbench: could you confirm (1) assistant messages now render (your 1 → 3+ case), and (2) questionnaire Skip/Continue dismisses on the first tap? And if a tool-call row crosses your probe, that data-react-transcript-row-kind value would let us extend the map. Leaving this open until you confirm.

  5. habruzzo commented on Jul 7, 2026

    @habruzzo
    Author

    0.1.49 verified on my workbench (Cursor 3.8.x, macOS 15). Backed up the patched 0.1.48 and installed the release VSIX (sha256 102d0066…10848abb).

    Issue 1: fixed ✅

    From the extension log (post-restart), the extractor now reports assistant rows as the last element:

    [work] Starting server: …/cursor-remote-0.1.49/dist/server/bundle.mjs
    === CursorRemote v0.1.49 ===
    [dom-extractor] First successful extraction:
      messages: 4
      last element (assistant): "VSIX downloaded, SHA256 matches the release manifest…"
    

    The message count grew 4 → 6 across two restarts, always terminating on an assistant row. Under 0.1.48 (my patched build aside), the "last element" was always human. Fixed.

    Issue 2: fail-safe works, resolver still doesn't find Skip/Continue ⚠️

    The maintainer improvement worked: no more inert mis-clicks. But Skip/Continue still can't resolve on 3.8+.

    Log excerpt from six phone taps against an active questionnaire:

    15:41:16.398  Clicked action: div#composer-toolbar-section > div > div:nth-of-type(2) > di (A)
    15:41:17.417  Attempt 1/3 failed: action target not found (label: Skip)
    15:41:17.920  Attempt 2/3 failed: action target not found (label: Skip)
    15:41:18.424  Attempt 3/3 failed: action target not found (label: Skip)
    …repeats 5x
    

    Option-letter selection (A) still resolves via the legacy positional path (.composer-questionnaire-toolbar-option-letter is intact, so it happens to land on a real button).

    Root cause of Skip/Continue failure — the shortcut hint is a sibling of the label, so the clickable element's textContent isn't the plain label. From live DOM (captured with a MutationObserver on document.body armed before the widget mount):

    div.composer-questionnaire-toolbar-actions       textContent="SkipEscContinue⏎"
      div.flex.…[data-click-ready="true"]            textContent="SkipEsc"     ← Skip click target
        span
          span.truncate                              textContent="Skip"
          span.text-[10px].opacity-50.keybinding-font-settings   textContent="Esc"
      div.flex.…[data-disabled="true"][data-click-ready="false"] textContent="Continue⏎"  ← Continue
        span
          span.truncate                              textContent="Continue"
          span.text-[10px].opacity-50.keybinding-font-settings   textContent="⏎"
    

    If the normalized-text check on the outer div is strip(⏎, ↵) → "SkipEsc" ≠ "Skip", that's the miss. The shortcut label span is plain ASCII (Esc, ↑, ↓, etc.) so glyph-stripping alone won't cover it. Two options that both work on my workbench:

    • Positional inside .composer-questionnaire-toolbar-actions (Skip is always first, Continue second):

      actions.querySelector(':scope > div[data-click-ready]:nth-child(1)')  // Skip
      actions.querySelector(':scope > div[data-click-ready]:nth-child(2)')  // Continue
    • Match the inner truncated label (probably more future-proof):

      const findByLabel = (label) =>
        Array.from(actions.querySelectorAll(':scope > div'))
          .find(d => d.querySelector('span.truncate')?.textContent.trim() === label);

    data-click-ready and data-disabled are stable state signals on the outer div (data-click-ready="true" on Skip, data-click-ready="false" + data-disabled="true" on Continue until an option is chosen). Also confirmed the container path is stable and lives directly in document: #composer-toolbar-section.hide-if-empty.has-pending-questionnaire > .composer-questionnaire-toolbar[tabindex="-1"] > .composer-questionnaire-toolbar-actions — no portal, no iframe, no shadow root.

    Tool-call row (correction to my earlier note)

    Small correction: data-react-transcript-row-kind and data-find-row-key live on different elements for tool calls — the row-key is on the outer virtualized row, the row-kind is on an inner descendant div:

    div.virtualized-composer-messages-row
      data-find-row-key="tool-placeholder:<bubble-id>:tool:<tool-call-id>"
      data-find-bubble-ids="<bubble-id>"
        div
          div[data-react-transcript-row-kind="activity"]
            …tool card…
    

    So the mapping is activity row-kind + tool-placeholder: row-key on the enclosing wrapper → "tool". activity inside an activity-group:…:thinking row-key = a thinking step, not a tool call.

  6. len5ky commented on Jul 8, 2026

    @len5ky
    Owner

    This is exactly what we needed — thank you (and your Cursor 😄), genuinely. The timing correction (in-document, MutationObserver-fast, no portal) plus the span.truncate/keybinding-hint breakdown explains our resolver miss perfectly: we normalize ⏎/⌘/⇧ glyphs but "Esc" is plain ASCII, so "SkipEsc" never equals "Skip".

    v0.1.50 is in the works now using your selectors: '.composer-questionnaire-toolbar-actions > div[data-click-ready]' matched via span.truncate (legacy composer-skip/run-button classes stay as the primary path), data-disabled for Continue's state, and the tool row-kind mapping via the tool-placeholder: row-key on the outer virtualized row with the activity-group:…:thinking distinction. Will ping here when it's out for one more verification pass, then this issue finally closes.

  7. added a commit that references this issue on Jul 8, 2026
  8. len5ky commented on Jul 8, 2026

    @len5ky
    Owner

    v0.1.50 is out with your probe data applied:

    • Skip/Continue: extraction falls back to '.composer-questionnaire-toolbar-actions > div[data-click-ready]' matched by span.truncate text (legacy classes stay primary), emits a stable anchored path instead of the nth-of-type chain, and the executor compares labels against span.truncate first — so "SkipEsc" no longer defeats the match. data-disabled drives Continue's enabled state.
    • Tool cards: rows with data-find-row-key="tool-placeholder:…" and inner row-kind "activity" now classify and emit as tool cards (the activity-group:…:thinking shape is deliberately left alone pending more sightings).

    Whenever you get a chance for one more pass on your workbench: a questionnaire Skip and Continue tap (should be first-tap now), and whether tool cards render in the transcript. If both hold, this one finally closes. Thanks again — this issue is the model of how to report a DOM breakage.

  9. habruzzo commented on Jul 8, 2026

    @habruzzo
    Author

    0.1.50 verified: Skip first-tap works. Rest coming in a full rollup tomorrow — instead of piecemeal reports, I stood up a CDP audit script that samples the workbench every 15s and dedupes findings by shape signature. Been running since ~10:25 today.

    The audit checks four things against the current bundle.mjs: primary iterator vs every attribute-carrying element in the sidebar; per-option elementLabelMatches simulation on the extractor's selectorPath target; approvals fallback canary; and assistant content-loss (compares extractor code-block selectors against sanitizeHtml's strip set).

    Preview of what it's already caught in ~90 min:

    • Option-tap: extractor's be = et || ut picks the letter <button> (Cursor 3.8+ changed it from a span). Executor's elementLabelMatches then compares textContent="A" to "Yes, ..." → miss. Freeform "Other" options also broken: hasLabelSpan=no, label="".
    • Tool cards: [data-find-row-key^="tool-placeholder:"] wrappers carry only data-index / data-find-row-key / data-find-bubble-ids — none of the four primary-iterator attributes. Your M==="activity" classifier is unreachable. 8+ unique wrapper ids captured.
    • Code fences silently dropped: .ui-code-block is stripped by sanitizeHtml but the extractor's parser only matches .composer-message-codeblock, .composer-code-block-container. Sample from log: extractorSees=0 strips=6 orphans=[ui-code-block] boxdraw=true — one assistant reply, six fences, none rendered.
    • Approvals: .ui-shell-tool-call__approval-row no longer exists in the sidebar (approvalRelatedClasses: []), so the fallback path always runs. I locally patched hn() to stop it swallowing .ui-shell-tool-call__output-preview widgets and long-textContent buttons so the phone stays readable — needs the upstream fix.
    • Row-kinds the iterator doesn't know: workGroup, turnActions, activityGroup, activity, tailStatus. Missed row-key prefixes: work-group, turn-actions, activity-group, tail-status, synthetic. I added a classifier to guess at the purpose of each as they come through.

    Full rollup with counts, unique fingerprints, and per-finding samples tomorrow. Happy to share the script — ~350 lines of vanilla Node, no deps except ws on older Node, low-noise on long runs. Could probably slot into a CI smoke test that fails when Cursor's DOM adds a shape the extractor doesn't cover.

    I want to get a good baseline since apparently the Cursor team refactored a lot, and this way fixes don't need to be chased down individually as someone comes across them.

  10. habruzzo commented on Jul 9, 2026

    @habruzzo
    Author

    Update after Cursor 3.10.20 audit (v0.1.50 + local hn patch, follow-up to previous verification)

    Ran a comprehensive selector audit + phone-verification protocol on Cursor 3.10.20. Turned out the DOM churn is much wider than the previous three fixes covered — sharing everything below so you have a single reference for the current state.

    Environment

    • Cursor 3.10.20 (arm64, macOS 15.3.0)
    • cursor-remote v0.1.50-universal
    • Local patch: previously-applied hn filter tightening (output-preview + body + text-length checks); described below

    Audit approach

    1. Extracted every CSS selector referenced by bundle.mjs (90 unique class selectors + data-attribute selectors)
    2. Ran a single-shot DOM probe against the live workbench via CDP; grouped by extraction subsystem
    3. For each dead-selector category, probed for candidate replacement classes in the DOM
    4. Ran a phone-verification protocol (15 cases, one per element type) to confirm which "dead" selectors actually cause user-visible breakage

    Root-cause categories

    Cursor's composer refactor renamed many .composer-* classes to .ui-* (BEM-style), while stabilizing on data-* attributes as API surface. The extension is stuck on the pre-refactor class names in several key extraction paths.


    1. Tool-call rows not picked up by primary iterator (proven fix)

    Impact: every completed tool call (shell, edit, write) is invisible on phone — no header, no output, no error state, no diff.

    Root cause: Tool-placeholder rows in 3.10.20 have these attributes:

    • data-message-kind="tool"
    • data-tool-call-id="toolu_…"
    • data-tool-status="completed" | "loading"
    • data-react-transcript-row-kind="activity"
    • data-react-transcript-row-key="tool-placeholder:<sessionId>:tool:<toolId>"

    But NOT: data-message-role, data-message-id, data-message-index, data-flat-index, or .composer-rendered-message.

    The current union selector (both in selectMessageWrappers and inside extractionFunction) matches none of these:

    "[data-flat-index], [data-message-index], .composer-rendered-message[data-message-role], [data-message-role][data-message-id]"

    Local patch (verified on phone as resurrecting the tool card header): extend the union with [data-message-kind='tool'][data-tool-call-id]. Backwards-compatible — pre-3.10 rows still match via the existing clauses, dedupe is unaffected (the Set-of-ancestors filter naturally handles it).

    Secondary patch: the classifier requires k==="ai" && L==="tool" to enter the Vm() tool branch. New tool rows have L="tool" but no k (role attr absent). Adding if(L==="tool"&&!k)k="ai"; after the L=D.getAttribute("data-message-kind") line mirrors the existing pattern used for tool-placeholder fallback (X.startsWith("tool-placeholder:")?(L="tool",k||(k="ai"))) and unblocks the tool branch.

    Together these are ~2 lines total. Happy to open a PR.

    2. Vm() tool-extraction still uses dead selectors (partial fix needed)

    After the primary iterator patch above, the tool card header shows on phone (command summary "echo" + additions/deletions for edits render correctly via .ui-edit-tool-call__additions/__deletions which are alive). But the following selectors inside Vm() are all dead, so content is missing:

    Shell command:

    • .composer-terminal-tool-call-block-container → new location: .ui-tool-call-card__body
    • .composer-terminal-command-editor / .composer-terminal-command-expanded-text → not directly present; command text is spread across .ui-shell-tool-call__description (activity label) and .ui-shell-tool-call__summary (short badge like "rg, 2+")
    • Terminal output — .composer-terminal-output dead; new is <button class="ui-shell-tool-call__output-preview"> containing <span class="ui-shell-tool-call__output">…text…</span>

    Edit tool:

    • .composer-edit-file-review-wrapper dead → new is a bare .ui-tool-call-card__body containing .ui-default-diff
    • .composer-code-block-filename dead → filename is in the tool-call header (.ui-shell-tool-call__description for shell, TBD for edit)
    • .composer-code-block-status span dead → additions/deletions are on .ui-edit-tool-call__additions/__deletions (already handled by f() helper — nice)

    Diff content:

    • .composer-diff-block dead → new: .ui-default-diff[data-hide-scrollbar] with .ui-default-diff__content → repeated .ui-default-diff__line → each with .ui-default-diff__indicator-strip, .ui-default-diff__gutter, .ui-default-diff__line-number, .ui-default-diff__line-indicator, .ui-default-diff__line-content
    • Also .inline-diff-outer-container/-hover-container/-nav/-nav-counter/-removed for inline diffs

    Code blocks (embedded inside tool cards or in assistant messages):

    • .composer-code-block-container, .composer-message-codeblock (entry point of al()) both dead → new container class is .ui-code-block (seen in prior audit; absent when no code block is on-screen)
    • Inside a code block, Mg() already tries .ui-default-code__content and .ui-default-code__line-content (great) — but al() never enters because its query returns null. Extending al()'s querySelector to include .ui-code-block, .ui-default-code would let the rest of the pipeline work.

    3. Approval flow: .ui-shell-tool-call__approval-row no longer exists in 3.10.20

    Impact: real approval prompts show only the tool card header on phone — no Run/Skip/Allow buttons — even though desktop shows the approval UI and pending approvals are gating agent execution.

    Root cause: document.querySelectorAll('.ui-shell-tool-call__approval-row').length returns 0 in Cursor 3.10.20 during a live approval. Related classes (.ui-shell-tool-call__run-btn, -skip-btn, -allowlist-button, -allowlist-button-label) also return 0 across the entire DOM. Broader search for /approv|allow|deny|reject|run-btn|skip-btn|allowlist/i returned zero classes anywhere.

    The only approval-adjacent element in the DOM is <button class="solid-dropdown-toggle">Allowlist (with Sandbox)</button> — a settings-side dropdown, not a per-tool approval.

    Speculation: Cursor 3.10 probably moved the approval UI to a modal / portal — similar pattern to how the AskQuestion widget was moved out of .composer-questionnaire-toolbar in an earlier version. A MutationObserver installed before triggering an approval-required command would be the next investigation step.

    4. Todo / plan widget: 21 selectors dead, new widget structure identified

    Impact: agent todo lists / plans are entirely invisible on phone.

    New DOM shape:

    .human-message-with-todos-wrapper
    ├── .human-execution-message-top
    │   └── .composer-human-message-container → .composer-human-message → .composer-human-message-content
    └── .human-execution-message-bottom
        ├── .todo-summary-sticky-container
        │   └── .todo-summary-empty-line (empty) or per-item children
        └── .composer-fade-overlay
    

    Dead selectors that need remapping: .plan-execution-label/-message-content/-title, .todo-summary-content/-item/-item-content/-in-progress-circle/-content-clickable, .composer-plan-todo-ellipsis/-indicator/-more-text, .ui-todo-item, and the entire .composer-create-plan-* family.

    5. Collapsible reasoning / work-group rows — deliberately unmapped, worth remapping

    The v0.1.49 changelog explicitly noted workGroup / activityGroup row-kinds were left unmapped pending probe data. They're now in every active chat:

    • .ui-collapsible.ui-step-group-collapsible.agent-transcript-work-group-collapsible with header "Worked for 1m 32s" — row-kind workGroup, row-key work-group:human:<humanId>:assistant-markdown:<assistantId>:markdown
    • .ui-collapsible.ui-step-group-collapsible.agent-transcript-activity-group-collapsible with header "Thought for 3s" (note: rendered text is doubled — "Thoughtfor 3sfor 3s" — likely due to both visible-text and screen-reader label being present; same pattern as the mention duplication) — row-kind activityGroup, row-key activity-group:default:<uuid>:thinking

    These carry the "Thought for Ns" metadata that's currently invisible on phone.

    6. Model picker still works, via .composer-unified-dropdown fallback

    Positive finding: .ui-model-picker is dead (renamed to .ui-model-picker__trigger/__trigger-text/__trigger-chevron in a BEM-style refactor), but the existing .composer-unified-dropdown fallback in the extractor picks up the current mode ("Agent") correctly on phone. Interactive dropdown from the phone works. No fix needed here.

    7. Minor: mention chip duplication

    .mention is alive with new companions: mention-clickable, mention-file-wrapper, mention-file-icon-container, mention-file-icon, mention-file-icon-theme + data-mention-name, data-mention-key. The chip renders correctly on phone, but the filename is also appended as plain text afterward — same duplication pattern as the "for 3sfor 3s" in the collapsible header. Suggests the client (sanitizeHtml or the rendering path) is picking up both the chip element and its accessible-text fallback.

    Phone-verification results (15 cases run)

    Broken: 1 (code blocks), 2 (shell tool card), 3 (diff), 4 (todo), 7 (loading indicator), 12 (collapsible), 13 (approval bar), 15 (error banner), AskQuestion (already known)
    Working: 5 (model picker), 9 (streaming — batched), 14 (chat switching)
    Partial: 6 (mentions, with duplication), 8 (queue send works, phone doesn't show queued state)

    Applied local patches (byte-safe, syntax-validated, willing to open PR)

    1. Primary iterator (2 sites): additive , [data-message-kind='tool'][data-tool-call-id]
    2. Classifier role default: if(L==="tool"&&!k)k="ai"; after L assignment
    3. hn early-accept for .ui-shell-tool-call__approval-row descendants — harmless in 3.10.20 (row doesn't exist), future-proof

    Note: hn local patch also includes a .ui-tool-call-card__body blanket reject that I've since realized is over-broad — will remove or narrow further in a PR.

    Recommendation

    The primary iterator + role fallback (change 1+2, ~2 lines) is a low-risk high-value fix that unblocks the whole tool-card render path, even though Vm() will need selector modernization to fill in the content. Willing to open PRs for each section separately if that's easier to review.

    Thanks again for the extraordinary responsiveness on this — happy to keep providing probe data as new areas surface.


    also i dont expect you to fix all these if you dont want to, its your project and this is more than just "oh i found a bug". i just wanted to give a comprehensive audit of what i found.

  11. added a commit that references this issue on Jul 12, 2026
  12. len5ky commented on Jul 12, 2026

    @len5ky
    Owner

    Closing this with v0.1.52 — all of it has now shipped:

    • Issue 1 (AI messages dropped): fixed in v0.1.49 via the merged union selector.
    • Issue 2, Skip/Continue: fixed in v0.1.50 with anchored data-click-ready selectors.
    • Issue 2, the option rows themselves: fixed in v0.1.52. This was also what Question tool doesn't work #50 turned out to be — the label verification added in 0.1.49 could never match an option, since the selector targeted the letter button while the expected label was the full option text. Options now get anchored row selectors and the executor matches against the option label span.

    Thanks again for the probe data; the first two fixes came straight out of it. The remaining scroll-back limitation on virtualized lists stays tracked in #43.

  13. added 3 commits that reference this issue on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions