-
-
Notifications
You must be signed in to change notification settings - Fork 14
Local engine model management: desktop UI #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
66d299b
f0c96a8
f16e514
6e3e115
3cf1352
bf526e9
3a6aa2e
30b93d3
670f537
c4bd47c
1201226
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -780,7 +780,18 @@ pub(super) fn Dialogs(sig: AppSignals) -> Element { | |
| EnginesDialog { | ||
| visible: state.read().show_engines_dialog, | ||
| data: state.read().engines_data.clone(), | ||
| on_close: move |_| state.write().show_engines_dialog = false, | ||
| on_close: move |_| { | ||
| let mut s = state.write(); | ||
| s.show_engines_dialog = false; | ||
| // The inline action result belongs to the dialog; don't | ||
| // let it linger into the next open. | ||
| s.engine_action_result = None; | ||
| }, | ||
| action_pending: state.read().engine_model_action_pending.clone(), | ||
| action_result: state.read().engine_action_result.clone(), | ||
| on_clear_action_result: move |_| { | ||
| state.write().engine_action_result = None; | ||
| }, | ||
| on_engine_action: move |(engine, action): (String, EngineActionKind)| { | ||
| let gw = gateway.read().clone(); | ||
| if let Some(client) = gw { | ||
|
|
@@ -795,6 +806,18 @@ pub(super) fn Dialogs(sig: AppSignals) -> Element { | |
| } | ||
| }, | ||
| on_model_action: move |(engine, model, action): (String, String, ModelActionKind)| { | ||
| state | ||
| .write() | ||
| .engine_model_action_pending = Some((engine.clone(), model.clone())); | ||
|
Comment on lines
+809
to
+811
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Model buttons can stay stuck on "Loading…" when the request never leaves the app The clicked model is flagged as busy ( Pending flag set unconditionally; only a gateway answer or a Disconnected event clears it
Setting the flag only after a successful enqueue (or clearing it in the error branch, and surfacing the failure through Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| // A Load should honour the context window saved in the | ||
| // engine's parameters (the gateway maps it per engine: | ||
| // --n-ctx / --ctx-size / --num-ctx). | ||
| let saved_ctx = state | ||
| .read() | ||
| .engines_data | ||
| .as_ref() | ||
| .and_then(|d| d.engine(&engine)) | ||
| .and_then(|e| e.config.context_length); | ||
| let gw = gateway.read().clone(); | ||
| if let Some(client) = gw { | ||
| spawn(async move { | ||
|
|
@@ -803,7 +826,7 @@ pub(super) fn Dialogs(sig: AppSignals) -> Element { | |
| engine, | ||
| model, | ||
| action, | ||
| context_length: None, | ||
| context_length: saved_ctx, | ||
| extra_args: Vec::new(), | ||
| }) | ||
| .await | ||
|
|
@@ -869,6 +892,20 @@ pub(super) fn Dialogs(sig: AppSignals) -> Element { | |
| format!("Switched to {} / {}", engine, model_for_state), | ||
| ); | ||
| }, | ||
| on_config_save: move |(engine, config): (String, rustyclaw_core::engines::EngineConfig)| { | ||
| let gw = gateway.read().clone(); | ||
| if let Some(client) = gw { | ||
| spawn(async move { | ||
| if let Err(e) = client | ||
| .send(GatewayCommand::EngineConfigSet { engine, config }) | ||
| .await | ||
| { | ||
| tracing::error!("Failed to save engine config: {}", e); | ||
| } | ||
| }); | ||
| } | ||
| }, | ||
| configs_received: state.read().engine_configs_received, | ||
| on_refresh: move |_| { | ||
| let gw = gateway.read().clone(); | ||
| let selected = state | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.