opentui: fatal: undefined is not an object (evaluating 'local.agent.current().name')
Description
TypeError: undefined is not an object (evaluating 'local.agent.current().name')
at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:840:75)
at <anonymous> (../../node_modules/.bun/@[email protected]+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:148:62)
at runComputation (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:742:22)
at updateComputation (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:724:3)
at runTop (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:833:7)
at runUserEffects (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:928:18)
at runUpdates (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:849:17)
at completeUpdates (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:900:17)
at runUpdates (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:850:5)
at setStore (../../node_modules/.bun/[email protected]/node_modules/solid-js/store/dist/dev.js:221:5)
at processTicksAndRejections (native:7:39)...
Plugins
No response
OpenCode version
1.1.12
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
This issue might be a duplicate of existing issues. Please check:
- #7630: undefined is not an object (evaluating 'local.agent.current().name') - When login copilot
- #7628: undefined is not an object (evaluating 'local.agent.current().name')
- #7550: TUI crashes after successful native OpenAI account connection (TypeError: local.agent.current() is undefined)
These issues all share the same error stacktrace at the same line (src/cli/cmd/tui/component/prompt/index.tsx:840:75) and appear to occur after authentication or when the agent becomes undefined.
Feel free to ignore if this doesn't address your specific case.
Can you reproduce the error? And how?
Can you reproduce the error? And how?
For me, it happens after the redirection when I connect using the OpenAI provider with a ChatGPT Pro/Plus account under a team subscription. The redirection is what causes the issue.
Can you reproduce the error? And how?
For me, it happens after the redirection when I connect using the OpenAI provider with a ChatGPT Pro/Plus account under a team subscription. The redirection is what causes the issue.
More related issues:
When you connect to the OpenAI provider via the tUI with a ChatGPT Pro/Plus account under a team subscription, you get an error.
The OpenAI provider appears to be set up, but when you try to use models, you see: ‘Usage not included in your plan’.
If you go through the same process using the opencode auth login, it works perfectly.
Opened a PR to fix the TUI crash (local.agent.current().name) that can happen right after OAuth redirect.
PR: https://github.com/anomalyco/opencode/pull/7747
Repro (my case): OpenAI provider login with a ChatGPT Pro/Plus account under a team subscription; crash happens after the redirect.
Note: same stacktrace/line as #7550/#7628/#7630 (prompt/index.tsx:840:75).
Workaround for time being: https://github.com/anomalyco/opencode/issues/7550#issuecomment-3731950685
This may be fixed in latest release (going out rn 1.1.14
This may be fixed in latest release (going out rn 1.1.14
This is not fixed, same issue on 1.1.14