GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cursor): subagent grep results in files and count modes are no longer empty by MarcoDotIO · Pull Request #32220 · pingdotgg/t3code

Conversation

@MarcoDotIO

@MarcoDotIO MarcoDotIO commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Problem

When a Cursor Task subagent runs a grep in files_with_matches or count mode, its row in the subagent's child thread shows no results, even when the grep found files.

The call path: a completed task tool call reaches emitSubagent, which replays the subagent's conversationSteps through toolCallsFromConversationSteps → nestedToolCallFromEnvelope → nestedGrepWorkspaceResults. The SDK builds those steps with protobuf toJson() (conversationSteps.map((e) => e.toJson?.() ?? e) in @cursor/sdk 1.2.0). In that format each workspace's GrepUnionResult is a oneof of content, files or count. nestedGrepWorkspaceResults read only content, so a files or count result became a content result with no matches. cursorToolSearchResults then had nothing to show.

Change

nestedGrepWorkspaceResults now maps the files and count cases to the same shapes the SDK uses for top-level grep calls: { type: "files", output: { files, count } } and { type: "count", output: { counts, total } }. cursorToolSearchResults already renders both shapes for top-level grep calls, so the child thread now lists the matching files, or each file with its "N matches" count. The content case is unchanged.

Scope and approval

This is a small fix for an obvious bug, so it has no issue. It changes one converter in the Cursor adapter, and the converter now matches the proto's own GrepUnionResult oneof. Contracts, settings and clients do not change. The child thread's grep row now shows the results it should have shown; the layout does not change.

Not in this PR, and covered elsewhere:

  • Top-level content-mode grep conversion inside the SDK: fix(cursor): grep content results keep their matched lines #25037.
  • Nested shell failures shown as raw JSON, and live subagent streaming: fix(cursor): shell commands that exit non-zero are recorded as failed #29785 and fix(cursor): stream Task subagent work into child threads live #30539.

Verification

I extended projects subagent search results Cursor serialized with protobuf toJson in packages/provider-cursor/src/server/adapter.test.ts, the existing subagent test whose steps are shaped like toJson() output. It now includes one files_with_matches grep step and one count grep step.

Before the fix (upstream main), both new rows come back empty:

-     "results": [
-       { "fileName": "src/a.ts" },
-       { "fileName": "src/b.ts" },
-     ],
+     "results": [],
...
-     "results": [
-       { "fileName": "src/a.ts", "preview": "1 match" },
-       { "fileName": "src/b.ts", "preview": "3 matches" },
-     ],
+     "results": [],

 Tests  1 failed | 20 skipped (21)

After the fix:

vp test run packages/provider-cursor/src/server/adapter.test.ts
 Tests  21 passed (21)

Targeted vp lint and vp fmt --check on packages/provider-cursor/src/server passed, and effect-tsgo typecheck in packages/provider-cursor reported 0 errors.

Not checked: a live Cursor subagent run. The toJson() shape comes from the SDK's proto descriptors (GrepUnionResult|1 count|2 files|3 content, GrepFilesResult|1 files|2 total_files, GrepCountResult|1 counts|2 total_files|3 total_matches) and from the SDK code that serializes the steps. It was not captured from a real run.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in the Claude Code desktop app.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MarcoDotIO @claude
fix(cursor): subagent grep results in files and count modes are no lo…
a4a1d55
…nger empty

Cursor serializes a Task subagent's conversation steps with protobuf
toJson(), where each workspace's GrepUnionResult is a oneof of `content`,
`files` or `count`. The nested converter read only `content`, so a subagent
grep in files_with_matches or count mode showed no results in its child
thread. Map the `files` and `count` cases to the SDK's own grep result shape.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 6, 2026
macroscopeapp[bot]
macroscopeapp Bot approved these changes Nov 6, 2026
View reviewed changes
@macroscopeapp

macroscopeapp Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a4a1d55

Macroscope's review found this PR approvable — This restores file lists and match counts in Cursor subagent grep results using existing rendering support. The change is limited to result conversion, with no changes to search execution or product defaults.

You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Cursor adapter now maps nested grep files and count results to search output. Tests cover both variants through protobuf toJson() serialization.

Changes: Cursor grep result parsing

Layer / File(s) Summary
Map grep variants and verify output
packages/provider-cursor/src/server/adapter.ts, packages/provider-cursor/src/server/adapter.test.ts
The adapter maps valid file and count entries, using retained-entry totals when the provided totals are not numeric. Tests verify file results and per-file match-count previews in serialized output.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: bugfix, size:M

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to a4a1d

The new grep modes produce the expected file and count results in the covered cases. No actionable merge risk remains after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly identifies the Cursor subagent grep fix and both affected modes.
Description check Passed The description covers the problem, change, scope, and verification. It explains why the fix needs no prior issue and identifies the live check that was not performed.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: b90e554
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9e0d4a88-eeee-4332-9abc-26dc3211192b
Commits

Reviewing files that changed from the base of the PR and between b90e554 and a4a1d55.

Files selected for processing: 2

  • packages/provider-cursor/src/server/adapter.test.ts
  • packages/provider-cursor/src/server/adapter.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@MarcoDotIO
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.