Skip to content

Conversation

@ariane-emory
Copy link
Contributor

@ariane-emory ariane-emory commented Dec 29, 2025

This PR changes the behaviour so that binding missing key commands in a user's config is not a fatal error that prevents the startup of opencode entirely.

With this PR, keybindings for non-existent keywords, when struck will instead display a toast saying "No command 'the_fake_command_name'".

Resolves #6397.

@ariane-emory ariane-emory marked this pull request as ready for review December 29, 2025 21:41
@ariane-emory ariane-emory changed the title Fix: nonfatal missing key commands Fix: nonfatal missing key commands (resolves #6397) Dec 29, 2025
@ariane-emory ariane-emory marked this pull request as draft December 29, 2025 23:17
@ariane-emory ariane-emory marked this pull request as ready for review December 29, 2025 23:20
@ariane-emory ariane-emory marked this pull request as draft December 29, 2025 23:37
@ariane-emory ariane-emory marked this pull request as ready for review December 29, 2025 23:43
@rekram1-node
Copy link
Collaborator

this shouldn't be enforced on the tui side, I would expect the tui to always be fed a valid config, and maybe u can introduce a config event for warnings that you emit that the tui could display

@ariane-emory
Copy link
Contributor Author

@rekram1-node Alright, I'll look into how that could work and see what I can come up with.

@ariane-emory ariane-emory marked this pull request as draft December 31, 2025 02:46
@ariane-emory ariane-emory force-pushed the fix/nonfatal-missing-key-commands branch 2 times, most recently from a17f3a8 to 69ab87a Compare December 31, 2025 04:42
- Change Keybinds schema from .strict() to .passthrough() to allow unknown keys
- Add ValidKeybindNames set for validating keybind names
- Add Config.Warning schema and Config.warnings() function
- Add GET /config/warnings endpoint to fetch warnings
- Add warning toast display in TUI when sync completes
- Add tests for warning generation with unknown keybind names

Fixes sst#6397
When user presses a key that matches a keybind configured for an unknown
command name, show a warning toast with the command name.
- Fetch unknown keybinds from /config/warnings endpoint instead of
  iterating all keybinds in config
- Add keybinds array field to Warning schema to provide list of
  unknown keybind names
- Fix TypeScript error from passthrough schema by casting value
- Regenerate SDK with ConfigWarning.keybinds field
@ariane-emory ariane-emory force-pushed the fix/nonfatal-missing-key-commands branch from 69ab87a to 18b74aa Compare December 31, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Missing key commands ought not be fatal errors.

2 participants