fix: handle null user in comment transform#34
Closed
ralfschimmel wants to merge 3 commits intoczottmann:mainfrom
Closed
fix: handle null user in comment transform#34ralfschimmel wants to merge 3 commits intoczottmann:mainfrom
ralfschimmel wants to merge 3 commits intoczottmann:mainfrom
Conversation
Add support for managing issue relationships through a new `issues relations` subcommand group. This enables tracking dependencies between issues, which is essential for AI agents that need to understand task ordering and blockers. New commands: - `issues relations list <issueId>` - List all relations for an issue - `issues relations add <issueId> --blocks|--related|--duplicate|--similar <ids>` - `issues relations remove <relationId>` - Remove a relation by UUID Features: - Support for all Linear relation types: blocks, related, duplicate, similar - Comma-separated IDs for adding multiple relations at once - Human-friendly ID resolution (TEAM-123 format) - Relations included in `issues read` output - Both outgoing and inverse relations combined in output Technical details: - Optimized GraphQL queries with new ISSUE_RELATIONS_FRAGMENT - Proper validation for null/undefined nested relation data - UUID validation for relation removal - Partial success reporting when batch relation creation fails - Comprehensive unit tests (23 tests) and integration tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add read, create, update, and archive commands to the projects CLI: - projects list: Migrated from SDK to GraphQL with --include-archived option - projects read: Get project details including milestones and issues - projects create: Create project with required team and optional fields - projects update: Update any project field with --clear-* flags for nullables - projects archive: Soft-delete a project Implementation follows existing patterns from project-milestones.ts: - GraphQL queries with fragments for optimization - Name-based ID resolution with multiple match handling - Type definitions for command options - Integration tests for all commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Linear's agent protocol can create system comments with user: null. Add null-check to prevent "Cannot read properties of null" error when transforming issues with such comments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
|
Closing - will resubmit with only the bugfix commit (accidentally included unrelated feature commits) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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