Skip to content

Fix Cursor hook stdin decoding for CJK content#1637

Open
Siddhant-K-code wants to merge 1 commit into
git-ai-project:mainfrom
Siddhant-K-code:siddhant/1317-cursor-windows-cjk-hook-json
Open

Fix Cursor hook stdin decoding for CJK content#1637
Siddhant-K-code wants to merge 1 commit into
git-ai-project:mainfrom
Siddhant-K-code:siddhant/1317-cursor-windows-cjk-hook-json

Conversation

@Siddhant-K-code

@Siddhant-K-code Siddhant-K-code commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Read --hook-input stdin as bytes before decoding
  • Support UTF-8 plus UTF-16LE/UTF-16BE hook payloads, including BOM and NUL-pattern detection
  • Add a Cursor regression with odd-count CJK content encoded as UTF-16LE stdin

Fixes #1317.

Validation

Run from the repo root on this branch:

task fmt
task lint
task test TEST_FILTER=test_cursor_checkpoint_stdin_with_utf16le_odd_cjk_content

Expected outcomes:

  • task fmt exits cleanly with no rustfmt diffs.
  • task lint exits cleanly with no clippy/lint failures.
  • The targeted Cursor test passes.
  • The test sends a UTF-16LE JSON hook payload through --hook-input stdin, the checkpoint command does not emit Invalid JSON in hook_input, and the committed CJK line is verified as AI-authored.

Broader regression sweep:

task test TEST_FILTER=cursor

Expected outcome: Cursor preset and integration tests pass, including UTF-8 BOM and UTF-16 stdin decoding paths.

Additional whitespace check:

git diff --check origin/main..siddhant/1317-cursor-windows-cjk-hook-json

Expected outcome: no output and exit code 0.

Docs

No docs change needed. This is an input decoding bug fix for existing Cursor hook behavior and is covered by regression tests.

Notes

Draft PR for focused review and CI validation.

@Siddhant-K-code Siddhant-K-code force-pushed the siddhant/1317-cursor-windows-cjk-hook-json branch from d024b45 to 652bf54 Compare June 24, 2026 11:20
@Siddhant-K-code Siddhant-K-code marked this pull request as ready for review June 24, 2026 11:24
devin-ai-integration[bot]

This comment was marked as resolved.

@Siddhant-K-code Siddhant-K-code force-pushed the siddhant/1317-cursor-windows-cjk-hook-json branch from 652bf54 to e25818e Compare June 24, 2026 11:45
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.

[Bug]: Invalid JSON in hook_input: expected , or }

1 participant