Skip to content

Conversation

@lengmodkx
Copy link
Owner

Summary

Fix the issue where running opencode displays [object Object] instead of meaningful error messages.

Root Cause

Multiple locations in the codebase were passing objects directly to console.error() or console.log(), which causes JavaScript to convert objects to the string [object Object].

Changes

  • packages/opencode/src/index.ts: Convert error to string using conditional check
  • packages/opencode/src/cli/cmd/github.ts: Properly format error objects before logging
  • packages/opencode/src/cli/cmd/debug/file.ts: Use JSON.stringify for object output

Testing

The fix ensures that error messages are properly displayed instead of [object Object].

Co-Authored-By: Claude [email protected]

Fix multiple locations where objects were being directly passed to
console.error/console.log, which causes [object Object] to be displayed
instead of meaningful error messages.

Changes:
- packages/opencode/src/index.ts: Properly convert error to string
- packages/opencode/src/cli/cmd/github.ts: Convert error objects to strings
- packages/opencode/src/cli/cmd/debug/file.ts: Use JSON.stringify for objects

Co-Authored-By: Claude <[email protected]>
@lengmodkx lengmodkx merged commit ae5b8ed into dev Jan 13, 2026
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.

2 participants