Conversation
Cursor Agent CLI sends different conversation_id values on prompts vs tool hooks; reconcile by generation before grouping so live SSE updates keep one run per turn.
Keep attributes_json valid JSON under the size cap, tighten plugin skill fallback guards, namespace activity run ids by conversation, populate nested plugin manifest paths, and skip Cursor id reconcile when generation chat ids conflict.
Cursor CLI does not emit postToolUse for CallDynamicTool (WebSearch/WebFetch) or Glob; ingest those at preToolUse without duplicating Read/Shell spans.
Show touched files beside activity spans with search, resizable split, wrap shadow path remapping, and two-way highlight between expanded spans and file rows. Co-authored-by: Cursor <cursoragent@cursor.com>
Use Array.isArray for file-tree selection typing. Only read transcript_path from stop rows after a cheap string pre-check. Co-authored-by: Cursor <cursoragent@cursor.com>
Treat strict path prefixes and extensionless search roots as directories so nested activity paths no longer render with file icons. Co-authored-by: Cursor <cursoragent@cursor.com>
…on-reconcile Fix Cursor CLI activity trace grouping
PR Summary by QodoRelease v2.0.2: Cursor activity correlation, serialization fixes, run file tree
AI Description
Diagram
Files changed (25)
|
There was a problem hiding this comment.
Pull request overview
This release PR (v2.0.2) improves activity ingestion/correlation (especially for Cursor), makes activity attribute serialization safer under size caps, tightens plugin/skill resolution behavior, and adds a new “Files touched” UI in the project activity run dialog (including shared FileTree enhancements and workspace shadow-path remapping).
Changes:
- Correlate Cursor activity rows within a generation so prompts/tools/stops share the same
conversation_id, and improve Cursor pre-tool tracing for tools that don’t emitpostToolUse. - Replace activity-attributes truncation with “drop fields until JSON fits” serialization, and harden attribute extraction for arrays/objects.
- Add run “Files touched” sidebar + split-pane UI, backed by file-change derivation and a richer
FileTreecomponent; add wrap shadow workspace path remapping + tests.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web-ui/src/locales/en/projects.json | Adds localized strings for the new run “Files” sidebar UI (labels, empty states, search, expand/collapse). |
| web-ui/src/features/projects/components/activity/groupActivityRuns.ts | Normalizes Cursor conversation IDs before grouping; introduces stable run selection IDs namespaced by conversation. |
| web-ui/src/features/projects/components/activity/groupActivityRuns.test.ts | Adds coverage for Cursor CLI conversation merging and generation-id collision namespacing. |
| web-ui/src/features/projects/components/activity/buildRunFileTree.ts | New utilities to derive touched files from activity spans, build display keys, and support file tree selection/scrolling. |
| web-ui/src/features/projects/components/activity/buildRunFileTree.test.ts | Tests for file change collection, shadow-path remapping behavior, tree building, and span→file mapping. |
| web-ui/src/features/projects/components/activity/ActivitySpanRow.tsx | Adds span anchoring + callbacks for expansion tracking and file-linked highlighting. |
| web-ui/src/features/projects/components/activity/ActivitySection.tsx | Passes project.path to the activity feed so file paths can be rendered relative to the project root. |
| web-ui/src/features/projects/components/activity/ActivityRunSplitPane.tsx | New resizable split-pane for run dialog (files sidebar + span list). |
| web-ui/src/features/projects/components/activity/ActivityRunFileTree.tsx | New run sidebar showing touched files with filtering, selection, and legend badges. |
| web-ui/src/features/projects/components/activity/ActivityRunDialog.tsx | Integrates split-pane + file sidebar; links file selections to span scrolling and span expansion to file selection. |
| web-ui/src/features/projects/components/activity/ActivityFeed.tsx | Threads projectPath through to the run dialog. |
| web-ui/src/components/common/FileTree.tsx | Upgrades FileTree to support annotations/badges, selection, search-driven expansion, and scroll-to-selection. |
| web-ui/src/components/common/FileTree.test.ts | Adds unit tests for file-vs-folder inference (strict prefixes, extensionless roots). |
| src/shared/workspaces/remap-shadow-path.ts | New helper to remap capa wrap shadow workspace paths back to the real project path. |
| src/shared/workspaces/tests/remap-shadow-path.test.ts | Tests for nested/flat shadow workspace remapping and missing-real-path behavior. |
| src/shared/plugin-manifest/detect.ts | Records the actual manifest file path used when resolving nested plugins. |
| src/shared/agent-activity.ts | Registers supplemental Cursor beforeTool hooks to capture tools without postToolUse. |
| src/shared/agent-activity-normalize.ts | Traces certain Cursor tools at beforeTool (avoids duplicates), and improves wrapped/dynamic tool naming. |
| src/shared/activity-correlation-reconcile.ts | New module to reconcile Cursor conversation_id mismatches within a generation (prompt vs agent-session IDs). |
| src/shared/activity-attributes.ts | Updates serialization to fit size caps by dropping fields; improves array/object robustness in attribute reading. |
| src/shared/tests/agent-activity.test.ts | Updates/expands tests to validate Cursor supplemental hook registration and tracing behavior. |
| src/shared/tests/activity-correlation-reconcile.test.ts | New tests for transcript-path parsing and Cursor conversation ID reconciliation rules. |
| src/shared/tests/activity-attributes.test.ts | Adds test ensuring serialized attributes are valid JSON within cap or null. |
| src/server/skill-content.ts | Fixes plugin-skill resolution to only apply to type: "plugin" skills with a valid sourcePlugin. |
| src/server/tests/skill-content-plugin.test.ts | Adds targeted test to ensure inline skills aren’t incorrectly resolved via plugin unpack logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review by Qodo
1.
|
Mark Grep/Glob roots as explicit directories, default leaf paths to files, avoid O(n²) prefix scans, cache span path keys, and improve splitter keyboard focus and non-interactive tree rows. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.
Suppressed comments (2)
web-ui/src/components/common/FileTree.tsx:52
pathKeyconstruction drops the leading/for absolute paths (/a/bbecomesa/b). Whenfiles/annotations/selectedPathKeysuse absolute display paths (e.g. when there’s no common prefix, or paths are mixed absolute+relative), this causes selection + annotations lookup to fail because the keys no longer match.
for (const raw of paths) {
const normalized = raw.replace(/\\/g, '/').replace(/\/+$/, '');
const segments = normalized.split('/').filter(Boolean);
if (segments.length === 0) continue;
web-ui/src/features/projects/components/activity/ActivityRunSplitPane.tsx:57
- Drag handling only listens for
pointerup. If the pointer is canceled (e.g. OS gesture, browser losing capture, alt-tab),draggingRefcan remain true and the global cursor/userSelect styles may stay stuck, and listeners won’t be removed.
const endDrag = useCallback(() => {
draggingRef.current = false;
document.body.style.cursor = '';
document.body.style.userSelect = '';
window.removeEventListener('pointermove', onPointerMove);
This pull request introduces several significant improvements and fixes across activity tracking, plugin handling, and workspace path utilities. The main focus is on enhancing activity correlation for the Cursor provider, improving serialization logic for activity attributes, and adding robust test coverage for new and existing features.
Activity correlation and tracking improvements:
reconcileCursorActivityConversationIdsandchatConversationIdFromTranscriptPathinactivity-correlation-reconcile.tsto unifyconversation_idfor Cursor provider activities within the same generation, ensuring accurate grouping of prompts, tools, and stops. Includes comprehensive tests. [1] [2]agent-activity-normalize.tsto properly trace Cursor tool usage at thebeforeToolevent for dynamic tools (like WebSearch and Glob) that lack apostToolUseevent, while avoiding duplicates for tools already covered. Added logic to display inner tool names for wrapped tools. [1] [2] [3]buildSystemActivityHooksand related constants inagent-activity.tsto include supplemental events for Cursor, ensuring all relevant hooks are registered. [1] [2]agent-activity.test.tsto reflect new tracing logic and event handling. [1] [2]Activity attribute serialization:
serializeActivityAttributesto drop fields one by one until the JSON fits within the size cap, returningnullif not possible, instead of truncating raw JSON. Added tests to verify valid output or null on overflow. [1] [2] [3]readAttributeto correctly handle arrays and objects, improving robustness.Plugin and skill handling:
resolvePluginSkillContentto only resolve skills with type"plugin"and a validsourcePlugin, preventing incorrect resolution for inline skills with plugin metadata. Added targeted test. [1] [2] [3]resolveNestedPluginByIdto detect and record the actual manifest file path used, improving plugin manifest detection.Workspace path utilities:
remapWrapShadowPathto ensure correct mapping of shadow workspace paths to real project paths and proper handling of edge cases.These changes collectively improve reliability, maintainability, and test coverage for activity tracking, plugin management, and workspace handling.