feat(agents): environment variables for built-in agents (#1157)

Settings › Tools › Agents › Built-in has an Environment variables field under the executable. They are saved in the agent's file like a command override, and the agent starts with them on top of the shell environment, replacing variables of the same name. Changing the command or the environment keeps the other; a file left with only the built-in's values is removed.

Closes #1133
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-04 11:07:52 +08:00
1 джерело e88e7e6459
коміт 5e73b1634f
12 files changed
+153 -3

No files matched your search

+13
Переглянути файл
@@ -49,6 +49,19 @@ pub fn agent_set_command(
agent::set_command(&state.host, window.label(), id, command)
}
/// Environment variables built-in agent `id` starts with (saved in its agent file);
/// an empty map clears them.
#[tauri::command]
#[specta::specta]
pub fn agent_set_env(
window: Window,
state: State<'_, AppState>,
id: String,
env: std::collections::BTreeMap<String, String>,
) -> IdeResult<()> {
agent::set_env(&state.host, window.label(), id, env)
}
/// Agents of the ACP Registry this machine can run, with what is installed; the list
/// saved earlier when the registry is unreachable. Cancel with `cancel_request(request)`.
#[tauri::command]
+1
Переглянути файл
@@ -98,6 +98,7 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
agent::agent_subscribe,
agent::agent_providers,
agent::agent_set_command,
agent::agent_set_env,
agent::agent_registry_list,
agent::agent_registry_install,
agent::agent_registry_remove,