Skip to content

Fix Cursor tool-call normalization duplicates#25

Merged
V3RON merged 1 commit intomainfrom
issue-24-cursor-tool-call-subtypes
May 6, 2026
Merged

Fix Cursor tool-call normalization duplicates#25
V3RON merged 1 commit intomainfrom
issue-24-cursor-tool-call-subtypes

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented May 6, 2026

Summary

  • validate the bug against a real Cursor Agent run: the raw session.stream.jsonl emitted both tool_call.started and tool_call.completed for one shell invocation, while normalization produced duplicate downstream command events
  • make Cursor normalization subtype-aware by keeping completion results but deduplicating command, file-read, and skill-signal extraction per logical call id
  • add regression coverage so started/completed pairs only emit one normalized tool call, one command, and one file read

Validation

  • real Cursor repro before fix: raw artifact contained one logical shell call split into tool_call.started and tool_call.completed, while normalized output contained two command events
  • real Cursor repro after fix: raw artifact still contains both subtypes, while normalized output now contains one toolCall, one command, and one toolResult
  • repro artifacts used during validation live under /var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/opencode/issue-24-cursor-repro*

Testing

  • npm test -- test/adapters/cursor-agent.test.ts test/limits/max-steps.test.ts
  • npm run typecheck

Closes #24.

@V3RON V3RON merged commit 2ce801d into main May 6, 2026
4 checks passed
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.

Cursor adapter double-counts tool calls

1 participant