fix: handle null user in comment transform #35
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.
Summary
Fix crash when transforming issues that contain comments with
user: null.Problem
When running
linearis issues update(orread) on an issue that has comments created by Linear's Agent Protocol, the CLI crashes with:Stack trace:
Root Cause
Linear's Agent Protocol creates system comments (e.g., "This thread is for an agent session with bobbin.") where
userisnull. The transform code at line 889-892 assumescomment.useralways exists:Example Data That Fails
From the raw API response, these comments have
user: null:{ "id": "ec4c235a-f2f3-4650-abfa-587bb51610ef", "body": "This thread is for an agent session with bobbin.", "createdAt": "2025-12-28T12:13:47.400Z", "updatedAt": "2025-12-28T12:18:06.594Z", "user": null }Fix
useroptional inLinearCommentinterface (user?:instead ofuser:)assignee:Testing
After the fix, issues with agent protocol comments are processed correctly. Comments with null users simply omit the
userfield in the output.🤖 Generated with Claude Code