myagent-ai 1.25.0 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/system_skill.py +6 -2
- package/web/api_server.py +4 -3
package/package.json
CHANGED
package/skills/system_skill.py
CHANGED
|
@@ -209,8 +209,12 @@ class EnvironmentGetSkill(Skill):
|
|
|
209
209
|
if key:
|
|
210
210
|
value = os.environ.get(key)
|
|
211
211
|
if value is None:
|
|
212
|
-
return SkillResult(
|
|
213
|
-
|
|
212
|
+
return SkillResult(
|
|
213
|
+
success=True,
|
|
214
|
+
data={"key": key, "value": None, "exists": False},
|
|
215
|
+
message=f"环境变量 {key} 不存在(当前进程未设置)",
|
|
216
|
+
)
|
|
217
|
+
return SkillResult(success=True, data={"key": key, "value": value, "exists": True})
|
|
214
218
|
else:
|
|
215
219
|
# 返回所有(过滤敏感信息)
|
|
216
220
|
sensitive = {"PASSWORD", "SECRET", "TOKEN", "KEY", "CREDENTIAL", "API_KEY"}
|
package/web/api_server.py
CHANGED
|
@@ -4248,7 +4248,8 @@ window.addEventListener('beforeunload', function() {{
|
|
|
4248
4248
|
# [v1.24.1] 兼容两种会话 ID 格式:
|
|
4249
4249
|
# 旧格式: {agent}_web_{timestamp} → session_id LIKE 'default_%'
|
|
4250
4250
|
# 新格式: sess_{uuid} → 通过用户消息 metadata 中的 agent_path 关联
|
|
4251
|
-
|
|
4251
|
+
# [v1.24.6] 修复: json.dumps 默认在冒号后加空格 (": "),LIKE 模式需匹配
|
|
4252
|
+
metadata_agent_pattern = '%"agent_path": "' + agent + '"%'
|
|
4252
4253
|
# 先找出属于该 agent 的所有 session_id(子查询),再统计消息数
|
|
4253
4254
|
rows = conn.execute(
|
|
4254
4255
|
"SELECT m.session_id, COUNT(*) as cnt, MAX(m.created_at) as last FROM memories m "
|
|
@@ -4298,7 +4299,7 @@ window.addEventListener('beforeunload', function() {{
|
|
|
4298
4299
|
if not self.core.memory:
|
|
4299
4300
|
return web.json_response({"agent": name, "sessions": []})
|
|
4300
4301
|
prefix = f"{name}_"
|
|
4301
|
-
metadata_agent_pattern = '%"agent_path":"' + name + '"%'
|
|
4302
|
+
metadata_agent_pattern = '%"agent_path": "' + name + '"%'
|
|
4302
4303
|
conn = self.core.memory._get_conn()
|
|
4303
4304
|
# [v1.24.1] 兼容旧格式 (agent_xxx) 和新格式 (sess_xxx)
|
|
4304
4305
|
rows = conn.execute(
|
|
@@ -8485,7 +8486,7 @@ window.addEventListener('beforeunload', function() {{
|
|
|
8485
8486
|
|
|
8486
8487
|
if agent:
|
|
8487
8488
|
# 按 agent 路径筛选:旧格式 session_id LIKE '{agent}_%' 或新格式 metadata 包含 agent_path
|
|
8488
|
-
metadata_pattern = '%"agent_path":"' + agent + '"%'
|
|
8489
|
+
metadata_pattern = '%"agent_path": "' + agent + '"%'
|
|
8489
8490
|
rows = conn.execute(
|
|
8490
8491
|
"SELECT m.session_id, COUNT(*) as msg_count, MAX(m.created_at) as last_active "
|
|
8491
8492
|
"FROM memories m "
|