fix(cli): confine agent runtime paths
This commit is contained in:
1 parent
c9d1075585
commit
7bf84a35e0
10 files changed
+399
-51
No files matched your search
@@ -119,14 +119,15 @@ func (p *QwenPlugin) Status() (PluginStatus, error) {
|
||||
}
|
||||
|
||||
func qwenAgentDirectory(agentID string) (string, string, error) {
|
||||
if agentID == "" || agentID == "." || agentID == ".." || filepath.IsAbs(agentID) || filepath.Base(agentID) != agentID {
|
||||
return "", "", fmt.Errorf("agent_id must be a single non-empty path segment")
|
||||
}
|
||||
runtimeRoot, err := qwenRuntimeRoot()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
return runtimeRoot, filepath.Join(runtimeRoot, agentID), nil
|
||||
agentDirectory, err := ResolveAgentRuntimeDirectory(agentID)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
return runtimeRoot, agentDirectory, nil
|
||||
}
|
||||
|
||||
func prepareQwenInstallationChanges(
|
||||
|
||||
Reference in new issue
Block a user