Skip to content

TUI Error: Cannot read properties of undefined (reading 'models') when selecting model #57

@oyabuya

Description

@oyabuya

I encountered an error when using the TUI while selecting a model. The application crashes after a keypress.

Steps to Reproduce >>>
Run the CLI tool (free-coding-models)
Open the TUI interface
Navigate and select a model
Press a key to launch the selected model
Error occurs

Expected Behavior >>>
The selected model should start normally without crashing.

Actual Behavior >>>
The application throws an error and stops.

Error Log >>>
[TUI Error] An error occurred while handling a keypress.
TypeError: Cannot read properties of undefined (reading 'models')
at startOpenCode (file:///home//.nvm/versions/node/v22.22.0/lib/node_modules/free-coding-models/src/opencode.js:473:39)
at launchSelectedModel (file:///home//.nvm/versions/node/v22.22.0/lib/node_modules/free-coding-models/src/key-handler.js:359:24)
at file:///home//.nvm/versions/node/v22.22.0/lib/node_modules/free-coding-models/src/key-handler.js:2303:13
at ReadStream. (file:///home//.nvm/versions/node/v22.22.0/lib/node_modules/free-coding-models/src/app.js:937:13)
at ReadStream.emit (node:events:519:28)
at emitKeys (node:internal/readline/utils:370:14)
at emitKeys.next ()
at ReadStream.onData (node:internal/readline/emitKeypressEvents:64:36)
at ReadStream.emit (node:events:531:35)
at addChunk (node:internal/streams/readable:561:12)

Environment >>>
OS: Pop!_OS (Linux)
Node.js: v22.22.0
Installation: global via npm (free-coding-models)
Interface: TUI

Additional Notes >>>
This issue occurred during model selection. It seems that the models property is undefined when startOpenCode is called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions