2 コミット 30232e0c3a ... 366d5f6a76

作者 SHA1 メッセージ 日付
  cc 366d5f6a76 1 1 週間 前
  cc 8d34cd6368 1 1 週間 前

+ 1 - 13
ai-server/src/main/java/com/zsjz/ai/module/agent/service/AgentService.java

@@ -146,7 +146,7 @@ public class AgentService extends ServiceImpl<AgentMapper, AgentEntity> {
     public HarnessAgent getOrCreateAgent(Long workspaceId, Long agentRowId, Long modelId) {
         // 池 key 必须带 userId:工作区与用户级技能目录都按登录用户解析,
         // 少了这一维就会把 A 用户建的 agent(含其技能与工作区上下文)复用给 B 用户。
-        Long userId = StpUtil.getLoginIdAsLong();
+        long userId = StpUtil.getLoginIdAsLong();
         String key = "w" + workspaceId + "-a" + agentRowId + "-m" + modelId + "-u" + userId;
         return agentPool.computeIfAbsent(key, k -> {
             AgentEntity entry = getById(agentRowId);
@@ -288,18 +288,6 @@ public class AgentService extends ServiceImpl<AgentMapper, AgentEntity> {
         return b.build();
     }
 
-    /**
-     * 首次使用时为隔离工作目录补脚手架(AGENTS.md / skills / memory 等标准结构)。
-     * 幂等:已存在的文件不覆盖。
-     */
-    private static void scaffoldWorkspace(Path workspace, String sysPrompt) {
-        try {
-            WorkspaceScaffolder.scaffold(workspace, null, sysPrompt);
-        } catch (java.io.IOException e) {
-            log.warn("工作空间脚手架失败: {}, error={}", workspace, e.getMessage());
-        }
-    }
-
     /**
      * 解析 {@code agent.skill_repositories_json}(与 {@code agentscope.json} 的 skillRepositories 同构)。
      * 坏 JSON 静默降级为 null(等同「没配技能仓库」)。