Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/agent-gateway/web/src/app/GatewayApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from "@liveagent/ui/lib/sidebar/openController";
import { createSidebarStore } from "@liveagent/ui/lib/sidebar/store";
import { useSidebarSelector } from "@liveagent/ui/lib/sidebar/useSidebarSelector";
import { subscribeSkillEnvConfigRequested } from "@liveagent/ui/lib/skills/index";
import { terminalSessionBelongsToProject } from "@liveagent/ui/lib/terminal/sessionStore";
import { useWorkspaceProjectDeletion } from "@liveagent/ui/lib/useWorkspaceProjectRemoval";
import { useWorkspaceProjectSettingsActions } from "@liveagent/ui/lib/workspaceProjectRemoval";
Expand Down Expand Up @@ -1123,6 +1124,13 @@ function useGatewayAppController() {
beforeRemoveWorkspaceProject,
});

// 聊天里的技能环境变量引导卡请求跳转:复用侧栏的 Skills Hub 打开动作。
useEffect(() => {
return subscribeSkillEnvConfigRequested(() => {
handleSidebarOpenSkillsHub();
});
});

const isWorkspaceProjectRunning = useCallback(
(pathKey: string) => {
if (sidebarStore.getSnapshot().runningWorkdirPathKeys.has(pathKey)) {
Expand Down
10 changes: 9 additions & 1 deletion crates/agent-gui/src-tauri/src/commands/runtime/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ pub async fn shell_run(
run_id: Option<String>,
sandbox: bool,
sandbox_allow_network: bool,
extra_envs: Option<std::collections::HashMap<String, String>>,
) -> Result<ShellRunResponse, String> {
let sandbox_options = effective_sandbox_options(sandbox, sandbox_allow_network)?;
// 技能环境变量注入:只接受合法变量名(前端已过滤,这里兜底),注入值
// 优先于继承的进程环境(Command::env 语义),即用户填写的值覆盖系统值。
let injected_envs: Vec<(String, String)> = extra_envs
.unwrap_or_default()
.into_iter()
.filter(|(name, _)| crate::services::skills::is_valid_env_var_name(name))
.collect();
let normalized_run_id = run_id
.map(|value| value.trim().to_string())
.filter(|value| !value.is_empty());
Expand All @@ -55,7 +63,7 @@ pub async fn shell_run(
max_timeout_ms,
provider_id,
cancel_token,
&[],
&injected_envs,
sandbox_options,
)
})
Expand Down
Loading
Loading