Description
OpenCode crashes with TypeError: undefined is not an object when:
- Using authentication plugins like
opencode-antigravity-auth
- The agents array is empty or not yet loaded during startup
Stack Traces
TypeError: undefined is not an object (evaluating 'local.agent.current().name') at (src/cli/cmd/tui/component/prompt/index.tsx:840)
TypeError: undefined is not an object (evaluating 'a6.name')
at (src/cli/cmd/tui/context/local.tsx:151)
Root Cause
Multiple places in prompt/index.tsx and local.tsx access .name on potentially undefined objects.
Environment
- OpenCode version: 1.1.13
- OS: Arch Linux