do not crash on bad user config, or if we must at least provide better feedback #2744

Closed
opened 2026-02-16 17:37:04 -05:00 by yindo · 4 comments
Owner

Originally created by @ferdinandyb on GitHub (Nov 9, 2025).

Description

I messed up the structure of my config with non-existent keys, and opencode died with this extremely helpful message:


 [ERROR] Error: undefined is not an object (evaluating 'x3.data.providers')                    │After this operation, 1736 kB disk space will be freed.
     TypeError: undefined is not an object (evaluating 'x3.data.providers')                               │Do you want to continue? [Y/n] y
         at <anonymous> (src/cli/cmd/tui/context/sync.tsx:148:81)                                         │(Reading database ... 129950 files and directories currently installed.)
         at processTicksAndRejections (native:7:39)                                                       │Removing certbot (2.9.0-1) ...
 [21:56:12] [ERROR] Error: undefined is not an object (evaluating 'x3.data.providers')                    │Removing python3-certbot (2.9.0-1) ...
     TypeError: undefined is not an object (evaluating 'x3.data.providers')                               │Processing triggers for man-db (2.12.0-4build2) ...
         at <anonymous> (src/cli/cmd/tui/context/sync.tsx:148:81)                                         │
        at processTicksAndRejections (native:7:39)

It should definitely tell me that my config is bad, better yet, tell me what it does not like.

OpenCode version

1.0.51

Steps to reproduce

Mess up your config with a non-existent key.

Screenshot and/or share link

No response

Operating System

linux

Terminal

No response

Originally created by @ferdinandyb on GitHub (Nov 9, 2025). ### Description I messed up the structure of my config with non-existent keys, and opencode died with this extremely helpful message: ``` [ERROR] Error: undefined is not an object (evaluating 'x3.data.providers') │After this operation, 1736 kB disk space will be freed. TypeError: undefined is not an object (evaluating 'x3.data.providers') │Do you want to continue? [Y/n] y at <anonymous> (src/cli/cmd/tui/context/sync.tsx:148:81) │(Reading database ... 129950 files and directories currently installed.) at processTicksAndRejections (native:7:39) │Removing certbot (2.9.0-1) ... [21:56:12] [ERROR] Error: undefined is not an object (evaluating 'x3.data.providers') │Removing python3-certbot (2.9.0-1) ... TypeError: undefined is not an object (evaluating 'x3.data.providers') │Processing triggers for man-db (2.12.0-4build2) ... at <anonymous> (src/cli/cmd/tui/context/sync.tsx:148:81) │ at processTicksAndRejections (native:7:39) ``` It should definitely tell me that my config is bad, better yet, tell me what it does not like. ### OpenCode version 1.0.51 ### Steps to reproduce Mess up your config with a non-existent key. ### Screenshot and/or share link _No response_ ### Operating System linux ### Terminal _No response_
yindo added the opentuibug labels 2026-02-16 17:37:04 -05:00
yindo closed this issue 2026-02-16 17:37:04 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 9, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3868: Has the identical error message "undefined is not an object (evaluating 'x3.data.providers')" in src/cli/cmd/tui/context/sync.tsx:148:81
  • #3556: Related to config validation issues with "unrecognized keys" error handling (now closed)
  • #1307: Similar config-related undefined object evaluation error with better error messaging needed

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 9, 2025): This issue might be a duplicate of existing issues. Please check: - #3868: Has the identical error message "undefined is not an object (evaluating 'x3.data.providers')" in src/cli/cmd/tui/context/sync.tsx:148:81 - #3556: Related to config validation issues with "unrecognized keys" error handling (now closed) - #1307: Similar config-related undefined object evaluation error with better error messaging needed Feel free to ignore if none of these address your specific case.
Author
Owner

@veracioux commented on GitHub (Nov 9, 2025):

I have a PR in the works for this: https://github.com/sst/opencode/pull/4058.

It will surface errors better to the user without crashing like this. Although, since the error in this specific issue is regarding the configuration, the app should probably exit immediately (*), informing the user of the issue. This is because virtually anything useful in the TUI depends on the user's configuration.

(*) I'm currently working on this.

@veracioux commented on GitHub (Nov 9, 2025): I have a PR in the works for this: https://github.com/sst/opencode/pull/4058. It will surface errors better to the user without crashing like this. Although, since the error in this specific issue is regarding the configuration, the app should probably exit immediately (*), informing the user of the issue. This is because virtually anything useful in the TUI depends on the user's configuration. (*) I'm currently working on this.
Author
Owner

@ferdinandyb commented on GitHub (Nov 9, 2025):

exit immediately is a much better idea yes!

@ferdinandyb commented on GitHub (Nov 9, 2025): exit immediately is a much better idea yes!
Author
Owner

@taqtiqa-mark commented on GitHub (Nov 9, 2025):

@ferdinandyb and @veracioux this is a duplicate of #3868. Can you close this and discuss there?

If not... given OC is still being developed please try to "stay in the game" rather than exiting immediately. Robust startup is discussed, here https://github.com/sst/opencode/issues/3537#issuecomment-3465846968

@taqtiqa-mark commented on GitHub (Nov 9, 2025): @ferdinandyb and @veracioux this is a duplicate of #3868. Can you close this and discuss there? If not... given OC is still being developed please try to "stay in the game" rather than exiting immediately. Robust startup is discussed, here https://github.com/sst/opencode/issues/3537#issuecomment-3465846968
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2744