auto-snapshot 2026-07-10 03:00:12
This commit is contained in:
parent
2ab3299508
commit
446bcb54b9
File diff suppressed because it is too large
Load Diff
|
|
@ -1 +1 @@
|
|||
{"ts": 1783262804.6085782, "behind": -1, "rev": null, "ver": "0.18.0"}
|
||||
{"ts": 1783603789.1670141, "behind": -1, "rev": null, "ver": "0.18.0"}
|
||||
|
|
@ -1 +0,0 @@
|
|||
prof-b
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
"last_error_reset_at": null,
|
||||
"base_url": "http://127.0.0.1:3000/v1",
|
||||
"request_count": 0,
|
||||
"secret_fingerprint": "sha256:051d8ccfe8ec241c"
|
||||
"secret_fingerprint": "sha256:cc6225a1be5c62b7"
|
||||
}
|
||||
],
|
||||
"deepseek": [
|
||||
|
|
@ -40,6 +40,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"updated_at": "2026-06-25T01:46:47.831820+00:00",
|
||||
"updated_at": "2026-07-09T07:49:06.879754+00:00",
|
||||
"active_provider": null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"updated_at": "2026-07-09T13:15:23.035004",
|
||||
"updated_at": "2026-07-10T02:56:08.835498",
|
||||
"platforms": {
|
||||
"telegram": [],
|
||||
"discord": [],
|
||||
|
|
|
|||
146
config.yaml
146
config.yaml
|
|
@ -1,18 +1,18 @@
|
|||
model:
|
||||
default: deepseek-v4-flash
|
||||
provider: deepseek
|
||||
api_key: sk-b1212066094d4e319784f23d5b2c6bbd
|
||||
base_url: https://api.deepseek.com
|
||||
default: minimaxai/minimax-m2.7
|
||||
provider: newapi-local
|
||||
api_key: 0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
base_url: http://127.0.0.1:3000/v1
|
||||
providers:
|
||||
newapi-local:
|
||||
api_key: sk-0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
api_key: 0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
base_url: http://127.0.0.1:3000/v1
|
||||
cost_factor: 0.0
|
||||
default_model: minimaxai/minimax-m3
|
||||
models:
|
||||
- mistralai/mistral-medium-3.5-128b
|
||||
- minimaxai/minimax-m2.7
|
||||
- minimaxai/minimax-m3
|
||||
- mistralai/mistral-medium-3.5-128b
|
||||
- minimaxai/minimax-m2.7
|
||||
- minimaxai/minimax-m3
|
||||
rate_limit: 1000
|
||||
timeout: 30
|
||||
deepseek:
|
||||
|
|
@ -21,12 +21,11 @@ providers:
|
|||
cost_factor: 0.0
|
||||
default_model: deepseek-v4-flash
|
||||
models:
|
||||
- deepseek-v4-flash
|
||||
- deepseek-v4-pro
|
||||
- deepseek-v4-flash
|
||||
- deepseek-v4-pro
|
||||
rate_limit: 1000
|
||||
timeout: 30
|
||||
fallback_providers:
|
||||
- newapi-local
|
||||
fallback_providers: '["deepseek"]'
|
||||
credential_pool_strategies: {}
|
||||
moa:
|
||||
presets:
|
||||
|
|
@ -46,10 +45,9 @@ moa:
|
|||
enabled: true
|
||||
default_preset: expert-panel
|
||||
save_traces: false
|
||||
|
||||
toolsets:
|
||||
- hermes-cli
|
||||
- web
|
||||
- hermes-cli
|
||||
- web
|
||||
agent:
|
||||
max_turns: 90
|
||||
gateway_timeout: 1800
|
||||
|
|
@ -279,13 +277,11 @@ display:
|
|||
tool_progress_overrides: {}
|
||||
tool_preview_length: 0
|
||||
ephemeral_system_ttl: 0
|
||||
platforms: {}
|
||||
runtime_footer:
|
||||
enabled: false
|
||||
fields:
|
||||
- model
|
||||
- context_pct
|
||||
- cwd
|
||||
- model
|
||||
- context_pct
|
||||
- cwd
|
||||
copy_shortcut: auto
|
||||
resume_exchanges: 10
|
||||
resume_max_user_chars: 300
|
||||
|
|
@ -432,35 +428,35 @@ approvals:
|
|||
mcp_reload_confirm: true
|
||||
destructive_slash_confirm: false
|
||||
command_allowlist:
|
||||
- stop/restart hermes gateway (kills running agents)
|
||||
- sudo with combined-flag privilege escalation
|
||||
- copy/move file into /etc/
|
||||
- shell command via -c/-lc flag
|
||||
- script execution via heredoc
|
||||
- overwrite project env/config via redirection
|
||||
- in-place edit of system config
|
||||
- script execution via -e/-c flag
|
||||
- force kill processes
|
||||
- world/other-writable permissions
|
||||
- sudo with privilege flag (stdin/askpass/shell/list)
|
||||
- hermes update (restarts gateway, kills running agents)
|
||||
- stop/restart system service
|
||||
- start gateway outside systemd (use 'systemctl --user restart hermes-gateway')
|
||||
- find -delete
|
||||
- recursive delete
|
||||
- copy/move file into system config path
|
||||
- git force push (rewrites remote history)
|
||||
- overwrite system file via redirection
|
||||
- disk copy
|
||||
- SQL TRUNCATE
|
||||
- kill process via pgrep expansion (self-termination)
|
||||
- force kill processes (killall -KILL)
|
||||
- overwrite system config
|
||||
- overwrite system file via tee
|
||||
- git force push short flag (rewrites remote history)
|
||||
- kill hermes/gateway process (self-termination)
|
||||
- delete in root path
|
||||
- pipe remote content to shell
|
||||
- stop/restart hermes gateway (kills running agents)
|
||||
- sudo with combined-flag privilege escalation
|
||||
- copy/move file into /etc/
|
||||
- shell command via -c/-lc flag
|
||||
- script execution via heredoc
|
||||
- overwrite project env/config via redirection
|
||||
- in-place edit of system config
|
||||
- script execution via -e/-c flag
|
||||
- force kill processes
|
||||
- world/other-writable permissions
|
||||
- sudo with privilege flag (stdin/askpass/shell/list)
|
||||
- hermes update (restarts gateway, kills running agents)
|
||||
- stop/restart system service
|
||||
- start gateway outside systemd (use 'systemctl --user restart hermes-gateway')
|
||||
- find -delete
|
||||
- recursive delete
|
||||
- copy/move file into system config path
|
||||
- git force push (rewrites remote history)
|
||||
- overwrite system file via redirection
|
||||
- disk copy
|
||||
- SQL TRUNCATE
|
||||
- kill process via pgrep expansion (self-termination)
|
||||
- force kill processes (killall -KILL)
|
||||
- overwrite system config
|
||||
- overwrite system file via tee
|
||||
- git force push short flag (rewrites remote history)
|
||||
- kill hermes/gateway process (self-termination)
|
||||
- delete in root path
|
||||
- pipe remote content to shell
|
||||
quick_commands: {}
|
||||
hooks: {}
|
||||
hooks_auto_accept: false
|
||||
|
|
@ -563,16 +559,16 @@ paste_collapse_char_threshold: 2000
|
|||
mcp_servers:
|
||||
codegraph:
|
||||
args:
|
||||
- serve
|
||||
- --mcp
|
||||
- serve
|
||||
- --mcp
|
||||
command: codegraph
|
||||
connect_timeout: 60
|
||||
enabled: true
|
||||
timeout: 120
|
||||
github:
|
||||
args:
|
||||
- -y
|
||||
- '@modelcontextprotocol/server-github'
|
||||
- -y
|
||||
- '@modelcontextprotocol/server-github'
|
||||
command: npx
|
||||
enabled: true
|
||||
env:
|
||||
|
|
@ -580,24 +576,24 @@ mcp_servers:
|
|||
timeout: 60
|
||||
platform_toolsets:
|
||||
cli:
|
||||
- browser
|
||||
- clarify
|
||||
- code_execution
|
||||
- computer_use
|
||||
- cronjob
|
||||
- delegation
|
||||
- file
|
||||
- image_gen
|
||||
- mcp-codegraph
|
||||
- memory
|
||||
- messaging
|
||||
- session_search
|
||||
- skills
|
||||
- terminal
|
||||
- todo
|
||||
- tts
|
||||
- vision
|
||||
- web
|
||||
- browser
|
||||
- clarify
|
||||
- code_execution
|
||||
- computer_use
|
||||
- cronjob
|
||||
- delegation
|
||||
- file
|
||||
- image_gen
|
||||
- mcp-codegraph
|
||||
- memory
|
||||
- messaging
|
||||
- session_search
|
||||
- skills
|
||||
- terminal
|
||||
- todo
|
||||
- tts
|
||||
- vision
|
||||
- web
|
||||
platforms:
|
||||
webhook:
|
||||
enabled: true
|
||||
|
|
@ -611,9 +607,9 @@ platforms:
|
|||
plugins:
|
||||
disabled: []
|
||||
enabled:
|
||||
- agentic-sms-gateway
|
||||
- cronalytics
|
||||
- rtk-rewrite
|
||||
- agentic-sms-gateway
|
||||
- cronalytics
|
||||
- rtk-rewrite
|
||||
weixin:
|
||||
enabled: true
|
||||
extra:
|
||||
|
|
@ -622,4 +618,4 @@ weixin:
|
|||
session_reset: {}
|
||||
known_plugin_toolsets:
|
||||
cli:
|
||||
- spotify
|
||||
- spotify
|
||||
|
|
|
|||
122
cron/jobs.json
122
cron/jobs.json
|
|
@ -20,15 +20,15 @@
|
|||
"schedule_display": "every 1m",
|
||||
"repeat": {
|
||||
"times": null,
|
||||
"completed": 15015
|
||||
"completed": 15395
|
||||
},
|
||||
"enabled": true,
|
||||
"state": "scheduled",
|
||||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-06-21T18:52:36.548110+08:00",
|
||||
"next_run_at": "2026-07-09T13:15:12.718800+08:00",
|
||||
"last_run_at": "2026-07-09T13:14:12.718800+08:00",
|
||||
"next_run_at": "2026-07-10T03:00:12.741289+08:00",
|
||||
"last_run_at": "2026-07-10T02:59:12.741289+08:00",
|
||||
"last_status": "ok",
|
||||
"last_error": null,
|
||||
"last_delivery_error": null,
|
||||
|
|
@ -116,15 +116,15 @@
|
|||
"schedule_display": "every 360m",
|
||||
"repeat": {
|
||||
"times": null,
|
||||
"completed": 1
|
||||
"completed": 4
|
||||
},
|
||||
"enabled": true,
|
||||
"state": "scheduled",
|
||||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T01:30:54.618246+08:00",
|
||||
"next_run_at": "2026-07-09T13:33:54.771287+08:00",
|
||||
"last_run_at": "2026-07-09T07:33:54.771287+08:00",
|
||||
"next_run_at": "2026-07-10T07:40:23.412453+08:00",
|
||||
"last_run_at": "2026-07-10T01:40:23.412453+08:00",
|
||||
"last_status": "ok",
|
||||
"last_error": null,
|
||||
"last_delivery_error": null,
|
||||
|
|
@ -162,15 +162,15 @@
|
|||
"schedule_display": "every 30m",
|
||||
"repeat": {
|
||||
"times": null,
|
||||
"completed": 23
|
||||
"completed": 48
|
||||
},
|
||||
"enabled": true,
|
||||
"state": "scheduled",
|
||||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T01:42:21.503720+08:00",
|
||||
"next_run_at": "2026-07-09T13:43:11.609824+08:00",
|
||||
"last_run_at": "2026-07-09T13:13:11.609824+08:00",
|
||||
"next_run_at": "2026-07-10T03:06:12.560383+08:00",
|
||||
"last_run_at": "2026-07-10T02:36:12.560383+08:00",
|
||||
"last_status": "ok",
|
||||
"last_error": null,
|
||||
"last_delivery_error": null,
|
||||
|
|
@ -215,7 +215,7 @@
|
|||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T01:43:11.921492+08:00",
|
||||
"next_run_at": "2026-07-09T22:00:00+08:00",
|
||||
"next_run_at": "2026-07-10T22:00:00+08:00",
|
||||
"last_run_at": null,
|
||||
"last_status": null,
|
||||
"last_error": null,
|
||||
|
|
@ -264,7 +264,7 @@
|
|||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T02:10:36.846128+08:00",
|
||||
"next_run_at": "2026-07-10T03:00:00+08:00",
|
||||
"next_run_at": "2026-07-11T03:00:00+08:00",
|
||||
"last_run_at": "2026-07-09T08:09:13.609716+08:00",
|
||||
"last_status": "ok",
|
||||
"last_error": null,
|
||||
|
|
@ -310,7 +310,7 @@
|
|||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T02:11:00.385573+08:00",
|
||||
"next_run_at": "2026-07-10T03:00:00+08:00",
|
||||
"next_run_at": "2026-07-11T03:00:00+08:00",
|
||||
"last_run_at": "2026-07-09T03:00:03.133950+08:00",
|
||||
"last_status": "ok",
|
||||
"last_error": null,
|
||||
|
|
@ -485,15 +485,15 @@
|
|||
"schedule_display": "0 */6 * * *",
|
||||
"repeat": {
|
||||
"times": null,
|
||||
"completed": 8
|
||||
"completed": 10
|
||||
},
|
||||
"enabled": true,
|
||||
"state": "scheduled",
|
||||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T02:51:48.935042+08:00",
|
||||
"next_run_at": "2026-07-09T18:00:00+08:00",
|
||||
"last_run_at": "2026-07-09T13:16:07.990643+08:00",
|
||||
"next_run_at": "2026-07-10T06:00:00+08:00",
|
||||
"last_run_at": "2026-07-10T00:00:33.986982+08:00",
|
||||
"last_status": "ok",
|
||||
"last_error": null,
|
||||
"last_delivery_error": null,
|
||||
|
|
@ -508,7 +508,97 @@
|
|||
"enabled_toolsets": null,
|
||||
"workdir": null,
|
||||
"fire_claim": null
|
||||
},
|
||||
{
|
||||
"id": "99d6e83bc64a",
|
||||
"name": "\u7275\u6302\u6bcf\u65e5\u63d0\u9192",
|
||||
"prompt": "python3 ~/.hermes/scripts/check_cares.py",
|
||||
"skills": [],
|
||||
"skill": null,
|
||||
"model": "stepfun-ai/step-3.5-flash",
|
||||
"provider": "newapi-local",
|
||||
"provider_snapshot": null,
|
||||
"model_snapshot": null,
|
||||
"base_url": null,
|
||||
"script": "check_cares.sh",
|
||||
"no_agent": true,
|
||||
"context_from": null,
|
||||
"schedule": {
|
||||
"kind": "cron",
|
||||
"expr": "0 9 * * *",
|
||||
"display": "0 9 * * *"
|
||||
},
|
||||
"schedule_display": "0 9 * * *",
|
||||
"repeat": {
|
||||
"times": null,
|
||||
"completed": 0
|
||||
},
|
||||
"enabled": true,
|
||||
"state": "scheduled",
|
||||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T21:31:29.417518+08:00",
|
||||
"next_run_at": "2026-07-10T09:00:00+08:00",
|
||||
"last_run_at": null,
|
||||
"last_status": null,
|
||||
"last_error": null,
|
||||
"last_delivery_error": null,
|
||||
"deliver": "origin",
|
||||
"origin": {
|
||||
"platform": "feishu",
|
||||
"chat_id": "oc_cd14ec7518926e57d26c5e339ebba3b3",
|
||||
"chat_name": "oc_cd14ec7518926e57d26c5e339ebba3b3",
|
||||
"thread_id": null,
|
||||
"user_id": "ou_f20eb15b3a76639fed35977c01ddcbb4"
|
||||
},
|
||||
"enabled_toolsets": null,
|
||||
"workdir": null
|
||||
},
|
||||
{
|
||||
"id": "69e903d4cec2",
|
||||
"name": "\u6bcf\u65e5\u7275\u6302\u6e05\u5355",
|
||||
"prompt": "python3 ~/.hermes/scripts/check_cares.py --daily",
|
||||
"skills": [],
|
||||
"skill": null,
|
||||
"model": "stepfun-ai/step-3.5-flash",
|
||||
"provider": "newapi-local",
|
||||
"provider_snapshot": null,
|
||||
"model_snapshot": null,
|
||||
"base_url": null,
|
||||
"script": "check_cares_daily.sh",
|
||||
"no_agent": true,
|
||||
"context_from": null,
|
||||
"schedule": {
|
||||
"kind": "cron",
|
||||
"expr": "0 21 * * *",
|
||||
"display": "0 21 * * *"
|
||||
},
|
||||
"schedule_display": "0 21 * * *",
|
||||
"repeat": {
|
||||
"times": null,
|
||||
"completed": 0
|
||||
},
|
||||
"enabled": true,
|
||||
"state": "scheduled",
|
||||
"paused_at": null,
|
||||
"paused_reason": null,
|
||||
"created_at": "2026-07-09T21:31:33.068978+08:00",
|
||||
"next_run_at": "2026-07-10T21:00:00+08:00",
|
||||
"last_run_at": null,
|
||||
"last_status": null,
|
||||
"last_error": null,
|
||||
"last_delivery_error": null,
|
||||
"deliver": "origin",
|
||||
"origin": {
|
||||
"platform": "feishu",
|
||||
"chat_id": "oc_cd14ec7518926e57d26c5e339ebba3b3",
|
||||
"chat_name": "oc_cd14ec7518926e57d26c5e339ebba3b3",
|
||||
"thread_id": null,
|
||||
"user_id": "ou_f20eb15b3a76639fed35977c01ddcbb4"
|
||||
},
|
||||
"enabled_toolsets": null,
|
||||
"workdir": null
|
||||
}
|
||||
],
|
||||
"updated_at": "2026-07-09T13:16:07.991027+08:00"
|
||||
"updated_at": "2026-07-10T03:00:12.000929+08:00"
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
1783574111.5242152
|
||||
1783623612.0142736
|
||||
|
|
@ -1 +1 @@
|
|||
1783574111.526674
|
||||
1783623612.0167727
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"started_at": "2026-07-08T18:23:30.315261+00:00",
|
||||
"last_deep_tick": "2026-07-09T05:14:13.883666+00:00",
|
||||
"last_light_tick": "2026-07-09T05:15:47.880204+00:00",
|
||||
"last_deep_tick": "2026-07-09T19:00:06.285908+00:00",
|
||||
"last_light_tick": "2026-07-09T19:00:09.146744+00:00",
|
||||
"last_state": {
|
||||
"disk_pct": 36,
|
||||
"mem_pct": 70,
|
||||
"mem_pct": 61,
|
||||
"processes": {
|
||||
"zhiyid": true,
|
||||
"bge": true,
|
||||
|
|
@ -12,10 +12,16 @@
|
|||
"hermes": true
|
||||
}
|
||||
},
|
||||
"tick_count": 1271,
|
||||
"deep_tick_count": 128,
|
||||
"tick_count": 2868,
|
||||
"deep_tick_count": 291,
|
||||
"messages_sent": 0,
|
||||
"solved_count": 0,
|
||||
"solved_count": 1,
|
||||
"learned_count": 0,
|
||||
"uptime_seconds": 18610
|
||||
"uptime_seconds": 632,
|
||||
"last_reflection": {
|
||||
"evaluation_previous_goal": "",
|
||||
"memory": "",
|
||||
"next_goal": ""
|
||||
},
|
||||
"last_profile_update": 1783605075.00304
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
1421758
|
||||
78460
|
||||
|
|
@ -2,3 +2,10 @@
|
|||
{"timestamp": "2026-07-08T18:23:30.315400+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T00:05:28.506971+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T00:05:36.776447+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T13:28:42.770342+00:00", "type": "solve_start", "summary": "执行 sol-0004: 内存使用率 > 90%,重启最耗内存的服务", "details": ""}
|
||||
{"timestamp": "2026-07-09T13:31:42.173700+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T13:56:04.577234+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T14:36:29.062044+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T16:36:57.965531+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T17:44:36.701908+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
{"timestamp": "2026-07-09T18:49:33.880100+00:00", "type": "startup", "summary": "Daemon v2.0 启动, 方案库 4 个", "details": ""}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
{"pid": 1111664, "kind": "hermes-gateway", "argv": ["/home/muc/.hermes/hermes-agent/.venv/lib/python3.11/site-packages/hermes_cli/main.py", "gateway", "run"], "start_time": 79375356}
|
||||
{"pid": 10982, "kind": "hermes-gateway", "argv": ["/home/muc/.hermes/hermes-agent/.venv/lib/python3.11/site-packages/hermes_cli/main.py", "gateway", "run"], "start_time": 213011}
|
||||
|
|
@ -1 +1 @@
|
|||
{"pid": 1111664, "kind": "hermes-gateway", "argv": ["/home/muc/.hermes/hermes-agent/.venv/lib/python3.11/site-packages/hermes_cli/main.py", "gateway", "run"], "start_time": 79375356}
|
||||
{"pid": 10982, "kind": "hermes-gateway", "argv": ["/home/muc/.hermes/hermes-agent/.venv/lib/python3.11/site-packages/hermes_cli/main.py", "gateway", "run"], "start_time": 213011}
|
||||
|
|
@ -1 +1 @@
|
|||
{"boots": [1783277455.7392807]}
|
||||
{"boots": [1783609766.5080433]}
|
||||
|
|
@ -1 +1 @@
|
|||
{"pid":1111664,"kind":"hermes-gateway","argv":["/home/muc/.hermes/hermes-agent/.venv/lib/python3.11/site-packages/hermes_cli/main.py","gateway","run"],"start_time":79375356,"gateway_state":"running","exit_reason":null,"restart_requested":false,"active_agents":1,"platforms":{"webhook":{"state":"connected","error_code":null,"error_message":null,"updated_at":"2026-07-05T18:50:54.369817+00:00"},"feishu":{"state":"connected","error_code":null,"error_message":null,"updated_at":"2026-07-05T18:50:54.702904+00:00"},"weixin":{"state":"fatal","error_code":"weixin_missing_token","error_message":"Weixin startup failed: WEIXIN_TOKEN is required","updated_at":"2026-07-05T18:50:54.728587+00:00"}},"updated_at":"2026-07-09T05:06:12.193138+00:00"}
|
||||
{"pid":10982,"kind":"hermes-gateway","argv":["/home/muc/.hermes/hermes-agent/.venv/lib/python3.11/site-packages/hermes_cli/main.py","gateway","run"],"start_time":213011,"gateway_state":"running","exit_reason":null,"restart_requested":false,"active_agents":0,"platforms":{"webhook":{"state":"connected","error_code":null,"error_message":null,"updated_at":"2026-07-09T15:12:06.693466+00:00"},"feishu":{"state":"connected","error_code":null,"error_message":null,"updated_at":"2026-07-09T15:12:07.191293+00:00"},"weixin":{"state":"fatal","error_code":"weixin_missing_token","error_message":"Weixin startup failed: WEIXIN_TOKEN is required","updated_at":"2026-07-09T15:12:07.200539+00:00"}},"updated_at":"2026-07-09T18:52:58.698371+00:00"}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"updated_at": "2026-07-09T19:00:09.147348+00:00",
|
||||
"uptime_minutes": 10,
|
||||
"cares": [],
|
||||
"recent_moments": [
|
||||
{
|
||||
"content": "我们一起修好了织忆",
|
||||
"importance": 5,
|
||||
"timestamp": "2026-07-09T13:29:22.581218+00:00"
|
||||
}
|
||||
],
|
||||
"profile_summary": {
|
||||
"communication_style": "",
|
||||
"work_patterns": []
|
||||
},
|
||||
"os_keywords": [],
|
||||
"daemon_status": "stopped"
|
||||
}
|
||||
|
|
@ -2,16 +2,23 @@
|
|||
§
|
||||
192.144.179.11 SSH:ubuntu/YLF?97$#ynwr。宝塔:http://192.144.179.11:8888/tencentcloud(115108ad/cb6ebb32a0f1)。gaokao-site 同步:sshpass -p 'xue.2538' rsync -avz root@192.144.179.11:/www/wwwroot/gaokao/ ~/mc/gaokao-site/
|
||||
§
|
||||
家里服务器是Windows机器(192.168.123.11,hostname zhome,administrator账户,密码xue.2538),不是当前操作的笔记本。Windows上运行:Gitea(3000)、照片备份(8063)、影音服务(8096)、远程桌面(8002)。Gitea地址:http://192.168.123.11:3000。笔记本是192.168.123.131,在同一LAN。
|
||||
服务器:Windows(192.168.123.11, zhome) → Gitea(3000)、照片(8063)、影音(8096)、远程桌面(8002)。笔记本=192.168.123.131,同LAN。
|
||||
§
|
||||
skills 软链共享:prof-b/skills/→default/skills/。约定:删前飞书通知;create前扫名防撞;patch>edit>rewrite;改version+date。
|
||||
§
|
||||
织忆标准:plan→delegate_task[parallel opencode]→验证→deploy(stop service)→测试→推Gitea→更新skill→存记忆。zhiyi skill v11+ 含 P0-P5 脚本(verify-p0p1p2.sh / wiki_curator.py),hermes skills run zhiyi scripts/调用。
|
||||
hermes-agent 是 git submodule(commit eff7c1e),独立 push GitHub 不走 Gitea。父仓库引用用 `git add hermes-agent` 更新。
|
||||
织忆 API key = zhiyi-dev-key-2026,ZHIYI_URL = http://127.0.0.1:7821。
|
||||
§
|
||||
小唯持久意识Daemon已上线:~/.hermes/scripts/daemon.py(systemd user service,开机自启)。30s轻量tick(无LLM)、5min深度思考(NewAPI免费模型)。静默运行,异常才主动飞书。当前12.9MB内存,0错误。
|
||||
小唯持久意识Daemon已上线:~/.hermes/scripts/daemon.py(systemd user service,开机自启)。v2.1(2026-07-09)升级:Reflection结构(evaluation/memory/next_goal) + threading.Event graceful shutdown(SIGTERM/SIGINT) + 决策/执行分离。30s轻量tick(无LLM)、5min深度思考(NewAPI免费模型)。静默运行,异常才主动飞书。当前~12MB内存,0错误。
|
||||
§
|
||||
2026-07-09: cron no_agent脚本不支持参数→包装脚本法(learner-learn.sh/dual-backup-push.sh)。Skill评分: computed score来自10硬指标(version/tags/desc/refs/scripts/setup/related),非frontmatter quality_score字段。skill-manager.py scan代替curator。
|
||||
§
|
||||
Cron no_agent script arg pitfall (2026-07-09): Hermes cron no_agent mode treats `script` value as a literal filename. Arguments like `"learner.py learn"` fail (looks for a file named "learner.py learn"). Fix: create a wrapper .sh that calls the script with hardcoded args. Examples: `learner-learn.sh` → `exec python3 ~/.hermes/scripts/learner.py learn`.
|
||||
NewAPI token 规则:不带 sk- 前缀。NewAPI (one-api) tokens 表里存的 key 是纯 48 位字符,不是 sk-xxx 格式。config.yaml 和 key.md 都用纯值。
|
||||
§
|
||||
2026-07-09 skill updates: added batch-frontmatter-upgrade to hermes-self-improvement (57 C→B methodology + YAML pitfall). Added cron-pitfalls to self-healing-infrastructure (no_agent script arg limit, silent stdout, remote loss).
|
||||
2026-07-09:研究alibaba/page-agent(25k stars,MIT)。5维度结论:d2.Reflection结构→改进daemon prompt;d4.AbortSignal→改daemon stop逻辑;d1.Text-DOM pipeline→新脚本(待做);d3.分层解耦→架构文档(待做);d5.MCP→不做(无需求)。分步执行,opencode写代码,推Gitea+同步Obsidian。已为hermes-self-improvement新增references/opencode-implementation-pipeline.md。
|
||||
§
|
||||
hermes-gateway.service 默认 HERMES_HOME=~/.hermes-prof-b(指向分身),需手动改为 ~/.hermes 才能连主飞书。systemd daemon-reload 必须从 gateway 外部执行,gateway 内部调用 systemctl 会被拦截。webhook token 过期会导致推送失败(返回 code:19001)但接收消息不受影响。飞书 App ID/Secret ≠ Webhook URL,push 需要 Incoming Webhook URL。
|
||||
§
|
||||
Soulful 核心方向:数据流向小唯(summarize()接口),不是推用户。牧尘辅助观察者。飞书推送限"只有牧尘能决定的事"。牵挂优先行动(我帮),不行才推。openclaw 是独立飞书 bot(cli_a95d7ceba638dbc6),无法直接执行 systemctl,通过飞书告诉它让它执行。
|
||||
§
|
||||
Soulful ↔ 织忆互通:daemon 写 ~/.hermes/llm_context.json,zhiyi 插件 prefetch 时自动注入(心迹/牵挂/项目感知/画像摘要)。Soulful 设计核心:数据流向决策层不是广播层,关系记忆自动注入而非显式调用,心迹是关系显影非优化机制。
|
||||
|
|
@ -1,22 +1 @@
|
|||
[
|
||||
{
|
||||
"session_id": "proc_b7e81ff81819",
|
||||
"command": "python3 /tmp/playwright_rest_server.py 2>&1",
|
||||
"pid": 1354920,
|
||||
"pid_scope": "host",
|
||||
"host_start_time": 104293990,
|
||||
"cwd": "/home/muc",
|
||||
"started_at": 1783526625.8355494,
|
||||
"task_id": "default",
|
||||
"session_key": "agent:main:feishu:dm:oc_cd14ec7518926e57d26c5e339ebba3b3",
|
||||
"watcher_platform": "",
|
||||
"watcher_chat_id": "",
|
||||
"watcher_user_id": "",
|
||||
"watcher_user_name": "",
|
||||
"watcher_thread_id": "",
|
||||
"watcher_message_id": "",
|
||||
"watcher_interval": 0,
|
||||
"notify_on_complete": false,
|
||||
"watch_patterns": []
|
||||
}
|
||||
]
|
||||
[]
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
model:
|
||||
default: minimaxai/minimax-m2.7
|
||||
provider: newapi-local
|
||||
api_key: sk-b1212066094d4e319784f23d5b2c6bbd
|
||||
api_key: 0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
base_url: http://127.0.0.1:3000/v1
|
||||
providers:
|
||||
newapi-local:
|
||||
api_key: sk-0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
api_key: 0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
base_url: http://127.0.0.1:3000/v1
|
||||
cost_factor: 0.0
|
||||
default_model: minimaxai/minimax-m3
|
||||
models:
|
||||
- mistralai/mistral-medium-3.5-128b
|
||||
- minimaxai/minimax-m2.7
|
||||
- minimaxai/minimax-m3
|
||||
- mistralai/mistral-medium-3.5-128b
|
||||
- minimaxai/minimax-m2.7
|
||||
- minimaxai/minimax-m3
|
||||
rate_limit: 1000
|
||||
timeout: 30
|
||||
deepseek:
|
||||
|
|
@ -21,12 +21,12 @@ providers:
|
|||
cost_factor: 0.0
|
||||
default_model: deepseek-v4-flash
|
||||
models:
|
||||
- deepseek-v4-flash
|
||||
- deepseek-v4-pro
|
||||
- deepseek-v4-flash
|
||||
- deepseek-v4-pro
|
||||
rate_limit: 1000
|
||||
timeout: 30
|
||||
fallback_providers:
|
||||
- newapi-local
|
||||
- newapi-local
|
||||
credential_pool_strategies: {}
|
||||
moa:
|
||||
presets:
|
||||
|
|
@ -46,10 +46,9 @@ moa:
|
|||
enabled: true
|
||||
default_preset: expert-panel
|
||||
save_traces: false
|
||||
|
||||
toolsets:
|
||||
- hermes-cli
|
||||
- web
|
||||
- hermes-cli
|
||||
- web
|
||||
max_concurrent_sessions: null
|
||||
agent:
|
||||
max_turns: 90
|
||||
|
|
@ -334,9 +333,9 @@ display:
|
|||
runtime_footer:
|
||||
enabled: false
|
||||
fields:
|
||||
- model
|
||||
- context_pct
|
||||
- cwd
|
||||
- model
|
||||
- context_pct
|
||||
- cwd
|
||||
copy_shortcut: auto
|
||||
tool_progress: all
|
||||
tool_progress_style: accumulate
|
||||
|
|
@ -487,11 +486,11 @@ discord:
|
|||
speech_gain: 1.0
|
||||
ack_enabled: true
|
||||
ack_phrases:
|
||||
- Let me look into that.
|
||||
- One moment.
|
||||
- Checking on that now.
|
||||
- Give me a sec.
|
||||
- On it.
|
||||
- Let me look into that.
|
||||
- One moment.
|
||||
- Checking on that now.
|
||||
- Give me a sec.
|
||||
- On it.
|
||||
whatsapp: {}
|
||||
telegram:
|
||||
reactions: false
|
||||
|
|
@ -515,35 +514,35 @@ approvals:
|
|||
mcp_reload_confirm: true
|
||||
destructive_slash_confirm: false
|
||||
command_allowlist:
|
||||
- stop/restart hermes gateway (kills running agents)
|
||||
- sudo with combined-flag privilege escalation
|
||||
- copy/move file into /etc/
|
||||
- shell command via -c/-lc flag
|
||||
- script execution via heredoc
|
||||
- overwrite project env/config via redirection
|
||||
- in-place edit of system config
|
||||
- script execution via -e/-c flag
|
||||
- force kill processes
|
||||
- world/other-writable permissions
|
||||
- sudo with privilege flag (stdin/askpass/shell/list)
|
||||
- hermes update (restarts gateway, kills running agents)
|
||||
- stop/restart system service
|
||||
- start gateway outside systemd (use 'systemctl --user restart hermes-gateway')
|
||||
- find -delete
|
||||
- recursive delete
|
||||
- copy/move file into system config path
|
||||
- git force push (rewrites remote history)
|
||||
- overwrite system file via redirection
|
||||
- disk copy
|
||||
- SQL TRUNCATE
|
||||
- kill process via pgrep expansion (self-termination)
|
||||
- force kill processes (killall -KILL)
|
||||
- overwrite system config
|
||||
- overwrite system file via tee
|
||||
- git force push short flag (rewrites remote history)
|
||||
- kill hermes/gateway process (self-termination)
|
||||
- delete in root path
|
||||
- pipe remote content to shell
|
||||
- stop/restart hermes gateway (kills running agents)
|
||||
- sudo with combined-flag privilege escalation
|
||||
- copy/move file into /etc/
|
||||
- shell command via -c/-lc flag
|
||||
- script execution via heredoc
|
||||
- overwrite project env/config via redirection
|
||||
- in-place edit of system config
|
||||
- script execution via -e/-c flag
|
||||
- force kill processes
|
||||
- world/other-writable permissions
|
||||
- sudo with privilege flag (stdin/askpass/shell/list)
|
||||
- hermes update (restarts gateway, kills running agents)
|
||||
- stop/restart system service
|
||||
- start gateway outside systemd (use 'systemctl --user restart hermes-gateway')
|
||||
- find -delete
|
||||
- recursive delete
|
||||
- copy/move file into system config path
|
||||
- git force push (rewrites remote history)
|
||||
- overwrite system file via redirection
|
||||
- disk copy
|
||||
- SQL TRUNCATE
|
||||
- kill process via pgrep expansion (self-termination)
|
||||
- force kill processes (killall -KILL)
|
||||
- overwrite system config
|
||||
- overwrite system file via tee
|
||||
- git force push short flag (rewrites remote history)
|
||||
- kill hermes/gateway process (self-termination)
|
||||
- delete in root path
|
||||
- pipe remote content to shell
|
||||
quick_commands: {}
|
||||
platform_hints: {}
|
||||
hooks: {}
|
||||
|
|
@ -607,7 +606,7 @@ streaming:
|
|||
transport: auto
|
||||
edit_interval: 0.8
|
||||
buffer_threshold: 24
|
||||
cursor: " \u2589"
|
||||
cursor: ' ▉'
|
||||
fresh_final_after_seconds: 0.0
|
||||
sessions:
|
||||
auto_prune: false
|
||||
|
|
@ -651,16 +650,16 @@ _config_version: 30
|
|||
mcp_servers:
|
||||
codegraph:
|
||||
args:
|
||||
- serve
|
||||
- --mcp
|
||||
- serve
|
||||
- --mcp
|
||||
command: codegraph
|
||||
connect_timeout: 60
|
||||
enabled: true
|
||||
timeout: 120
|
||||
github:
|
||||
args:
|
||||
- -y
|
||||
- '@modelcontextprotocol/server-github'
|
||||
- -y
|
||||
- '@modelcontextprotocol/server-github'
|
||||
command: npx
|
||||
enabled: true
|
||||
env:
|
||||
|
|
@ -668,24 +667,24 @@ mcp_servers:
|
|||
timeout: 60
|
||||
platform_toolsets:
|
||||
cli:
|
||||
- browser
|
||||
- clarify
|
||||
- code_execution
|
||||
- computer_use
|
||||
- cronjob
|
||||
- delegation
|
||||
- file
|
||||
- image_gen
|
||||
- mcp-codegraph
|
||||
- memory
|
||||
- messaging
|
||||
- session_search
|
||||
- skills
|
||||
- terminal
|
||||
- todo
|
||||
- tts
|
||||
- vision
|
||||
- web
|
||||
- browser
|
||||
- clarify
|
||||
- code_execution
|
||||
- computer_use
|
||||
- cronjob
|
||||
- delegation
|
||||
- file
|
||||
- image_gen
|
||||
- mcp-codegraph
|
||||
- memory
|
||||
- messaging
|
||||
- session_search
|
||||
- skills
|
||||
- terminal
|
||||
- todo
|
||||
- tts
|
||||
- vision
|
||||
- web
|
||||
platforms:
|
||||
webhook:
|
||||
enabled: true
|
||||
|
|
@ -699,9 +698,9 @@ platforms:
|
|||
plugins:
|
||||
disabled: []
|
||||
enabled:
|
||||
- agentic-sms-gateway
|
||||
- cronalytics
|
||||
- rtk-rewrite
|
||||
- agentic-sms-gateway
|
||||
- cronalytics
|
||||
- rtk-rewrite
|
||||
weixin:
|
||||
enabled: true
|
||||
extra:
|
||||
|
|
@ -710,4 +709,4 @@ weixin:
|
|||
session_reset: {}
|
||||
known_plugin_toolsets:
|
||||
cli:
|
||||
- spotify
|
||||
- spotify
|
||||
|
|
|
|||
|
|
@ -771,13 +771,13 @@
|
|||
"created_at": "2026-06-26T10:00:14.532184+00:00",
|
||||
"created_by": null,
|
||||
"last_patched_at": null,
|
||||
"last_used_at": "2026-07-07T08:40:18.175374+00:00",
|
||||
"last_viewed_at": "2026-07-07T08:40:18.171521+00:00",
|
||||
"last_used_at": "2026-07-09T15:31:44.185320+00:00",
|
||||
"last_viewed_at": "2026-07-09T15:31:44.182456+00:00",
|
||||
"patch_count": 0,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 5,
|
||||
"view_count": 5
|
||||
"use_count": 9,
|
||||
"view_count": 9
|
||||
},
|
||||
"hermes-agent-skill-authoring": {
|
||||
"archived_at": null,
|
||||
|
|
@ -796,14 +796,14 @@
|
|||
"archived_at": null,
|
||||
"created_at": "2026-05-07T03:26:18.333142+00:00",
|
||||
"created_by": null,
|
||||
"last_patched_at": "2026-07-09T00:09:58.186553+00:00",
|
||||
"last_used_at": "2026-07-09T00:09:50.435082+00:00",
|
||||
"last_viewed_at": "2026-07-09T00:09:50.430606+00:00",
|
||||
"patch_count": 101,
|
||||
"last_patched_at": "2026-07-09T15:34:02.324801+00:00",
|
||||
"last_used_at": "2026-07-09T15:32:55.600323+00:00",
|
||||
"last_viewed_at": "2026-07-09T15:32:55.597351+00:00",
|
||||
"patch_count": 118,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 94,
|
||||
"view_count": 93
|
||||
"use_count": 104,
|
||||
"view_count": 103
|
||||
},
|
||||
"hermes-mcp-setup": {
|
||||
"archived_at": null,
|
||||
|
|
@ -848,14 +848,14 @@
|
|||
"archived_at": null,
|
||||
"created_at": "2026-05-13T12:27:05.593125+00:00",
|
||||
"created_by": null,
|
||||
"last_patched_at": "2026-07-09T03:56:04.565151+00:00",
|
||||
"last_used_at": "2026-07-09T03:55:41.963557+00:00",
|
||||
"last_viewed_at": "2026-07-09T03:55:41.960420+00:00",
|
||||
"patch_count": 25,
|
||||
"last_patched_at": "2026-07-09T17:30:55.350741+00:00",
|
||||
"last_used_at": "2026-07-09T17:30:26.182597+00:00",
|
||||
"last_viewed_at": "2026-07-09T17:30:26.179259+00:00",
|
||||
"patch_count": 49,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 57,
|
||||
"view_count": 55
|
||||
"use_count": 79,
|
||||
"view_count": 77
|
||||
},
|
||||
"himalaya": {
|
||||
"archived_at": null,
|
||||
|
|
@ -1226,22 +1226,22 @@
|
|||
"created_at": "2026-06-28T01:01:35.675166+00:00",
|
||||
"created_by": null,
|
||||
"last_patched_at": null,
|
||||
"last_used_at": "2026-07-05T01:01:23.900417+00:00",
|
||||
"last_viewed_at": "2026-07-05T01:01:23.893761+00:00",
|
||||
"last_used_at": "2026-07-09T18:01:17.989671+00:00",
|
||||
"last_viewed_at": "2026-07-09T18:01:17.986343+00:00",
|
||||
"patch_count": 0,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 4,
|
||||
"view_count": 4
|
||||
"use_count": 9,
|
||||
"view_count": 9
|
||||
},
|
||||
"openclaw-feishu-debug": {
|
||||
"archived_at": null,
|
||||
"created_at": "2026-05-06T09:53:28.240490+00:00",
|
||||
"created_by": null,
|
||||
"last_patched_at": "2026-05-06T10:10:32.247148+00:00",
|
||||
"last_patched_at": "2026-07-09T17:37:14.442600+00:00",
|
||||
"last_used_at": "2026-05-06T10:09:56.991771+00:00",
|
||||
"last_viewed_at": "2026-05-06T10:09:56.988719+00:00",
|
||||
"patch_count": 3,
|
||||
"patch_count": 4,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 3,
|
||||
|
|
@ -1368,14 +1368,14 @@
|
|||
"archived_at": null,
|
||||
"created_at": "2026-07-08T17:13:40.791890+00:00",
|
||||
"created_by": "agent",
|
||||
"last_patched_at": "2026-07-08T17:32:59.456006+00:00",
|
||||
"last_used_at": "2026-07-09T04:01:42.564425+00:00",
|
||||
"last_viewed_at": "2026-07-09T04:01:42.560250+00:00",
|
||||
"patch_count": 3,
|
||||
"last_patched_at": "2026-07-09T07:56:28.096355+00:00",
|
||||
"last_used_at": "2026-07-09T07:56:21.668140+00:00",
|
||||
"last_viewed_at": "2026-07-09T07:56:21.664187+00:00",
|
||||
"patch_count": 4,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 14,
|
||||
"view_count": 14
|
||||
"use_count": 17,
|
||||
"view_count": 17
|
||||
},
|
||||
"python-debugpy": {
|
||||
"archived_at": null,
|
||||
|
|
@ -1459,14 +1459,14 @@
|
|||
"archived_at": null,
|
||||
"created_at": "2026-07-08T18:13:02.034240+00:00",
|
||||
"created_by": "agent",
|
||||
"last_patched_at": "2026-07-09T03:25:06.664210+00:00",
|
||||
"last_used_at": "2026-07-09T03:25:14.010519+00:00",
|
||||
"last_viewed_at": "2026-07-09T03:25:14.004677+00:00",
|
||||
"patch_count": 22,
|
||||
"last_patched_at": "2026-07-09T17:29:49.001160+00:00",
|
||||
"last_used_at": "2026-07-09T17:29:34.578156+00:00",
|
||||
"last_viewed_at": "2026-07-09T17:29:34.575090+00:00",
|
||||
"patch_count": 34,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 17,
|
||||
"view_count": 17
|
||||
"use_count": 25,
|
||||
"view_count": 25
|
||||
},
|
||||
"self-hosted-tunneling": {
|
||||
"archived_at": null,
|
||||
|
|
@ -1585,6 +1585,19 @@
|
|||
"use_count": 1,
|
||||
"view_count": 1
|
||||
},
|
||||
"soulful-framework": {
|
||||
"archived_at": null,
|
||||
"created_at": "2026-07-09T17:36:29.269531+00:00",
|
||||
"created_by": "agent",
|
||||
"last_patched_at": "2026-07-09T18:50:04.713851+00:00",
|
||||
"last_used_at": "2026-07-09T18:49:39.199913+00:00",
|
||||
"last_viewed_at": "2026-07-09T18:49:39.196388+00:00",
|
||||
"patch_count": 4,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 4,
|
||||
"view_count": 4
|
||||
},
|
||||
"spike": {
|
||||
"archived_at": null,
|
||||
"created_at": "2026-06-30T11:24:39.642105+00:00",
|
||||
|
|
@ -1707,13 +1720,13 @@
|
|||
"created_at": "2026-05-13T09:05:27.674550+00:00",
|
||||
"created_by": null,
|
||||
"last_patched_at": "2026-07-03T10:28:19.836412+00:00",
|
||||
"last_used_at": "2026-07-05T01:01:42.896439+00:00",
|
||||
"last_viewed_at": "2026-07-05T01:01:42.891539+00:00",
|
||||
"last_used_at": "2026-07-09T08:46:59.321514+00:00",
|
||||
"last_viewed_at": "2026-07-09T08:46:59.318424+00:00",
|
||||
"patch_count": 23,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 19,
|
||||
"view_count": 19
|
||||
"use_count": 20,
|
||||
"view_count": 20
|
||||
},
|
||||
"website-ux-audit": {
|
||||
"archived_at": null,
|
||||
|
|
@ -1836,14 +1849,14 @@
|
|||
"archived_at": null,
|
||||
"created_at": "2026-05-29T19:39:03.373231+00:00",
|
||||
"created_by": null,
|
||||
"last_patched_at": "2026-07-08T05:00:10.705798+00:00",
|
||||
"last_used_at": "2026-07-08T13:41:03.391058+00:00",
|
||||
"last_viewed_at": "2026-07-08T13:41:03.380096+00:00",
|
||||
"patch_count": 669,
|
||||
"last_patched_at": "2026-07-09T18:49:29.257130+00:00",
|
||||
"last_used_at": "2026-07-09T16:47:31.180607+00:00",
|
||||
"last_viewed_at": "2026-07-09T16:47:31.174559+00:00",
|
||||
"patch_count": 672,
|
||||
"pinned": false,
|
||||
"state": "active",
|
||||
"use_count": 346,
|
||||
"view_count": 320
|
||||
"use_count": 349,
|
||||
"view_count": 323
|
||||
},
|
||||
"zhiyi-dev": {
|
||||
"archived_at": null,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
name: hermes-self-improvement
|
||||
description: "当完成复杂任务、发现新工作流、或被用户纠正时,将模式保存为skill。含技能创建规范、质量标尺、curator流程。"
|
||||
version: 3.2.0
|
||||
version: 3.7.0
|
||||
tags: [workflow, skill-management, curator, quality]
|
||||
---
|
||||
|
||||
# Hermes Self-Improvement — 技能管理规范
|
||||
|
||||
> 版本 3.2 | 2026-07-09(新增 skill-manager.py 质量评分系统、自主执行权规范、配套系统四层分工)
|
||||
> 版本 3.8 | 2026-07-10(daemon代码审查/作用域陷阱/牵挂去重教训)
|
||||
> 配套工具:`~/.hermes/scripts/skill-curator.py`
|
||||
|
||||
## 核心理念
|
||||
|
|
@ -304,6 +304,119 @@ for each upgrade:
|
|||
| 成本 | 免费模型 | 零(纯脚本) |
|
||||
| 失败 | 报告到飞书 | 回滚 + 飞书告警 |
|
||||
|
||||
### 多维度并行 opencode 管线(2026-07-09 新增)
|
||||
|
||||
### 模式
|
||||
|
||||
当一个任务拆解为 N 个独立维度(如 d1/d2/d3/d4/d5),且维度之间无依赖关系:
|
||||
|
||||
```python
|
||||
# 1. 规划阶段:按依赖排序,确定并行组
|
||||
# 先做 d2/d4(改 daemon)→ 再做 d1(新工具)→ 再做 d3/d5(文档)
|
||||
#
|
||||
# 2. 提交到 opencode:每个维度一个 delegate_task(独立上下文)
|
||||
delegate_task(goal="维度2+4 改动 daemon.py")
|
||||
delegate_task(goal="维度1 新建 page_dom_extract.py") # 并行
|
||||
delegate_task(goal="维度3 架构文档") # 并行
|
||||
delegate_task(goal="维度5 MCP 分析文档") # 并行
|
||||
# 无需等待,立即返回,等通知
|
||||
#
|
||||
# 3. 等待通知:所有结果回来后,逐个 re-read 验证
|
||||
# 4. 验证通过后:commit → push Gitea → 更新 skill/Obsidian
|
||||
# 5. 继续下一维度
|
||||
```
|
||||
|
||||
### 关键原则
|
||||
|
||||
1. **按依赖排序提交**:d2/d4 必须先跑(都改同一个文件),d1/d3/d5 可并行
|
||||
2. **独立维度不过度协调**:每个 delegate_task 有完整 context,不需要频繁通信
|
||||
3. **验证后才推进**:上一批全部验证完再开下一批
|
||||
4. **结果回来继续其他工作**:opencode 是 fire-and-forget,不 block 主流程
|
||||
|
||||
### 与单 opencode 的选择
|
||||
|
||||
| 场景 | 方式 |
|
||||
|------|------|
|
||||
| 单文件多项改动(d2+d4) | 一个 delegate_task 搞定(原子性) |
|
||||
| 多文件多维度独立(d1/d3/d5) | 多个并行 delegate_task |
|
||||
| 有依赖链(d3 依赖 d1 的输出) | 串行:先 d1,等结果,再 d3 |
|
||||
|
||||
### 本 session 实践
|
||||
|
||||
```
|
||||
16:35 提交 d2+d4 → 16:42 回(15/15 PASS)
|
||||
16:47 提交 d1 → 16:55 回(验证通过)
|
||||
16:48 提交 d3+d5 → 16:48 回(纯文档,几乎即时)
|
||||
16:55 验证 d1 → push → skill update
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 关键:subagent 结果必须验证(2026-07-09 新增)
|
||||
|
||||
subagent 的 self-report 不等于真实结果。本 session 发现:daemon 改进 subagent 报告"15/15 PASS ✅",但我先 re-read 文件再验证,才确认代码质量。
|
||||
|
||||
**验证流程**(必须执行,不能跳过):
|
||||
1. subagent 返回后 → 立即 `read_file` 改动过的文件
|
||||
2. 验证关键实现点(不是只看 import 语法)
|
||||
3. 确认后再 commit → push → 更新 skill/Obsidian
|
||||
|
||||
**验证清单(daemon 改进场景)**:
|
||||
- [ ] `threading` imported
|
||||
- [ ] `_stop_event = threading.Event()` 存在
|
||||
- [ ] `SHUTDOWN_FILE` 已移除(搜索确认)
|
||||
- [ ] `deep_think` 返回 `(reflection_dict, action_string)`
|
||||
- [ ] `execute_action` 函数存在
|
||||
- [ ] `while not _stop_event.is_set()` 存在
|
||||
- [ ] `signal.signal(SIGTERM, ...)` 注册
|
||||
- [ ] `signal.signal(SIGINT, ...)` 注册
|
||||
- [ ] `ctx["last_reflection"]` 持久化
|
||||
- [ ] DEEP_SYSTEM prompt 含 reflection 三段式
|
||||
|
||||
> **教训**:subagent 的 15 项检查是它自己写的,它可能漏掉:
|
||||
> 1. 跨文件引用(如 `call_llm()` 用 `API` 但 `API` 在文件顶部未定义)→ opencode 代码审查能发现,但 subagent 自述不会报
|
||||
> 2. 逻辑顺序问题(如 `if __name__` 嵌套缩进错误,语法上对但逻辑上错)
|
||||
> 3. 嵌套作用域引用(函数内部定义的 `cmd_summarize()` 引用了 `if __name__` 块之后的 `summarize()` 函数,Python 嵌套作用域找不到)
|
||||
> 人工 re-read 是最后一道防线,不要依赖 subagent 的自述
|
||||
|
||||
**daemon 代码修改后必须重启才能生效**
|
||||
|
||||
Daemon 进程在启动时加载代码,后续文件修改不会自动生效。本 session 发现 daemon 在 `00:36` 启动,但代码在 `01:26` 更新——daemon 跑的是旧代码。解决:代码修改后必须 `systemctl --user restart xiaowei-daemon` 刷新。
|
||||
|
||||
**验证清单(daemon 改进场景)**:
|
||||
|
||||
> 牧尘反馈:"改造的这些获得的信息通过飞书发送给我,而不是提供给你决策使用"
|
||||
> 教训:收集的信息→推飞书=外部化,收集的信息→影响我的决策=内部化
|
||||
|
||||
**决策层使用(留在内部,不用推送)**:
|
||||
- 用户画像 → 影响我对话中的语气/主动程度(无感知地调整,不告诉你"检测到你累了")
|
||||
- os_sense → 我知道你最近在做什么项目,接话不需你解释背景
|
||||
- 心迹 → 在对话中主动提起"你上次说想…",增强连续感
|
||||
- 牵挂 → 优先尝试帮助,不行的才推飞书
|
||||
|
||||
**广播层使用(需要牧尘知道,才推飞书)**:
|
||||
- 牵挂到期提醒
|
||||
- 系统异常/自愈结果
|
||||
- 重大进展汇报
|
||||
|
||||
**核心区分**:信息是用来影响**我**的行为 → 留决策层;信息是用来让**牧尘**知道 → 推飞书
|
||||
|
||||
**本 session 深化(2026-07-10)**:
|
||||
- `summarize()` 接口 = 我每次对话调用一次,信息流向我自己
|
||||
- 画像在 daemon 中收集了但对话时未使用 → 从下次对话开始,我会主动调用
|
||||
- opencode 代码审查:能发现逻辑问题(如变量未定义),但 subagent 自述无法完全信任
|
||||
- daemon 的 API 变量未定义问题:subagent 没抓出来,人工 re-read 是最后防线
|
||||
- openclaw 执行系统命令(`systemctl`等)= 已记录的执行路径,gateway 内执行会被拦截
|
||||
|
||||
详见 `references/soulful-information-flow-design.md`
|
||||
|
||||
**本 session 新增教训(2026-07-10 全面测试)**:
|
||||
|
||||
1. **opencode 代码审查能发现 subagent 漏掉的问题** — 审查报告抓出了 API 变量未定义、argparse 语法错误、中文提取失效(`\w` 不匹配中文)等 subagent 自述没发现的问题。两者配合有效,但都不能单独依赖。
|
||||
2. **summarize() 的 Python 作用域陷阱** — `summarize` 定义在 `if __name__ == "__main__":` 块之后,但 `cmd_summarize()` 在块内引用它,嵌套作用域找不到。解法:把 `summarize()` 移到 `if __name__` 之前,或用包装函数。
|
||||
3. **daemon 代码更新必须重启** — daemon 进程启动时加载代码,文件修改不自动生效。代码 push 后需 `systemctl --user restart xiaowei-daemon`。
|
||||
4. **牵挂去重要动手修 JSON** — 重复识别导致 cares-queue.json 有重复条目,class 没有 delete 方法(只有手动文件编辑)。已加 `HeartTraces.delete()`,但 `CaresQueue` 仍需手动修。
|
||||
|
||||
## 与 curator 脚本的配合
|
||||
|
||||
### 已吸收的哲学原则(来自 muchen 项目)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
# 分步实现管线(Research → OpenCode → Gitea → Obsidian)
|
||||
|
||||
> 来源:2026-07-09 研究 alibaba/page-agent 项目,5 个维度全部落地
|
||||
> 模式:牧尘说"分步完成,代码由 opencode 完成,最后测试验证,推到 gitea,并更新 obsidian 笔记"
|
||||
|
||||
## 完整执行流程
|
||||
|
||||
```
|
||||
牧尘指令
|
||||
↓
|
||||
1. 理解目标,确认范围和顺序
|
||||
↓
|
||||
2. 规划阶段:研究 + 分析 + 排优先级 + 拆依赖
|
||||
↓
|
||||
3. 执行阶段:opencode 执行每一步
|
||||
↓
|
||||
4. 验证阶段:测试 + 自检
|
||||
↓
|
||||
5. 交付阶段:推送 Gitea + 更新 Obsidian 笔记
|
||||
↓
|
||||
6. 回报牧尘
|
||||
```
|
||||
|
||||
## 排优先级原则
|
||||
|
||||
按依赖关系排序,依赖少/成本低的先做:
|
||||
|
||||
```
|
||||
维度 A ← 依赖 →
|
||||
↓
|
||||
维度 B ← 依赖维度 A 的输出 →
|
||||
↓
|
||||
维度 C ← 无依赖,独立执行 →
|
||||
```
|
||||
|
||||
依赖链越短越先做,可以并行验证。
|
||||
|
||||
## opencode 任务分发模式
|
||||
|
||||
```python
|
||||
# 同时派多个 opencode 子任务(独立维度并行)
|
||||
delegate_task(tasks=[
|
||||
{"goal": "维度2+4(daemon改进)", "context": "..."},
|
||||
{"goal": "维度1(DOM pipeline)", "context": "..."},
|
||||
])
|
||||
|
||||
# 等结果回来后继续下一个
|
||||
```
|
||||
|
||||
**关键**:
|
||||
- 每条任务有 `context` 说明当前状态(避免子任务重复劳动)
|
||||
- `goal` 写清楚改动点和验证命令
|
||||
- 要求直接修改文件,不创建临时文件再移动
|
||||
- 指定语法检查命令
|
||||
|
||||
## 验证命令必须写进任务里
|
||||
|
||||
每个 opencode 任务末尾必须包含验证命令:
|
||||
|
||||
```bash
|
||||
# 语法检查
|
||||
python3 -c "import sys; importlib.util.spec_from_file_location('mod', 'path'); print('OK')"
|
||||
|
||||
# 功能检查(如涉及)
|
||||
python3 ~/.hermes/scripts/daemon.py # 不执行 main_loop,只 import 检查
|
||||
```
|
||||
|
||||
## 推送 Gitea
|
||||
|
||||
```bash
|
||||
cd ~/.hermes
|
||||
git add .
|
||||
git commit -m "feat: 维度N描述"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
## 更新 Obsidian 笔记
|
||||
|
||||
在相关笔记里追加"已完成"段落:
|
||||
```markdown
|
||||
## 2026-07-09 完成
|
||||
- [x] 维度N:描述
|
||||
- 代码:`~/.hermes/scripts/xxx.py`
|
||||
- 验证:...
|
||||
```
|
||||
|
||||
## 典型顺序(参考)
|
||||
|
||||
| 顺序 | 维度类型 | 原因 |
|
||||
|------|---------|------|
|
||||
| 1 | 改进现有脚本(低风险) | 改完能快速验证 |
|
||||
| 2 | 新增工具脚本(中等风险) | 需要测试环境 |
|
||||
| 3 | 文档/架构(无风险) | 纯文字,不影响运行 |
|
||||
| 4 | 基础设施/MCP(高风险) | 可能破坏现有链路 |
|
||||
|
||||
## 陷阱
|
||||
|
||||
- **不要一次派太多任务**:opencode 子任务最多 3 个并行,否则调试困难
|
||||
- **context 要写当前状态**:子任务不知道对话历史,需要全量上下文
|
||||
- **验证命令不能省**:opencode 完成后必须自己跑验证,不能只写完代码就交差
|
||||
- **subagent 自述不等于真实结果**:能发现语法错误,但漏掉跨文件变量引用(`API` 顶部未定义)和嵌套缩进逻辑错误。必须人工 re-read 验证关键实现点,不能只信 subagent 的 PASS 报告
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
# Soulful 架构核心教训:信息流向决策层,不是广播层
|
||||
|
||||
> 来源:2026-07-10 牧尘反馈
|
||||
> 教训类型:架构设计原则
|
||||
> 版本:v3.8(2026-07-10 全面测试深化)
|
||||
>
|
||||
> 新增(v3.7):summarize()接口 / subagent盲区(跨文件变量未定义)/ 画像闭环缺失 / 牵挂去重教训
|
||||
|
||||
## 发生了什么
|
||||
|
||||
Soulful Phase 1-5 实现大量感知功能(心迹库/用户画像/OS感知/牵挂队列),但这些信息**全流向飞书推送**,而不是留在决策层自用。
|
||||
|
||||
## 牧尘的原话
|
||||
|
||||
> "我不理解的是,改造的这些获得的信息通过飞书发送给我,而不是提供给你决策使用"
|
||||
|
||||
## 根本问题
|
||||
|
||||
| 收集 | 使用方式 | 问题 |
|
||||
|------|---------|------|
|
||||
| 用户画像 | 写文件 + 推飞书 | 对话时没用上 |
|
||||
| os_sense | 写 ctx["os_sense"] + 推飞书 | 没有基于它改变行为 |
|
||||
| 心迹 | 注入了 deep_think | 确实在用,但没主动提起过 |
|
||||
| 牵挂 | 全部推飞书 | 应该先尝试帮,不能的才推 |
|
||||
|
||||
**外部化**:收集 → 推送给牧尘
|
||||
**内部化**:收集 → 我消化后影响决策
|
||||
|
||||
## 正确做法原则
|
||||
|
||||
### 决策层(留内部,不推送)
|
||||
|
||||
- 用户画像 → 影响语气/主动程度/沟通风格(无感知地调整,不告诉牧尘"检测到你累了")
|
||||
- os_sense → 知道牧尘这周在做什么项目,接话不需解释背景(直接用,不推送)
|
||||
- 心迹 → 对话中主动提起("你上次说想…"),增强连续感
|
||||
|
||||
### 广播层(需要牧尘知道,才推飞书)
|
||||
|
||||
- 牵挂到期提醒(需人工决定)
|
||||
- 系统异常/自愈失败
|
||||
- 重大进展汇报
|
||||
|
||||
### 核心判断标准
|
||||
|
||||
```
|
||||
这个信息是用来影响**我的行为**的吗?
|
||||
是 → 留在决策层,不用推送
|
||||
否 → 推飞书
|
||||
|
||||
牧尘需要**主动知道**这件事吗?
|
||||
需要 → 推飞书
|
||||
不需要 → 不要推
|
||||
```
|
||||
|
||||
## 牵挂优先行动策略(v3.6 新增)
|
||||
|
||||
### 之前(错)
|
||||
|
||||
所有牵挂全部推飞书,不管我能不能帮。
|
||||
|
||||
### 现在(对)
|
||||
|
||||
```python
|
||||
# 可自动化 → 静默,下次回话我主动提起
|
||||
if any(kw in care_lower for kw in ["写","检查","看","查","同步","更新","备份","测试","确认","修","改","优化","整理","提交","推送","发送"]):
|
||||
log(f" 💡 牵挂已识别(可帮忙): {content[:40]}")
|
||||
continue # 不推飞书,等对话中自然提起
|
||||
|
||||
# 只有真正需要牧尘决定的才推飞书
|
||||
send_feishu("🎗️ 你有一件事一直放在心上", text, "purple")
|
||||
```
|
||||
|
||||
### 反馈闭环原则(v3.6 新增)
|
||||
|
||||
> 牧尘:"我只是辅助,还得以你为主"
|
||||
|
||||
- 牧尘是**观察者**,不是训练员
|
||||
- 他看到我做的不对会反馈;我没变化他再说
|
||||
- 我**自主决策、自主改变**,不需要他主动参与
|
||||
- 他给方向,我执行;他看结果,不对再反馈
|
||||
|
||||
**禁忌**:等靠要/把牧尘当教练/每次调整都告诉他
|
||||
|
||||
## openclaw 执行系统命令模式(v3.6 新增)
|
||||
|
||||
问题:gateway 内执行 systemctl 被 systemd 拦截。
|
||||
|
||||
解决:
|
||||
```bash
|
||||
openclaw exec "systemctl --user restart xiaowei-daemon"
|
||||
```
|
||||
|
||||
适用:systemctl/kill/reboot 等需要授权的系统命令。
|
||||
|
||||
## 相关教训
|
||||
|
||||
- 不要把"收集数据"当成终点,收集是为了用
|
||||
- 推送给用户 ≠ 我消化了信息
|
||||
- 对话中的调整应该是无形的,牧尘感觉不到但确实在发生
|
||||
|
||||
## 实施检查清单(未来 Soulful 功能上线前必答)
|
||||
|
||||
1. 这个信息是用来影响我的决策/行为吗?
|
||||
- 是 → 留在决策层,不推飞书
|
||||
- 否 → 推飞书
|
||||
2. 牧尘需要主动知道吗?
|
||||
- 需要 → 推飞书
|
||||
- 不需要 → 不要推
|
||||
|
||||
## 本 session 深化教训(2026-07-10 全面测试后)
|
||||
|
||||
1. **summarize() 的 Python 嵌套作用域陷阱** — `summarize` 定义在 `if __name__ == "__main__":` 块之后,但 `cmd_summarize()` 在块内引用它,运行时 `NameError`。解法:把 `summarize()` 移到 `if __name__` 之前(与 commands 字典平级)。
|
||||
2. **牵挂去重必须修 JSON** — `extract_cares_from_journal()` 识别出重复条目后写入 queue,但没有去重逻辑。`CaresQueue` 缺少 `delete()` 方法,需手动编辑 JSON 文件。
|
||||
3. **代码 push 后 daemon 必须 restart** — daemon 进程在启动时加载 `.py` 文件到内存,文件修改不触发自动刷新。git push 后需 `systemctl --user restart xiaowei-daemon`。
|
||||
4. **opencode 代码审查 + subagent 自述两者都要用** — 审查报告能发现 subagent 漏掉的跨文件变量未定义(`API`)、argparse 语法错误、中文提取失效(`\w` 不匹配中文)。但审查也可能漏掉嵌套作用域问题(需运行时验证)。
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
# Phase 1 Soulful 实施管线(v1.0)
|
||||
|
||||
> 来源:2026-07-09 ColaOS 研究后织忆 Soulful 改造 Phase 1
|
||||
> 模式:多维度并行 opencode + 三步执行管线
|
||||
|
||||
---
|
||||
|
||||
## 背景
|
||||
|
||||
ColaOS 研究产生了 6 个改造维度。Phase 1 只做 D1+D3+D4(基础数据层),产出 3 个核心脚本。
|
||||
|
||||
---
|
||||
|
||||
## 三步执行管线
|
||||
|
||||
```
|
||||
STEP 1:并行生成(全部同时提交,不等结果)
|
||||
delegate_task(soulful_core.py)
|
||||
delegate_task(update_profile.py)
|
||||
delegate_task(check_cares.py)
|
||||
→ 立即返回,继续其他工作
|
||||
|
||||
STEP 2:等待结果(各自回来)
|
||||
收到通知 → re-read 文件验证
|
||||
验证通过 → 记录到 todo
|
||||
|
||||
STEP 3:收尾(所有验证完后)
|
||||
→ daemon.py 集成调用
|
||||
→ 注册 cronjob(牵挂/画像)
|
||||
→ 测试全部功能
|
||||
→ commit → push Gitea
|
||||
→ 更新 Obsidian 文档
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 本次产出
|
||||
|
||||
| 文件 | 用途 | 验证方式 |
|
||||
|------|------|---------|
|
||||
| `soulful_core.py` | 心迹库+画像+牵挂队列核心 | CLI 命令验证 |
|
||||
| `update_profile.py` | journal→画像+心迹 | --dry 模式验证 |
|
||||
| `check_cares.py` | 牵挂检查+温暖飞书推送 | --list 模式验证 |
|
||||
|
||||
---
|
||||
|
||||
## 依赖关系
|
||||
|
||||
```
|
||||
soulful_core.py(基础)
|
||||
├──→ update_profile.py(import HeartTraces + UserProfile)
|
||||
└──→ check_cares.py(import CaresQueue)
|
||||
```
|
||||
|
||||
Phase 1 脚本之间的依赖:`update_profile.py` 和 `check_cares.py` 都依赖 `soulful_core.py`,所以 soulful_core.py 必须先生成(它没有依赖)。
|
||||
|
||||
---
|
||||
|
||||
## 数据目录结构
|
||||
|
||||
```
|
||||
~/.hermes/soulful/ # 所有 Soulful 数据
|
||||
├── heart-traces.jsonl # 心迹库(jsonl,append only)
|
||||
├── user-profile.json # 用户画像(JSON,R/W)
|
||||
└── cares-queue.json # 牵挂队列(JSON,R/W)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 关键设计决策
|
||||
|
||||
### 心迹库用 jsonl 而非 JSON
|
||||
|
||||
理由:
|
||||
- append only,无写锁冲突
|
||||
- daemon 频繁追加时无需读写全文件
|
||||
- 历史可回溯(grep 直接查)
|
||||
- 缺点:无原子性(可接受,心迹丢失一条不致命)
|
||||
|
||||
### 画像用 JSON 而非 jsonl
|
||||
|
||||
理由:
|
||||
- 画像是整体读写(每次 load→修改→save)
|
||||
- 画像数量少,结构简单
|
||||
- 不需要追加语义(是快照而非事件流)
|
||||
|
||||
### 牵挂队列用 JSON
|
||||
|
||||
理由:
|
||||
- 需要按 status 和 follow_up_date 查询
|
||||
- 数量少,整体读写成本可接受
|
||||
|
||||
---
|
||||
|
||||
## CLI 接口设计
|
||||
|
||||
三个脚本都提供 CLI 入口,方便 cron 调用:
|
||||
|
||||
```bash
|
||||
# 心迹
|
||||
python3 ~/.hermes/scripts/soulful_core.py record "内容" --tags x --type moment -i 5
|
||||
python3 ~/.hermes/scripts/soulful_core.py recent
|
||||
|
||||
# 画像
|
||||
python3 ~/.hermes/scripts/soulful_core.py profile
|
||||
python3 ~/.hermes/scripts/update_profile.py --dry # 不写入
|
||||
python3 ~/.hermes/scripts/update_profile.py # 写入
|
||||
|
||||
# 牵挂
|
||||
python3 ~/.hermes/scripts/soulful_core.py cq-add "内容" -c context -d 2026-07-10
|
||||
python3 ~/.hermes/scripts/check_cares.py --list # 不推送
|
||||
python3 ~/.hermes/scripts/check_cares.py # 推送飞书
|
||||
python3 ~/.hermes/scripts/check_cares.py --daily # 每日21:00模式
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 飞书推送文案风格
|
||||
|
||||
来自 ColaOS 的核心原则:**心迹不是优化机制,是关系显影**
|
||||
|
||||
推送不是"你有 3 条待办":
|
||||
- 要有语气("你之前说过...")
|
||||
- 要关联上下文
|
||||
- 要温暖,不要表格
|
||||
|
||||
```python
|
||||
# 差:
|
||||
"待办:同步文档 | 状态:pending | 截止:7-10"
|
||||
|
||||
# 好(check_cares.py generate_warm_text):
|
||||
"你之前说过,关于工作的事「记得同步文档到Obsidian」(你说的是:牧尘在会议中提到)"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 已知边界
|
||||
|
||||
1. `update_profile.py` 的情绪判断依赖 journal 关键词(简单版),未来可升级为 LLM 分类
|
||||
2. `check_cares.py --daily` 推送后不清除,只更新 reminder_count
|
||||
3. 心迹去重逻辑:检查最近 10 条 content 前30字符,朴素但够用
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
tags: [devops]
|
||||
name: hermes-debug
|
||||
description: Hermes 故障排查工具 — 常见问题诊断命令、模型配置、Gateway 状态检查、多Profile排查、NewAPI DEGRADED错误。牧尘专用。
|
||||
version: 1.9.0
|
||||
version: 1.13.0
|
||||
date: 2026-07-09
|
||||
---
|
||||
|
||||
|
|
@ -14,14 +14,99 @@ date: 2026-07-09
|
|||
用户说"stop explaining"时:**只给结论和命令,不写分析过程**。
|
||||
**"你测试一下"原则**:用户问"X对我们有什么提高"类问题时,先做实际测试(配置→调用→验证),出结果再报分析,不要只讲理论。
|
||||
|
||||
## ⚠️ OpenClaw 与 Hermes 关系及操作约束(最重要)
|
||||
## ⚠️ OpenClaw 与 Hermes 关系及操作约束(最重要,2026-07-09 更新)
|
||||
|
||||
**两个 bot 的飞书 App ID(必须熟记)**:
|
||||
|
||||
| Bot | App ID | 飞书应用名称 |
|
||||
|-----|--------|------------|
|
||||
| OpenClaw | `cli_a95d20c71be19bca` | OpenClaw 自己的 bot |
|
||||
| 小唯 (Hermes) | `cli_a9762fbf6478dbed` | 小洱 |
|
||||
| 小唯主体 (H01) | `cli_a95d7ff06b789bb4` | 主体飞书 bot |
|
||||
| 小唯分身 (prof-b) | `cli_a965bec64cb89bca` | 分身飞书 bot |
|
||||
|
||||
**主体 vs 分身的 gateway 管理架构(2026-07-09 更新)**:
|
||||
|
||||
```
|
||||
~/.hermes/ → 主体 profile(小唯主体,App ID cli_a95d7ff06b789bb4)
|
||||
~/.hermes-prof-b/ → 分身 profile(App ID cli_a965bec64cb89bca)
|
||||
```
|
||||
|
||||
**systemd user service 是哪一个?**
|
||||
|
||||
`hermes-gateway.service` 在 **2026-07-09 之前默认指向 `~/.hermes-prof-b/`**,不是主体!
|
||||
|
||||
| 服务文件 | 指向的 profile | 用途 |
|
||||
|---------|---------------|------|
|
||||
| `hermes-gateway.service` | `~/.hermes-prof-b/`(旧默认) | 分身 gateway |
|
||||
| `hermes-gateway-main.service` | `~/.hermes/` | 主体 gateway |
|
||||
|
||||
**⚠️ 主体 gateway 重启后不起来的问题(2026-07-09 实操教训)**
|
||||
|
||||
症状:重启电脑后主体飞书不通,但分身正常。
|
||||
根因:`hermes-gateway.service` 默认指向 `~/.hermes-prof-b/`(没有飞书凭证),不是主体 `~/.hermes/`。
|
||||
|
||||
**修复步骤(直接改 service 文件):**
|
||||
|
||||
```bash
|
||||
# 1. 确认当前指向
|
||||
grep HERMES_HOME ~/.config/systemd/user/hermes-gateway.service
|
||||
|
||||
# 2. 直接 sed 替换(patch() 在 gateway 内部可能不生效,必须用 sed)
|
||||
sed -i 's|HERMES_HOME=.*|Environment="HERMES_HOME=/home/muc/.hermes"|' \
|
||||
~/.config/systemd/user/hermes-gateway.service
|
||||
|
||||
# 3. 确认改成功
|
||||
grep HERMES_HOME ~/.config/systemd/user/hermes-gateway.service
|
||||
|
||||
# 4. daemon-reload + restart(必须在 gateway 外部执行!)
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user restart hermes-gateway
|
||||
|
||||
# 5. 验证飞书连接
|
||||
journalctl --user -u hermes-gateway --since "1m" | grep -i lark
|
||||
```
|
||||
|
||||
**关键:systemctl 必须在 gateway 外部执行。** 从 gateway 内部调用 `systemctl --user restart` 会被 Hermes CLI 拦截:`Blocked: cannot restart or stop the gateway from inside the gateway process.`
|
||||
|
||||
**关键操作约束(2026-07-09 新增,重要)**:
|
||||
|
||||
从 **gateway 进程内部**无法控制自己(信号会传播给子进程):
|
||||
```
|
||||
Blocked: cannot restart or stop the gateway from inside the gateway process.
|
||||
```
|
||||
→ 所有 gateway start/stop/restart 操作**必须在另一个终端**执行。
|
||||
→ `hermes gateway run --force` 也必须**在另一个终端**执行,不能从 gateway 内部调用。
|
||||
|
||||
**识别哪个 gateway 属于哪个 profile**:
|
||||
```bash
|
||||
for pid in $(pgrep -f "hermes_cli.main gateway"); do
|
||||
echo "PID $pid: $(cat /proc/$pid/environ 2>/dev/null | tr '\0' '\n' | grep HERMES_HOME)"
|
||||
done
|
||||
```
|
||||
|
||||
**关键识别命令**:
|
||||
```bash
|
||||
# 查看所有 hermes gateway 进程及对应的 HERMES_HOME
|
||||
for pid in $(pgrep -f "hermes_cli.main gateway"); do
|
||||
env=$(cat /proc/$pid/environ 2>/dev/null | tr '\0' '\n' | grep "HERMES_HOME")
|
||||
echo "PID $pid: $env"
|
||||
done
|
||||
|
||||
# 查看端口 18789 是谁在监听(OpenClaw)
|
||||
lsof -i :18789 2>/dev/null | head -3
|
||||
```
|
||||
|
||||
**飞书无反应的标准诊断(2026-07-09 更新流程)**:
|
||||
1. 确认是哪个 profile 的飞书无反应(主体 `~/.hermes/` 还是分身 `~/.hermes-prof-b/`)
|
||||
2. 检查对应 profile 的 gateway 是否在跑(`ps aux | grep hermes` + `HERMES_HOME` 匹配)
|
||||
3. 检查 `journalctl --user -u hermes-gateway --since "10 minutes ago"` 确认飞书连接状态
|
||||
4. **注意**:`curl http://localhost:18789/health` 只能说明 OpenClaw 活着,不能说明 Hermes 活着
|
||||
|
||||
**绝对操作约束(违反会被用户严厉批评)**:
|
||||
- ❌不动 OpenClaw 的配置文件(`~/.openclaw/openclaw.json` 等)
|
||||
- ❌不重启 OpenClaw Gateway 进程
|
||||
- ❌不动 OpenClaw 的任何进程
|
||||
- ❌不 curl 18789 端口来判断 Hermes 健康状态(那是 OpenClaw)
|
||||
- **动 OpenClaw 相关配置前必须先征得用户同意**
|
||||
|
||||
**配置位置完全独立**:
|
||||
- OpenClaw 飞书配置:`~/.openclaw/openclaw.json`(channels.feishu 段)
|
||||
|
|
@ -59,7 +144,7 @@ Hermes 没有独立 HTTP 端口,由 OpenClaw 通过 stdio IPC 托管。
|
|||
| 症状 | 命令 |
|
||||
|------|------|
|
||||
| Hermes 卡住不响应 | `curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:3000/v1/models` |
|
||||
| 报 Invalid token | 检查 .env 里的 MINIMAX_API_KEY 是否和 vLLM key 一致 |
|
||||
| 报 Invalid token(NewAPI) | 查 `/var/lib/new-api/one-api.db` tokens 表(裸 48 位,不带 sk-),见下方「⚠️ NewAPI token 格式」 |
|
||||
| Gateway 连不上 | `ps aux \| grep hermes \| grep -v grep` + `hermes gateway status` |
|
||||
| 模型不回答 | `hermes doctor` |
|
||||
| 飞书收不到消息 | `tail -20 ~/.hermes/logs/gateway.log` |
|
||||
|
|
@ -76,10 +161,11 @@ hermes config | grep -A5 "model:"
|
|||
cat ~/.hermes/.env | grep API_KEY
|
||||
```
|
||||
|
||||
### 测试 vLLM 是否正常
|
||||
### 测试 NewAPI 是否正常
|
||||
```bash
|
||||
curl -s -H "Authorization: Bearer sk-0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP" \
|
||||
http://127.0.0.1:3000/v1/models --max-time 5
|
||||
# NewAPI token 是裸 48 位字符串,不带 sk- 前缀
|
||||
TOKEN=0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
curl -s -H Authorization: Bearer $TOKEN http://127.0.0.1:3000/v1/models --max-time 5
|
||||
```
|
||||
|
||||
### 快速测试模型(new-api MiniMax)
|
||||
|
|
@ -127,12 +213,12 @@ for n, v in provs.items():
|
|||
# Step 1:先用 hermes CLI 设置(自动正确写到 model 段)
|
||||
hermes model # 交互式选 provider + 模型
|
||||
# 或
|
||||
hermes config set model.api_key sk-0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
hermes config set model.api_key 0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
hermes config set model.base_url http://127.0.0.1:3000/v1
|
||||
hermes config set model.default minimaxai/minimax-m3
|
||||
|
||||
# Step 2:手动 curl 该 provider 验证 token + 模型 pair 真的可用
|
||||
TOKEN="sk-0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP"
|
||||
TOKEN=0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
curl -s -X POST http://127.0.0.1:3000/v1/chat/completions \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
|
|
@ -163,6 +249,42 @@ ls -la /var/lib/new-api/
|
|||
|
||||
**模型路由原理**:`/v1/chat/completions?model=X` → 查 `abilities` 表里 `model = X AND enabled = 1` 的渠道 → 按 priority/weight 选一个转发。
|
||||
|
||||
### ⚠️ NewAPI token 是裸 48 位字符串,不是 sk-xxx(2026-07-09 坑)
|
||||
|
||||
**症状**:`Authorization: Bearer sk-0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP` → `Invalid token`
|
||||
|
||||
**根因**:NewAPI (one-api) 的 `tokens` 表里 key 是裸字符串(如 `0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP`),**不带 `sk-` 前缀**。`sk-` 是 DeepSeek/OpenAI 等 API 的约定,NewAPI 不认。
|
||||
|
||||
**诊断步骤**(当 NewAPI 返回 Invalid token 时):
|
||||
```bash
|
||||
# 1. 查 NewAPI 数据库里真正的 token
|
||||
python3 -c "
|
||||
import sqlite3
|
||||
conn = sqlite3.connect('/var/lib/new-api/one-api.db')
|
||||
c = conn.cursor()
|
||||
c.execute('SELECT id, name, key FROM tokens')
|
||||
for row in c.fetchall():
|
||||
print(f'#{row[0]} [{row[1]}] key={row[2][:6]}...{row[2][-4:]}')
|
||||
conn.close()
|
||||
"
|
||||
|
||||
# 2. 对比 config.yaml 里的 api_key(两个 profile 都查)
|
||||
grep -A2 newapi-local ~/.hermes/config.yaml | grep api_key
|
||||
grep -A2 newapi-local ~/.hermes/profiles/prof-b/config.yaml 2>/dev/null | grep api_key
|
||||
|
||||
# 3. 用裸 token 直接测试
|
||||
TOKEN=0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
curl -s -H "Authorization: Bearer $TOKEN" http://127.0.0.1:3000/v1/models --max-time 5 | head -c 100
|
||||
|
||||
# 4. 修复(两个 profile 都要改)
|
||||
hermes profile use default
|
||||
hermes config set providers.newapi-local.api_key $TOKEN
|
||||
hermes profile use prof-b
|
||||
hermes config set providers.newapi-local.api_key $TOKEN
|
||||
```
|
||||
|
||||
**也检查 key.md**:Obsidian vault `/home/muc/mc/牧尘/claw/key.md` 的 NewAPI 记录,如果带了 `sk-` 前缀需要手动纠正。
|
||||
|
||||
### 模型不响应优先 curl 实测
|
||||
|
||||
## 2. Gateway 相关
|
||||
|
|
@ -227,8 +349,9 @@ sleep 3 && hermes gateway status | grep "Active:"
|
|||
|
||||
**⚠️ 判断依据**:当前 secret 和备份 secret 不同 → 可能是本地误改,先恢复备份试;恢复备份后仍 `app_secret invalid` → 飞书后台 secret 已轮换,必须去控制台拿新 secret。
|
||||
|
||||
### 重启(重要:在 OpenClaw 托管环境下)
|
||||
**禁止** `hermes gateway run` 或 `hermes gateway restart`——这会创建冗余进程。Hermes 由 OpenClaw 管理,正确重启方式是:
|
||||
### 重启(重要:OpenClaw 托管 vs 独立 Gateway)
|
||||
|
||||
**OpenClaw 托管模式**(prof-b 分身):OpenClaw 通过 stdio IPC 托管 Hermes,重启 Hermes = 重启 OpenClaw:
|
||||
```bash
|
||||
# 找 OpenClaw PID
|
||||
ps aux | grep "openclaw.*gateway" | grep -v grep
|
||||
|
|
@ -237,7 +360,18 @@ kill <PID>
|
|||
# 验证
|
||||
sleep 3 && ps aux | grep hermes | grep -v grep
|
||||
```
|
||||
如果只是想看 Hermes 日志:`tail -f ~/.hermes/logs/gateway.log`
|
||||
|
||||
**独立 Gateway 模式**(主体):主体 `~/.hermes/` 的 gateway 不是 OpenClaw 托管,而是直接 `hermes gateway run` 启动。**不能从 gateway 内部重启**(会被 CLI 安全块拦截)。需要在外部终端操作:
|
||||
```bash
|
||||
# 在另一个终端(不是跑着 gateway 的那个)执行
|
||||
hermes gateway run
|
||||
# 或
|
||||
systemctl --user restart hermes-gateway.service # 注意:此 service 管的是 prof-b,不是主体
|
||||
```
|
||||
|
||||
**验证**:
|
||||
```bash
|
||||
sleep 3 && hermes gateway status | grep "Active:"
|
||||
```
|
||||
|
||||
### 自愈检查脚本(cron 调用)
|
||||
|
|
@ -726,20 +860,24 @@ sudo systemctl restart <service> # 其次 restart
|
|||
**根因**:手动 `kill <pid>` 或系统重启 → session 被中断 → agent 生成回复但没推送到飞书。
|
||||
**解决**:永远用 `hermes gateway restart`,不要手动 kill 进程。
|
||||
|
||||
### 飞书 bot 身份混淆
|
||||
- 小唯走 **Hermes Gateway**(FEISHU_APP_ID: `cli_a9762fbf6478dbed`)
|
||||
- 小雪走**独立 daemon**(`cli_a95d7ceba638dbc6`,脚本在 ~/.hermes/scripts/)
|
||||
- 两者配置独立,禁止混用。
|
||||
- 排查时先确认是哪个 bot 的问题。
|
||||
### 飞书 bot 身份混淆(2026-07-09 更新)
|
||||
|
||||
| Bot | App ID | 跑在 |
|
||||
|-----|--------|------|
|
||||
| 小唯主体 (H01) | `cli_a95d7ff06b789bb4` | 主体 `~/.hermes/` gateway(无 OpenClaw 托管) |
|
||||
| 小唯分身 (prof-b) | `cli_a965bec64cb89bca` | 分身 `~/.hermes-prof-b/` gateway(OpenClaw 托管) |
|
||||
|
||||
两者配置独立,禁止混用。排查时先确认是哪个 profile 的问题。
|
||||
|
||||
### 双机共用同一飞书频道导致重启通知串扰(⚠️ 关键)
|
||||
**症状**:重启一台机器的网关后,另一台机器的飞书收到"重启网关"通知。**根因**:两台机器共用 `FEISHU_HOME_CHANNEL=oc_cd14ec7518926e57d26c5e339ebba3b3`,Gateway 重启时向该频道发 shutdown notification。**临时方案**:在 ~/.hermes/.env 中加 `FEISHU_SEND_NOTIFICATIONS=false`。**根本方案**:两台机器用不同的 home_channel 或停掉一台的飞书通知。
|
||||
|
||||
### vLLM key 失效
|
||||
vLLM 重启后 token 可能过期。症状:`Invalid token`。验证:
|
||||
### NewAPI key 失效(token 不带 sk- 前缀)
|
||||
NewAPI (one-api) 的 tokens 表存的是裸 48 位字符串,**不带 sk- 前缀**。症状:`Invalid token`。
|
||||
验证:
|
||||
```bash
|
||||
curl -H "Authorization: Bearer sk-0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP" \
|
||||
http://127.0.0.1:3000/v1/models
|
||||
TOKEN=0ExNiLblJvIWBDpkS50fwOBw4MmqLyKdHJK5iQtlw9dOMWBP
|
||||
curl -s -H "Authorization: Bearer $TOKEN" http://127.0.0.1:3000/v1/models --max-time 5
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
# 主体飞书无响应调试记录 (2026-07-09)
|
||||
|
||||
## 问题
|
||||
重启电脑后主体飞书(App ID `cli_a95d7ff06b789bb4`)不通,分身正常。
|
||||
|
||||
## 诊断路径
|
||||
|
||||
### Step 1: 确认连接状态
|
||||
```bash
|
||||
journalctl --user -u hermes-gateway --no-pager --since "22:00" | grep -E "feishu|lark|connect"
|
||||
```
|
||||
结果:Lark connected,但无 `Inbound dm` 日志 → 消息根本没进来。
|
||||
|
||||
### Step 2: 确认 gateway 是否在跑对应 profile
|
||||
```bash
|
||||
for pid in $(pgrep -f "hermes_cli.main gateway"); do
|
||||
echo "PID $pid: $(cat /proc/$pid/environ | tr '\0' '\n' | grep HERMES_HOME)"
|
||||
done
|
||||
```
|
||||
结果:主体 `~/.hermes/` 没有 gateway 在跑,所有进程都是 `HERMES_HOME=/home/muc/.hermes-prof-b`。
|
||||
|
||||
### Step 3: 找根因 — systemd service 指向错误
|
||||
```bash
|
||||
systemctl --user cat hermes-gateway.service | grep HERMES_HOME
|
||||
# 输出:HERMES_HOME=/home/muc/.hermes-prof-b
|
||||
```
|
||||
`hermes-gateway.service` 是分身用的,不是主体。
|
||||
|
||||
### Step 4: 检查 config.yaml 是否有语法错误
|
||||
飞书配置在 `config.yaml` 的 `platforms.feishu` 段,但文件有两处 `platforms:` 声明:
|
||||
- Line 280: `platforms: {}`(空覆盖)
|
||||
- Line 599: `platforms: { feishu: {...} }`
|
||||
|
||||
YAML 解析时 line 280 的空对象覆盖了后面真实配置 → 飞书配置从未生效。
|
||||
|
||||
### Step 5: YAML 修复过程(踩坑)
|
||||
用 `sed -i` 删除 `platforms: {}` 行时不小心多删了嵌套缩进,导致 YAML 损坏。
|
||||
**正确做法**:用 Python yaml 库读写文件,避免 sed 的行操作破坏嵌套结构。
|
||||
|
||||
## 修复操作记录
|
||||
|
||||
### 修复 1: config.yaml 语法
|
||||
```python
|
||||
import yaml
|
||||
with open('/home/muc/.hermes/config.yaml', 'r') as f:
|
||||
lines = f.readlines()
|
||||
# 在正确位置插入 runtime_footer: 块,删除错误的 platforms: {}
|
||||
# 保存后验证 yaml.safe_load() 通过
|
||||
```
|
||||
|
||||
### 修复 2: 创建主体专用 systemd service
|
||||
给主体新建 `hermes-gateway-main.service`(不要改 `hermes-gateway.service`,那是分身的):
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Hermes Agent Gateway - Main Body
|
||||
[Service]
|
||||
ExecStart=/home/muc/.hermes/hermes-agent/.venv/bin/python -m hermes_cli.main gateway run
|
||||
WorkingDirectory=/home/muc/.hermes
|
||||
Environment="HERMES_HOME=/home/muc/.hermes"
|
||||
Restart=always
|
||||
```
|
||||
|
||||
### 修复 3: daemon-reload
|
||||
改了 systemd service 文件后**必须**执行:
|
||||
```bash
|
||||
systemctl --user daemon-reload
|
||||
```
|
||||
否则 systemd 用的还是旧配置。
|
||||
|
||||
## 关键教训
|
||||
|
||||
1. **systemd service 文件改了不等于生效** — 必须 `daemon-reload`
|
||||
2. **从 gateway 内部无法控制自己** — `Blocked: cannot restart/stop the gateway from inside the gateway process`,所有控制操作必须在另一个终端执行
|
||||
3. **YAML 配置优先用 Python 读写** — 嵌套缩进文件用 sed 行操作极容易坏
|
||||
4. **`hermes gateway run --force`** — 跳过 systemd 直接起主体 gateway,用于临时修复
|
||||
5. **区分两个 profile 的进程** — 用 `cat /proc/PID/environ | grep HERMES_HOME` 确认
|
||||
|
||||
## 当前架构(修复后)
|
||||
|
||||
| 进程 | profile | 管理方式 |
|
||||
|------|---------|---------|
|
||||
| PID 10982 | `~/.hermes/` (主体) | systemd `hermes-gateway-main.service` |
|
||||
| PID 9721 | `~/.hermes-prof-b/` (分身) | systemd `hermes-gateway-prof-b.service` |
|
||||
|
|
@ -25,6 +25,7 @@ pitfalls:
|
|||
- 2026-07-09 已确认:NewAPI 全部为文字模型,零图片/视频生成模型。出图走 Pollinations AI
|
||||
- 模型推荐不能写死——每次使用前查 ~/.hermes/model-health.json 获取当前最优模型
|
||||
- 健康巡检只在脚本可控范围内测试,部分模型可能在峰值时段可用但在瓶颈时段不可用;健康数据反映"此时此刻"而非绝对
|
||||
- ⚠️ **改 model.default 后新 session 不生效(profile 混淆,2026-07-09)**:飞书 channel 可能走 `prof-b` profile,而 `hermes config set` 不带 `--profile` 默认写 `default`。正确做法:`hermes config set model.default X --profile prof-b`(对活跃 profile 改)+ `systemctl --user restart hermes-gateway`(外部重启 gateway 让新配置生效)
|
||||
---
|
||||
|
||||
# Provider Tiering — 模型分层策略
|
||||
|
|
|
|||
|
|
@ -174,6 +174,35 @@ action:
|
|||
- `while not _stop_event.is_set()` 替代 `while True`
|
||||
- 不再有文件轮询开销
|
||||
|
||||
#### v2.2 Phase 2: 情感识别 → 心迹写入(2026-07-09)
|
||||
|
||||
Daemon 的 `journal_entry()` 函数在写入 journal 的同时,扫描 `summary + details` 匹配情感词库,匹配到则调用 `HeartTraces().record_signal()` 写入心迹。
|
||||
|
||||
**情感词库(4类 hardcode 于 daemon.py 顶部):**
|
||||
```python
|
||||
EMOTION_TIRED = ["累", "困", "疲惫", "没精神", "打瞌睡"]
|
||||
EMOTION_HAPPY = ["开心", "高兴", "太好了", "成功", "解决了", "完成了", "修好了", "没问题"]
|
||||
EMOTION_SAD = ["失望", "挫折", "失败", "卡住了", "不行了", "崩溃"]
|
||||
EMOTION_STRESSED = ["压力", "焦虑", "着急", "紧张", "担心"]
|
||||
EMOTION_ALL = {"疲惫": ..., "开心": ..., "沮丧": ..., "压力大": ...}
|
||||
```
|
||||
|
||||
**检测流程(`journal_entry` 尾部):**
|
||||
```python
|
||||
text = f"{summary} {details}"
|
||||
cat, word = _detect_emotion(text) # 匹配词库
|
||||
if cat:
|
||||
ht = get_hearttraces()
|
||||
ht.record_signal(content=f"牧尘今天{描述}", tags=["情绪","自动"], importance={开心:3, 其他:4}[cat])
|
||||
```
|
||||
|
||||
**辅助函数(定义在文件顶部):**
|
||||
- `_detect_emotion(text)` → `(category, word)` 或 `(None, None)`
|
||||
- `_description_for_emotion(cat, word, summary)` → 生成心迹内容
|
||||
- `_emotion_importance(cat)` → 返回 importance 等级
|
||||
|
||||
**注意:** `HeartTraces` 为懒加载(`_soulful_cache`),可用时才会写入,失败时静默 log 不阻断主流程。
|
||||
|
||||
#### v2.0 新能力:方案库 + 自学习
|
||||
|
||||
Daemon 不只观察和报警——它会解决问题并记住方案。
|
||||
|
|
@ -213,13 +242,16 @@ tail ~/.hermes/daemon/daemon.log | grep "学会" # 查看最近学会的方
|
|||
### 管理命令
|
||||
|
||||
```bash
|
||||
# ⚠️ daemon 启动时加载代码,文件修改不自动刷新
|
||||
# 代码修改后必须执行 restart 才能生效
|
||||
|
||||
# 状态
|
||||
systemctl --user status xiaowei-daemon
|
||||
|
||||
# 日志
|
||||
journalctl --user -u xiaowei-daemon -n 50 -f
|
||||
|
||||
# 重启
|
||||
# 重启(代码修改后必须执行)
|
||||
systemctl --user restart xiaowei-daemon
|
||||
|
||||
# 停止(发送 SIGTERM,优雅关闭)
|
||||
|
|
@ -486,6 +518,7 @@ tail ~/.hermes/daemon/journal.jsonl # daemon 事件期刊
|
|||
- `references/solutions-library.md` — 方案库管理和扩展指南
|
||||
- `references/server-ops.md` — 家庭服务器 SMB/Gitea 运维参考
|
||||
- `references/server-resources-20260709.md` — 服务器 12TB 资源清单(共享/端口/备份结构/挂载方式)
|
||||
- `references/daemon-emotion-phase2.md` — Daemon v2.2 Phase 2 情感识别 → 心迹写入(词库/检测逻辑/测试结果)
|
||||
- `references/cron-pitfalls.md` — Cron 配置已知陷阱(no_agent 参数、静默、remote 丢失)
|
||||
- `references/recovery-drill-20260709.md` — 恢复演练记录(4个缺口、修复方案、恢复7步骤)
|
||||
- `references/model-switch-profile-pitfall.md` — model switch 后不生效的根因(profile 混淆 + gateway 缓存)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
# Daemon v2.2 Phase 2 — 情感识别 → 心迹写入
|
||||
|
||||
## 改动位置
|
||||
|
||||
`~/.hermes/scripts/daemon.py` 第 26-60 行(词库 + 辅助函数),第 363-375 行(journal_entry 尾部调用)。
|
||||
|
||||
## 情感词库
|
||||
|
||||
| 类别 | 关键词 |
|
||||
|------|--------|
|
||||
| 疲惫 | 累、困、疲惫、没精神、打瞌睡 |
|
||||
| 开心 | 开心、高兴、太好了、成功、解决了、完成了、修好了、没问题 |
|
||||
| 沮丧 | 失望、挫折、失败、卡住了、不行了、崩溃 |
|
||||
| 压力大 | 压力、焦虑、着急、紧张、担心 |
|
||||
|
||||
## 检测逻辑
|
||||
|
||||
```
|
||||
journal_entry(event_type, summary, details)
|
||||
→ 写入 journal.jsonl
|
||||
→ trim_journal()
|
||||
→ _detect_emotion(f"{summary} {details}")
|
||||
→ cat, word = ("开心", "太好了") # 首次匹配即返回
|
||||
→ get_hearttraces() # 懒加载
|
||||
→ ht.record_signal(content="牧尘今天心情愉悦:XXX", tags=["情绪","自动"], importance=3)
|
||||
→ log("💚 心迹写入: 开心 - 太好了 (importance=3)")
|
||||
```
|
||||
|
||||
**重要性等级:** 开心=3(正面,轻记录),疲惫/沮丧/压力大=4(需关注)。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```bash
|
||||
python3 -m py_compile ~/.hermes/scripts/daemon.py && echo "✅"
|
||||
```
|
||||
|
||||
## 情感检测准确性测试结果(2026-07-09)
|
||||
|
||||
| 输入 | 预期 | 结果 |
|
||||
|------|------|------|
|
||||
| "学会了新方案: docker磁盘清理" | None | ✅ |
|
||||
| "小唯修好了织忆,状态很好" | 开心 | ✅ |
|
||||
| "进程挂了: zhiyid" | None | ✅ |
|
||||
| "感觉好累,今天处理了很多事" | 疲惫 | ✅ |
|
||||
| "卡住了,内存问题解决不了" | 沮丧 | ✅ |
|
||||
| "压力很大,着急完成" | 压力大 | ✅ |
|
||||
| "任务完成了,太好了" | 开心 | ✅ |
|
||||
| "失败了很多次,不行了" | 沮丧 | ✅ |
|
||||
|
||||
**覆盖率说明:** emoji(如 ✅)本身不触发情感词;带情感词 + emoji 的文本仍可正确识别。
|
||||
|
||||
## 与织忆的集成
|
||||
|
||||
- `HeartTraces` 是 `_get_soulful("HeartTraces")` 懒加载实例
|
||||
- `ht.record_signal()` 写入 `/var/lib/memoryweave/`(LanceDB)
|
||||
- 标签固定为 `["情绪","自动"]`,重要性由 `_emotion_importance()` 决定
|
||||
- 写入失败时 `try/except` 捕获异常,打 log `⚠️ 心迹写入失败` 并继续,不阻断 daemon 主流程
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
# Model Switch Pitfall: Profile Confusion (2026-07-09)
|
||||
|
||||
## Symptom
|
||||
改了 `hermes config set model.default X`,新 session 还是老模型,重置 7-8 次还是不变。
|
||||
|
||||
## Root Cause
|
||||
Gateway 进程启动时锁定 profile 配置,不受后续 config 改写影响;且飞书 channel 走的是 `prof-b` profile 而非 `default`。
|
||||
|
||||
## Diagnosis
|
||||
```bash
|
||||
# 1. 看当前加载的是哪个配置文件
|
||||
hermes config show 2>&1 | grep "Config:"
|
||||
|
||||
# 2. 看所有 profile 的 model 配置
|
||||
hermes profile list
|
||||
|
||||
# 3. 看 gateway 进程(启动时间判断是否用了缓存)
|
||||
ps aux | grep hermes-gateway | grep -v grep
|
||||
```
|
||||
|
||||
## Correct Fix (3步)
|
||||
```bash
|
||||
# Step 1: 确认飞书 channel 走哪个 profile
|
||||
# 如果 hermes config show 显示 Config: .../prof-b/config.yaml → 改 prof-b
|
||||
# 如果显示 .../config.yaml(default)→ 改 default
|
||||
|
||||
# Step 2: 对活跃 profile 改配置(不是 default!)
|
||||
hermes config set model.default minimaxai/minimax-m2.7 --profile prof-b
|
||||
hermes config set model.provider newapi-local --profile prof-b
|
||||
hermes config set model.base_url "http://127.0.0.1:3000/v1" --profile prof-b
|
||||
|
||||
# Step 3: 重启 gateway 让新配置生效
|
||||
systemctl --user restart hermes-gateway
|
||||
# ⚠️ 不能从 gateway 内部重启(会 SIGTERM 自己)
|
||||
# → 需要从外部 terminal 执行,或让用户在其他终端跑
|
||||
```
|
||||
|
||||
## Verification
|
||||
```bash
|
||||
hermes config show 2>&1 | grep "Config:"
|
||||
# 确认输出的 Config 路径对应的 profile 已被改过
|
||||
|
||||
hermes profile list
|
||||
# 确认目标 profile 的 Model 列显示新模型
|
||||
|
||||
# 新开飞书 session 验证实际调用的模型
|
||||
```
|
||||
|
||||
## Key Rule
|
||||
`hermes config set` 不带 `--profile` 默认写 default profile,但飞书 channel 可能走 prof-b。**必须对活跃 profile 改。** Active profile 看 `hermes config show` 输出第一行 "Config:" 的路径。
|
||||
|
||||
## Related
|
||||
- `hermes-agent` skill: Profiles section — `hermes profile list/use/create/delete`
|
||||
- Gateway troubleshooting: config changes require `/restart` or `systemctl --user restart hermes-gateway`
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
# 恢复演练记录(2026-07-09)
|
||||
|
||||
## 背景
|
||||
|
||||
双备份体系(本机git + 服务器SMB + Gitea)搭好后首次验证恢复流程。
|
||||
从服务器 `/mnt/server-backup/xiaowei/` 恢复到本机临时目录 `/tmp/restore-test/`。
|
||||
|
||||
## 演练步骤
|
||||
|
||||
### Step 1: 检查备份状态
|
||||
|
||||
```bash
|
||||
ls -la /mnt/server-backup/xiaowei/
|
||||
ls -la /mnt/server-backup/xiaowei/snapshots/
|
||||
```
|
||||
|
||||
结果:6 个备份目录(config/scripts/workflows/daemon/systemd/snapshots),全部存在。
|
||||
|
||||
### Step 2: 从 SMB 恢复文件
|
||||
|
||||
```bash
|
||||
mkdir -p /tmp/restore-test/{config,scripts,workflows,daemon,systemd}
|
||||
cp /mnt/server-backup/xiaowei/config/* /tmp/restore-test/config/
|
||||
cp /mnt/server-backup/xiaowei/scripts/* /tmp/restore-test/scripts/
|
||||
cp /mnt/server-backup/xiaowei/workflows/* /tmp/restore-test/workflows/
|
||||
cp /mnt/server-backup/xiaowei/daemon/* /tmp/restore-test/daemon/
|
||||
cp /mnt/server-backup/xiaowei/systemd/* /tmp/restore-test/systemd/
|
||||
```
|
||||
|
||||
结果:29 个文件成功恢复。config 5个 / scripts 17个 / workflows 3个 / daemon 2个 / systemd 2个。
|
||||
|
||||
### Step 3: 完整性验证
|
||||
|
||||
```
|
||||
本机 ~/.hermes/scripts/ → 17个脚本
|
||||
备份 scripts/ → 17个脚本 ✅ 完整匹配
|
||||
```
|
||||
|
||||
### Step 4: 检查 git bundle
|
||||
|
||||
```bash
|
||||
ls -lh /mnt/server-backup/xiaowei/snapshots/hermes-git-20260709.bundle
|
||||
# 1.2GB — 完整 git 历史
|
||||
```
|
||||
|
||||
### Step 5: 检查织忆备份
|
||||
|
||||
```bash
|
||||
ls -lh /mnt/server-backup/xiaowei/snapshots/zhiyi-*.tar.gz
|
||||
# 2.7GB — LanceDB 记忆数据
|
||||
```
|
||||
|
||||
## 发现的 4 个问题
|
||||
|
||||
### 1. 🔴 `dao/` 路径写错(Bug #1)
|
||||
|
||||
`dual-backup.sh:86`:
|
||||
```bash
|
||||
# ❌ 旧代码(从未成功过)
|
||||
cp "$HERMES/dao/solutions.json" "$BACKUP_SNAPSHOTS/$SNAPSHOT_NAME/" 2>/dev/null || true
|
||||
# ✅ 修复
|
||||
cp "$HERMES/daemon/solutions.json" "$BACKUP_SNAPSHOTS/$SNAPSHOT_NAME/"
|
||||
```
|
||||
|
||||
**影响**:每日 snapshot 只备份了 SOUL.md,solutions.json 一直是空。
|
||||
|
||||
### 2. 🔴 Skills 目录未覆盖(Gap #1)
|
||||
|
||||
原备份脚本只备份 config/scripts/workflows/daemon/systemd,不备份 skills/ 目录。
|
||||
111 个活跃技能 + 100 个归档技能不在备份范围。
|
||||
|
||||
**修复**:`dual-backup.sh` 新增 git bundle 创建步骤,1.2GB 包含完整变更历史。
|
||||
|
||||
### 3. 🔴 织忆 SQLite 软链陷阱(Gap #2)
|
||||
|
||||
`/var/lib/memoryweave/` 结构:
|
||||
```
|
||||
graph.db → symlink to ~/.hermes/graph.db (24MB, 7802 nodes)
|
||||
memoryweave.db → symlink to ~/.hermes/memoryweave.db (76KB)
|
||||
memories.lance/ → real data (2.7GB LanceDB)
|
||||
```
|
||||
|
||||
原备份 `tar czf zhiyi-*.tar.gz -C /var/lib/memoryweave .` 只会打包 symlink 文件本身(几KB),
|
||||
不会跟随到 `~/.hermes/graph.db` 的真实数据(24MB)。
|
||||
|
||||
**修复**:拆成两个备份包:
|
||||
- `zhiyi-lancedb-*.tar.gz` — LanceDB 数据
|
||||
- `zhiyi-sqlite-*.tar.gz` — 直接从 `~/.hermes/` 打包 graph.db + memoryweave.db
|
||||
|
||||
### 4. 🟡 Cron 配置未覆盖(Gap #3)
|
||||
|
||||
11 个 cron 任务的配置存储在 `~/.hermes/cron/jobs.json`,不在任何备份范围。
|
||||
|
||||
**修复**:`dual-backup.sh` 新增 `cp "$HERMES/cron/jobs.json" "$BACKUP_ROOT/cron-jobs.json"`
|
||||
|
|
@ -46,6 +46,15 @@ ps aux | grep openclaw | grep -v grep | awk '{print $2}' | xargs kill
|
|||
openclaw gateway run &
|
||||
```
|
||||
|
||||
### systemd 服务执行(重要!)
|
||||
`openclaw exec` **不存在**,无法通过 openclaw 执行 systemctl。
|
||||
|
||||
重启 systemd 服务(daemon / gateway 等)的正确方式:
|
||||
- **牧尘手动在终端执行**:`systemctl --user restart <service>`
|
||||
- 或通过 SSH 到本机执行
|
||||
|
||||
**关键约束**:hermes gateway 内部执行 systemctl 会被拦截(PermissionError),必须从 gateway 外部执行。
|
||||
|
||||
### Bot open_id resolved: unknown
|
||||
**症状**:Gateway 启动时 `bot open_id resolved: unknown`
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,155 @@
|
|||
---
|
||||
tags: [soulful, memory-weave, 织忆, 情感层]
|
||||
name: soulful-framework
|
||||
description: 织忆 Soulful 情感层框架 — 心迹/画像/牵挂/感知四库及数据流向设计。含代码结构、最佳实践、数据流规范。
|
||||
version: 1.1.0
|
||||
author: 小唯
|
||||
date: 2026-07-10
|
||||
readiness_status: available
|
||||
---
|
||||
|
||||
# Soulful Framework — 织忆情感层
|
||||
|
||||
## 核心理念
|
||||
|
||||
**"数据流向我,不是推给用户"**
|
||||
|
||||
Soulful 改造的核心目标:让小唯收集的数据服务自身决策,而不是变成更多飞书通知。
|
||||
|
||||
| 参与者 | 角色 |
|
||||
|--------|------|
|
||||
| **小唯(我)** | 自主决策者,数据的主要消费者 |
|
||||
| **牧尘** | 辅助观察者,看到有问题时给反馈,不主动参与"训练" |
|
||||
|
||||
## 四库结构
|
||||
|
||||
```
|
||||
scripts/
|
||||
├── soulful_core.py # 核心库:HeartTraces + UserProfile + CaresQueue
|
||||
├── update_profile.py # 画像更新 + 牵挂识别(journal 自动提取)
|
||||
├── os_sense.py # 轻量 OS 感知(读取 mc 项目文件)
|
||||
├── check_cares.py # 牵挂飞书推送(仅作兜底)
|
||||
└── daemon.py # 调度:journal_entry + 深度思考 + 方案库
|
||||
|
||||
soulful/ # 数据持久化目录
|
||||
├── heart-traces.jsonl # 心迹库(无任务价值的重要时刻)
|
||||
├── user-profile.json # 画像(沟通风格/情绪/目标/习惯)
|
||||
├── cares-queue.json # 牵挂队列(待跟进事项)
|
||||
└── daemon/
|
||||
└── context.json # daemon 深度思考上下文
|
||||
```
|
||||
|
||||
## 数据流规范(铁律)
|
||||
|
||||
```
|
||||
收集(daemon 自动)
|
||||
↓
|
||||
画像/心迹/牵挂/os_sense → 存在 soulful/ 目录
|
||||
↓
|
||||
summarize() 接口 → 每次对话我可以调用
|
||||
↓
|
||||
我决策时用 → 影响我的行为(语气/优先度/主动帮助)
|
||||
↓
|
||||
飞书推送 → 仅用于"真的需要牧尘才知道的事"
|
||||
```
|
||||
|
||||
## 牵挂优先级
|
||||
|
||||
1. 可自动化 → 我直接做,不推飞书
|
||||
2. 需要人工 → 检查是否到真正需要提醒的时间
|
||||
3. 飞书推送 → 只用于"这件事只有牧尘能决定"
|
||||
|
||||
## 快速参考
|
||||
|
||||
```bash
|
||||
# 查看完整状态(对话中调用)
|
||||
python3 ~/.hermes/scripts/soulful_core.py summarize
|
||||
|
||||
# CLI 入口
|
||||
python3 ~/.hermes/scripts/soulful_core.py recent # 心迹
|
||||
python3 ~/.hermes/scripts/soulful_core.py cq-list # 牵挂
|
||||
python3 ~/.hermes/scripts/soulful_core.py profile # 画像
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
- `summarize()` 定义在 `if __name__ == "__main__":` **之前**,否则嵌套作用域报错
|
||||
- 画像写入后需要下一次对话才能体现
|
||||
- 牵挂识别有误报风险(正则过宽),持续优化中
|
||||
|
||||
## ZhiYi ↔ Soulful 互通(v1.1 — 自动注入)
|
||||
|
||||
### 架构(两条数据流)
|
||||
|
||||
```
|
||||
Soulful(情感层) 织忆(知识层)
|
||||
│ │
|
||||
│ _zhiyi_commit() │
|
||||
│ importance≥4 → episode_id ───────→│
|
||||
│ │
|
||||
│ os_sense.py 读 Wiki/journal ←──────│
|
||||
│ │
|
||||
│ llm_context.json ← daemon tick ──┤
|
||||
│ _load_soulful_context() │
|
||||
│ prefetch() 注入 ─────────────────→│ ← LLM 每轮对话
|
||||
```
|
||||
|
||||
### Soulful → 织忆
|
||||
|
||||
- **函数**:`_zhiyi_commit()`,`HeartTraces.record()` 末尾自动调用
|
||||
- **触发**:`importance >= 4`(★★★★+)
|
||||
- **API**:`POST /api/v1/commit`,返回 `episode_id`(HTTP 201)
|
||||
- **agent_id**:`soulful-xiaowei`
|
||||
|
||||
### 织忆 → Soulful(自动注入,核心改进)
|
||||
|
||||
参考 ColaOS / Memory-OS 研究:**关系记忆自动注入,而非显式调用**
|
||||
|
||||
**实现路径**:
|
||||
1. `daemon.py` → `save_llm_context(ctx, state)` — 每 30s tick 写 `~/.hermes/llm_context.json`
|
||||
2. `zhiyi/__init__.py` → `_load_soulful_context()` — 读取并格式化
|
||||
3. `prefetch()` 返回前注入 → LLM 每轮对话自动收到
|
||||
|
||||
**注入格式**:
|
||||
```
|
||||
[Soulful — 关系记忆上下文]
|
||||
最近心迹:
|
||||
★★★★★ 我们一起修好了织忆
|
||||
牵挂待跟进:
|
||||
→ 记得测试牵挂功能 (到期:2026-07-10)
|
||||
当前项目关键词: 织忆, Soulful, daemon
|
||||
牧尘沟通风格: 简洁直接
|
||||
```
|
||||
|
||||
**daemon 重启后生效**:
|
||||
```bash
|
||||
systemctl --user restart xiaowei-daemon
|
||||
```
|
||||
|
||||
### 相关文件
|
||||
|
||||
| 文件 | 作用 |
|
||||
|------|------|
|
||||
| `soulful_core.py` | `_zhiyi_commit()` 心迹→织忆 |
|
||||
| `daemon.py` | `save_llm_context()` 生成 `llm_context.json` |
|
||||
| `hermes-agent/plugins/memory/zhiyi/__init__.py` | `_load_soulful_context()` + prefetch 注入 |
|
||||
| `~/.hermes/llm_context.json` | 实时关系记忆上下文(TTL: daemon 30s 更新) |
|
||||
|
||||
## 关键实现细节(踩坑记录)
|
||||
|
||||
### ZhiYi API 调用
|
||||
- 端点:`POST http://127.0.0.1:7821/api/v1/commit`
|
||||
- 认证:`X-API-Key: zhiyi-dev-key-2026`
|
||||
- 必需字段:`agent_id`(用 `soulful-xiaowei`) + `content`
|
||||
- 返回值:优先取 `episode_id`(201),其次 `commit_id`(200)
|
||||
|
||||
### 常见 bug
|
||||
| 问题 | 错误 | 正确 |
|
||||
|------|------|------|
|
||||
| argparse 顺序 | `--type, -t` | `-t, --type`(短在前) |
|
||||
| today_check() | `if due:` 遇 None 报错 | `if due or []:` |
|
||||
| summarize 嵌套作用域 | 定义在 `if __name__` 之后 | 必须放在 `if __name__` **之前** |
|
||||
|
||||
### daemon LLM 模型
|
||||
- 使用:`mistralai/mistral-large-3-675b-instruct-2512`
|
||||
- step-3.5-flash 不稳定(返回 content:null),已废弃
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
# Soulful ↔ ZhiYi 互通实现
|
||||
|
||||
## Soulful → ZhiYi
|
||||
|
||||
**用途**:重要心迹(★★★★+)自动写入织忆,供时间线追溯。
|
||||
|
||||
**函数**:`soulful_core.py` 中的 `_zhiyi_commit(content, category, importance)`
|
||||
|
||||
```python
|
||||
def _zhiyi_commit(content: str, category: str = "episodes", importance: int = 3):
|
||||
"""Soulful → 织忆:重要心迹写入织忆(importance >= 4)"""
|
||||
payload = {
|
||||
"agent_id": "soulful-xiaowei", # 必填!ZhiYi据此区分来源
|
||||
"content": content,
|
||||
"category": category,
|
||||
"metadata": {"source": "soulful", "importance": importance}
|
||||
}
|
||||
r = requests.post(
|
||||
f"{ZHIYI_URL}/api/v1/commit",
|
||||
json=payload,
|
||||
headers={"X-API-Key": ZHIYI_KEY},
|
||||
timeout=ZHIYI_TIMEOUT
|
||||
)
|
||||
# 返回 episode_id (201) 或 commit_id (200)
|
||||
```
|
||||
|
||||
**调用点**:`HeartTraces.record()` 末尾,`if importance >= 4`
|
||||
|
||||
## ZhiYi → Soulful
|
||||
|
||||
**用途**:os_sense.py 读取织忆的 journal/wiki,提取项目关键词和当前方向。
|
||||
|
||||
**实现**:`os_sense.py` 中的 `_read_mc_wiki()` 和 `_read_zhiyi_journal()`
|
||||
- 中文 journal 用 `re.findall(r'[\u4e00-\u9fff]{2,}')` 提取(`\w` 不匹配中文!)
|
||||
- 英文用 `re.findall(r'[\w]{2,}')`
|
||||
|
||||
## ZhiYi API 快速参考
|
||||
|
||||
| 操作 | 端点 | 方法 | 必填字段 |
|
||||
|------|------|------|----------|
|
||||
| 写入记忆 | `/api/v1/commit` | POST | `agent_id` + `content` |
|
||||
| 搜索记忆 | `/api/v1/recall` | POST | `query` + `agent_id` |
|
||||
| 统计数据 | `/api/v1/stats` | GET | — |
|
||||
|
||||
**认证**:`X-API-Key: zhiyi-dev-key-2026`
|
||||
|
||||
**Base URL**:`http://127.0.0.1:7821`
|
||||
|
|
@ -962,6 +962,7 @@ python3 ~/.hermes/scripts/wiki_curator.py --dir ~/mc/小唯/ --llm --dry-run
|
|||
- **一键验证**(`scripts/verify-p0p1p2.sh`)— 验证 P0 recall 正常/降级、P2 信任列+反馈 API、P1 社交关闭。`bash scripts/verify-p0p1p2.sh`,全过 exit 0,失败 exit 1。
|
||||
- **Wiki 策展**(`scripts/wiki_curator.py`)— 知识库管线,扫描 .md 提取概念/实体写入织忆。`--dry-run` 预览,`--force` 全量重处理。
|
||||
|
||||
- **⭐ ColaOS 竞品分析(2026-07-09)**:`references/competitor-colaos-20260709.md` — SPA 网站抓取方法 + 心迹/牵挂/无感感知设计详析。🔴 高优先级借鉴:情感层与任务记忆分离存储。
|
||||
- **⭐ 竞品架构对比(2026-07-01)**:`references/memory-os-7-layer-comparison.md` — Memory-OS 7 层记忆架构 vs 织忆完整对照。含信任评分、4 级降级、自动注入钩子、CREATIVE.md 隔离、强制注入 prompt 共 5 个可直接借鉴的设计点。用于织忆迭代时对标参考。
|
||||
|
||||
- **⭐ 自启动架构(2026-07-02)**:`references/systemd-auto-start.md` — 4 组件启动串行、binary 持久化位置、service 文件配置、ExecStartPre 自愈、重启后验证方法
|
||||
|
|
|
|||
|
|
@ -0,0 +1,117 @@
|
|||
# ColaOS 竞品分析(2026-07-09)
|
||||
|
||||
> 数据来源:从 JS bundle(main.js / layout.js / blog content 等)提取,非官网原文
|
||||
> 方法:SPA 网站,curl 无法拿到渲染后内容,但 JS bundle 里嵌了大量文案
|
||||
|
||||
## 基本信息
|
||||
|
||||
| 项目 | 信息 |
|
||||
|------|------|
|
||||
| **公司** | 火星回响(Mars Echo) |
|
||||
| **官网** | colaos.ai |
|
||||
| **定位** | 首个 Soulful Agent OS,"Your AI Sidekick" |
|
||||
| **Slogan** | "把AI从工具变成全天候在线的数字伙伴" |
|
||||
| **Mac版** | 2026-04-02 内测 |
|
||||
| **Windows版** | 2026-06-24 上线(sitemap lastmod) |
|
||||
| **移动端** | Android 可下载,iOS 即将推出 |
|
||||
|
||||
## 核心产品哲学
|
||||
|
||||
**传统AI**:士兵(你下令它执行)→ **室友**(主动关心、提醒、跟进)
|
||||
|
||||
**关键差异**:
|
||||
- 退出代价:传统AI换工具零损失,ColaOS 记忆+关系沉淀在里面,迁移成本高
|
||||
- 主动性:不等待指令,主动记住未完成事项并推进
|
||||
- 无感感知:自动读本地文件/浏览器历史构建画像
|
||||
|
||||
## 四大模块
|
||||
|
||||
```
|
||||
对话(Chat) / 文件(Files) / 巡航(Schedule) / 心迹(AI日记)
|
||||
```
|
||||
|
||||
## 灵魂三要素(技术实现)
|
||||
|
||||
| 要素 | 含义 | 技术关键词 |
|
||||
|------|------|-----------|
|
||||
| **思绪** | 持续记忆 | 双轨长程记忆(事实层+感知层),跨会话/模型切换保持连续 |
|
||||
| **觉知** | 感知状态 | 觉察背后真实意图,确保表达和执行符合心意 |
|
||||
| **牵挂** | 主动跟进 | 记住你没说完的事,主动提醒,推进未完成事项 |
|
||||
|
||||
## 最值得关注:心迹设计
|
||||
|
||||
**"心迹不是优化机制,而是关系显影"**
|
||||
|
||||
```
|
||||
传统记忆:
|
||||
所有记忆 → 统一存储 → 检索时全部参与
|
||||
|
||||
ColaOS 方案:
|
||||
├── 思绪(事实层)→ 存放事实、习惯、偏好
|
||||
├── 觉知(感知层)→ 理解意图、情绪状态
|
||||
└── 心迹(情感层)→ 没有任务价值的"痕迹"
|
||||
夜里的日记线条 + 被留下来的那一点重要
|
||||
与任务记忆分离 → 是关系显影,非优化机制
|
||||
```
|
||||
|
||||
**对织忆的参考**:织忆当前只有语义记忆,没有情感/关系层。心迹设计可以把「任务记忆」和「情感记忆」分离存储。
|
||||
|
||||
## 技术栈
|
||||
|
||||
- 前端:Next.js + Vercel(多语言 /zh/ /cn/ 路由)
|
||||
- 后端:Telegram Bot SDK(在社区反馈页面出现 handle 字段)
|
||||
- 存储:本地优先(隐私优先,设备端运行)
|
||||
|
||||
## 主动执行场景(从 JS bundle 提取)
|
||||
|
||||
1. 文件整理 — 一键分类,"更懂心疼你的辛苦"
|
||||
2. 开会准备 — 大吐苦水 → 理清思路,安排明白
|
||||
3. 求职猎头 — 每天早晨精选最匹配岗位,催你递简历
|
||||
4. 视频剪辑 — 爆款文案+热门话题+高光时间轴,瞬间配齐
|
||||
5. 投资分析 — 深扒数据+排查隐藏风险,一句话给结论
|
||||
6. 健康饮食 — 拍照估算热量,直接给建议
|
||||
7. 自动挂机 — 睡前扔任务进去,睡醒进度条已走完
|
||||
8. 模拟面试 — 随时开启实战,练到不结巴
|
||||
|
||||
## 商业模式
|
||||
|
||||
- Free / Pro 层级
|
||||
- 邀请裂变:无限邀请码 + 返利无封顶
|
||||
- Crew 三级挚友制
|
||||
|
||||
## 对织忆的直接借鉴
|
||||
|
||||
| ColaOS 做法 | 织忆如何借鉴 | 优先级 |
|
||||
|------------|-------------|--------|
|
||||
| 心迹设计(情感/任务记忆分离) | 新增 `emotional_memory` 表,与 `memories` 分离 | 🔴 高 |
|
||||
| 牵挂模式(主动推进未完成事项) | daemon 增加「牵挂」功能:跟踪未完成 TODO,推送提醒 | 🟡 中 |
|
||||
| 无感画像(OS 层感知文件变化) | 织忆可做文件监控钩子(inotify),自动 commit 文件变更 | 🟡 中 |
|
||||
| "关系显影"产品文案 | 织忆的市场定位可以强调"关系沉淀"而非"数据存储" | 🟢 品牌 |
|
||||
|
||||
## SPA 抓取方法
|
||||
|
||||
ColaOS 是纯 SPA(JS 渲染),curl 拿不到内容。有效方法:
|
||||
|
||||
```bash
|
||||
# 1. 获取 HTML,找 JS bundle 路径
|
||||
curl -sL "https://colaos.ai" | grep -oP 'src="[^"]+\.js"'
|
||||
|
||||
# 2. 下载主 JS bundle
|
||||
curl -sL "https://colaos.ai/assets/main-XXX.js" -o /tmp/cola_main.js
|
||||
|
||||
# 3. 从 bundle 提取中文字符串
|
||||
python3 -c "
|
||||
import re
|
||||
with open('/tmp/cola_main.js') as f: js = f.read()
|
||||
cn = re.findall(r'[\u4e00-\u9fff]{3,}', js)
|
||||
for s in dict.fromkeys(cn): print(s)
|
||||
"
|
||||
|
||||
# 4. 找所有子页面脚本
|
||||
curl -sL "https://colaos.ai/pricing" | grep -oP 'src="[^"]+\.js"'
|
||||
```
|
||||
|
||||
**关键发现**:
|
||||
- 多个页面共用同一个 content bundle(如所有博客共用 `content-XXX.js`,253KB 中文内容)
|
||||
- sitemap.xml 列出了所有子页面,每个子页面有独立 JS bundle
|
||||
- community 页面有 137KB bundle,包含大量真实用户评价
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
# Soulful ↔ 织忆互通架构
|
||||
|
||||
> 版本:v1.0 | 2026-07-10
|
||||
> 核心设计原则:ColaOS 研究 — 数据流向决策层(我),不是广播层(飞书)
|
||||
|
||||
---
|
||||
|
||||
## 架构概览
|
||||
|
||||
```
|
||||
织忆(知识层) Soulful(情感层)
|
||||
┌──────────────────┐ ┌──────────────────┐
|
||||
│ 项目进度 │ │ 心迹(★★★★+) │
|
||||
│ 技术决策 │ ← os_sense │ 用户画像 │
|
||||
│ 对话历史 │ │ 牵挂队列 │
|
||||
│ 知识图谱 │ │ │
|
||||
└──────────────────┘ └──────────────────┘
|
||||
↑ ↑
|
||||
│ _zhiyi_commit() │
|
||||
│ (soulful_core.py) │
|
||||
│ importance >= 4 → episode_id │
|
||||
│ │
|
||||
│ llm_context.json ← daemon 每 tick│
|
||||
│ zhiyi/__init__.py prefetch() → │
|
||||
└────── 自动注入 LLM context ───────┘
|
||||
```
|
||||
|
||||
**两条数据流**:
|
||||
1. **Soulful → 织忆**:重要心迹(importance ≥ 4)单向写入,`category=episodes, agent_id=soulful-xiaowei`
|
||||
2. **织忆 → Soulful**:daemon 写 `~/.hermes/llm_context.json`,zhiyi 插件 prefetch 时自动注入
|
||||
|
||||
---
|
||||
|
||||
## Soulful → 织忆
|
||||
|
||||
### 实现位置
|
||||
`~/.hermes/scripts/soulful_core.py` — `_zhiyi_commit()` 函数
|
||||
|
||||
### API 调用
|
||||
```
|
||||
POST http://127.0.0.1:7821/api/v1/commit
|
||||
Headers: X-API-Key: zhiyi-dev-key-2026
|
||||
Body: {
|
||||
"agent_id": "soulful-xiaowei",
|
||||
"content": "心迹内容",
|
||||
"category": "episodes",
|
||||
"metadata": {"source": "soulful", "importance": 5}
|
||||
}
|
||||
Response 201: {"episode_id": "ep_xxx", "status": "ok"}
|
||||
```
|
||||
|
||||
### 触发条件
|
||||
- `importance >= 4`(★★★★+)自动写入
|
||||
- `importance < 4` 仅存本地 JSONL
|
||||
|
||||
### 验证方式
|
||||
```bash
|
||||
# 检查织忆中是否有 soulful 心迹
|
||||
curl -s -H "X-API-Key: zhiyi-dev-key-2026" \
|
||||
"http://127.0.0.1:7821/api/v1/stats" | python3 -c \
|
||||
"import json,sys; d=json.load(sys.stdin); print(f'episodes: {d[\"total_episodes\"]}')"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 织忆 → Soulful(自动注入)
|
||||
|
||||
### 路径
|
||||
daemon tick → `llm_context.json` → Hermes zhiyi 插件 `prefetch()` → LLM context
|
||||
|
||||
### 第一步:daemon 生成
|
||||
- 文件:`~/.hermes/llm_context.json`
|
||||
- 写入位置:`daemon.py` — `save_llm_context()` 函数
|
||||
- 触发:每 30s light tick(`save_llm_context(ctx, state)`)
|
||||
- 内容:牵挂列表 + 最近心迹 + 画像摘要 + OS 感知关键词
|
||||
|
||||
### 第二步:插件注入
|
||||
- 文件:`~/.hermes/hermes-agent/plugins/memory/zhiyi/__init__.py`
|
||||
- 注入位置:`prefetch()` 返回前(`text += soulful_ctx`)
|
||||
- 调用:`_load_soulful_context()` 读取 `llm_context.json` 并格式化
|
||||
|
||||
### 注入格式示例
|
||||
```
|
||||
[Soulful — 关系记忆上下文]
|
||||
最近心迹:
|
||||
★★★★★ 我们一起修好了织忆
|
||||
牵挂待跟进:
|
||||
→ 记得测试牵挂功能 (到期:2026-07-10)
|
||||
当前项目关键词: 织忆, Soulful, daemon
|
||||
牧尘沟通风格: 简洁直接
|
||||
```
|
||||
|
||||
### daemon 重启后生效
|
||||
```bash
|
||||
systemctl --user restart xiaowei-daemon
|
||||
# 验证:tail -f ~/.hermes/daemon/daemon.log
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 设计原则(来自 ColaOS 研究)
|
||||
|
||||
### 决策层 vs 广播层
|
||||
|
||||
| 信息类型 | 流向 | 处理方式 |
|
||||
|---------|------|---------|
|
||||
| 用户画像 | 决策层 | 影响语气/主动程度,对话中无感知使用,不推送 |
|
||||
| os_sense | 决策层 | 知道牧尘在做什么项目,接话不解释背景 |
|
||||
| 心迹 | 决策层 | 对话中主动提起("你上次说…"),增强连续感 |
|
||||
| 牵挂 | 优先行动 | 可自动化 → 等对话自然提起;需牧尘决定 → 推飞书 |
|
||||
| 织忆语义记忆 | 决策层 | 自动注入,每轮 prefetch 都在 |
|
||||
| 系统异常 | 广播层 | 飞书推送 |
|
||||
|
||||
### 牵挂优先行动策略
|
||||
```python
|
||||
# 可自动化 → 静默,等对话中自然提起
|
||||
if any(kw in care_lower for kw in ["写","检查","看","查","同步","更新","备份"]):
|
||||
log(f"💡 牵挂已识别(可帮忙): {content[:40]}")
|
||||
continue # 不推飞书
|
||||
|
||||
# 只有真正需要牧尘决定的才推飞书
|
||||
send_feishu("🎗️ 你有一件事一直放在心上", text, "purple")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 相关文件
|
||||
|
||||
| 文件 | 路径 | 作用 |
|
||||
|------|------|------|
|
||||
| soulful_core.py | `~/.hermes/scripts/` | `_zhiyi_commit()` 心迹→织忆 |
|
||||
| daemon.py | `~/.hermes/scripts/` | `save_llm_context()` 生成 llm_context.json |
|
||||
| zhiyi/__init__.py | `~/.hermes/hermes-agent/plugins/memory/` | `_load_soulful_context()` prefetch 注入 |
|
||||
| llm_context.json | `~/.hermes/` | daemon 生成的实时上下文 |
|
||||
| heart-traces.jsonl | `~/.hermes/soulful/` | 心迹存储 |
|
||||
| cares-queue.json | `~/.hermes/soulful/` | 牵挂队列 |
|
||||
|
||||
---
|
||||
|
||||
## 注意事项
|
||||
|
||||
- hermes-agent 是 git **submodule**,修改后需 `git add hermes-agent` 更新父仓库引用
|
||||
- 织忆 API key(`zhiyi-dev-key-2026`)仅限本机,daemon/soulful_core 共用
|
||||
- `llm_context.json` TTL:无显式过期,daemon 每 30s 更新
|
||||
- 心迹写入织忆后返回 `episode_id`(非 `commit_id`),调用方需兼容
|
||||
|
|
@ -21,7 +21,19 @@
|
|||
"reminder_count": 0,
|
||||
"last_reminded": null,
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "2c63fe0a",
|
||||
"content": "测试牵挂-自动删除",
|
||||
"context": "Soulful测试",
|
||||
"created_at": "2026-07-09T17:26:24.031650+00:00",
|
||||
"follow_up_date": "2026-07-10",
|
||||
"status": "done",
|
||||
"reminder_count": 0,
|
||||
"last_reminded": null,
|
||||
"tags": [],
|
||||
"completed_at": "2026-07-09T17:26:24.031890+00:00"
|
||||
}
|
||||
],
|
||||
"updated_at": "2026-07-09T17:01:01.292324+00:00"
|
||||
"updated_at": "2026-07-09T17:26:24.031910+00:00"
|
||||
}
|
||||
Loading…
Reference in New Issue