* fix: do not init mcp client on every call
Right now it inits each mcp client multiple times, one when discovering tools at startup, and then every time we call any tools.
This makes it so we reuse the client from startup
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* wip
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* refactor: even better approach
* fix: unused param
* refactor: more improvements
* fix: if list tools fails, remove client
* fix: improve slice
* chore: smaller changes
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
- Replace HasPrefix implementation to use filepath.Rel instead of filepath.Abs
- More reliable method to determine if a path is within a prefix
- Returns false on error conditions
- Preserves same public API for external usage
This addresses review feedback about improving the path checking logic.
A bug on onboarding made it impossible to press "y" and "n" on
onboarding, on both the model list and the API key field.
This also means that on some terminals, like the Windows Terminal,
pasting an API key would supress all "y" and "n" chars present in the
key, because these terminal receives an even for each character being
pressed.
- this fixes the case where the model sends -1 for indes
- this also adds events for loading tools
- this also fixes the finish reason for some providers
Error messages were not showing the left border indicator when selected/focused,
making them inconsistent with other message types in the chat interface.
💖 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>
* feat(tui): change textarea placeholder based on CoderAgent state
* fix(tui): editor: cache random placeholders for editor
Make sure we update the editor's placeholder text when a new message is sent.
* fix(tui): editor: update editor placeholder on new message send
---------
Co-authored-by: Raphael Amorim <rapha850@gmail.com>