OpenCode v1.1.64#436
Conversation
Co-authored-by: amankalra172 <aman.kalra@st.ovgu.de>
| if (fs.existsSync(candidate)) return candidate | ||
| } | ||
| } | ||
| } catch {} |
There was a problem hiding this comment.
CRITICAL: SyntaxError: Unexpected token 'catch' — the findBinary function is broken and will crash on startup.
The old code had a try { ... } catch {} block. The new code replaced the try body with a for (;;) loop but left the orphaned } catch {}. Node.js confirms this is a syntax error:
SyntaxError: Unexpected token 'catch'
at packages/opencode/bin/kilo:153
Additionally, the for (;;) loop at line 145 has no parent directory traversal (current = path.dirname(current)) and no break condition, so even if the syntax error were fixed, it would spin forever if the binary isn't found in startDir's node_modules.
Finally, findBinary() is called at line 156 with no arguments, but the new signature expects startDir. This means current will be undefined, and path.join(undefined, "node_modules") will throw.
The function needs to be rewritten — likely wrapping the for loop in a try/catch, adding const parent = path.dirname(current); if (parent === current) break; current = parent; at the end of the loop body, and passing __dirname (or similar) as startDir at the call site.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (37 files)
|
Core
Token substitution in OPENCODE_CONFIG_CONTENT environment variable
Look for recent model in fallback in CLI
Baseline CPU detection fixed
Windows selection behavior and manual Ctrl+C handling
Terminal PTY isolation for app
TUI
Do not open console on error
Desktop
Option to turn off sound effects
Normalize OAuth error messages
Suggestion active state broken
Fixed remote HTTP server connections in the app