-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Diagnostic Information
| Property | Value |
|---|---|
| CLI Version | 0.5.1 |
| Node.js Version | v24.5.0 |
| OS | darwin |
| OS Version | 25.1.0 |
| Architecture | x64 |
| Capabilities | none |
| Claude CLI Version | 2.0.50 (Claude Code) |
Output is showing '[error] Command failed: SyntaxError: Unexpected token 'U',
Enhancement Request Analysis
Questions for Reporter
| Question | Answer |
|---|---|
| What specific iloom command were you running when you encountered this syntax error? | @Gromski, to reply, please edit this issue to answer these questions. |
| What was the full error output including any stack trace or line numbers? | |
Do you have any custom settings in .iloom/settings.json or .iloom/settings.local.json that might be relevant? |
|
| Were you inside an active loom workspace or in the main repository when the error occurred? |
Problem Summary
The CLI is encountering a JavaScript syntax error when parsing JSON, likely indicating malformed JSON response from an external CLI tool (GitHub CLI, Claude CLI, or Neon CLI) or corrupted configuration/cache data.
User Impact
This prevents successful command execution, blocking users from creating new looms, finishing work, or running other iloom commands that depend on JSON parsing from external tools.
Enhancement Goal
Implement robust error handling and recovery for JSON parsing operations throughout the codebase, with clear error messages indicating which specific operation failed and how to resolve it.
Next Steps
- Reporter to answer questions above for full context
- Investigate JSON parsing points in GitHubService, ClaudeService, and SettingsManager
- Add defensive parsing with detailed error context for debugging
📋 Complete Context & Details (click to expand)
Current Behavior
Based on the error message pattern "SyntaxError: Unexpected token 'U'", this typically occurs when:
- JSON.parse() receives
undefinedas input (starts parsing "undefined" and hits 'U') - An external CLI tool returns non-JSON output when JSON is expected
- A configuration file contains invalid JSON syntax
Key areas in iloom that parse JSON:
- GitHubService (src/lib/GitHubService.ts): Parses GitHub CLI output for issues/PRs
- SettingsManager (src/lib/SettingsManager.ts): Loads
.iloom/settings.jsonand.iloom/settings.local.json - AgentManager (src/lib/AgentManager.ts): Parses agent responses
- Various utility functions that handle CLI command outputs
Proposed Solution
- Add try-catch blocks with context-aware error messages around all JSON.parse() calls
- Implement a centralized safeJsonParse utility that:
- Validates input is not undefined/null before parsing
- Provides detailed error context (what was being parsed, from which source)
- Suggests remediation steps
- Add validation for external CLI tool outputs before parsing
- Implement fallback/recovery mechanisms where appropriate
Benefits
- Users get clear, actionable error messages instead of cryptic syntax errors
- Easier debugging with context about which specific operation failed
- Improved reliability when dealing with external CLI tools
- Better handling of edge cases and corrupted data scenarios
Metadata
Metadata
Assignees
Labels
Type
Projects
Status