feat: add auto-detect daemon for Claude Code / Codex / OpenClaw instances#75
feat: add auto-detect daemon for Claude Code / Codex / OpenClaw instances#75liaoandi wants to merge 2 commits intoringhyacinth:masterfrom
Conversation
|
Thanks a lot for this PR — this is actually a feature we'd really like to have. Before we could consider merging it, there are two important things we'd want to address:
Ideally this should be opt-in, clearly explained to the user, and disabled by default until permission is granted. In general, we think this is a strong direction, but it's also a relatively large upgrade touching product design, privacy expectations, and testing scope. So even if we move forward with it, we'd want to do a few more rounds of refinement and testing before merging. Really appreciate the contribution — we're interested in the feature, but we'd want to tighten these parts before taking it further. |
…nces Implements ringhyacinth#65. A lightweight Python daemon that auto-detects running agent processes, syncs their status to Star Office, and cleans up on exit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
回应 ringhyacinth 在 PR ringhyacinth#75 中的 review 意见: 1. 端口:全部脚本和文档中 28791 → 19000 2. 授权机制:默认关闭,用户需在 UI 中明确开启。Daemon 每次轮询检查授权, 未授权不读取任何本机进程状态。关闭时自动清除所有已检测 agent。 授权机制: - /config/auto-detect GET/POST 接口,含授权版本追踪 - 运行时配置新增:auto_detect_enabled, consent_granted_at, consent_version - Daemon 在授权循环中等待,关闭时清除 agent - Agent 来源标记为 "local-auto-detect",区分手动接入 - 最多 8 个自动检测 agent,超限返回 429 - daemon_status 四态语义:disabled / waiting-consent / running / stopped 前端: - 钢蓝色像素精灵按钮(检测关闭/检测中.../检测开启 三态) - 关闭态暗色,检测中呼吸动画,开启态亮色 - 开启需弹窗确认,关闭单击直接生效 - 弹窗锚定按钮右侧,滚动时跟随 - 访客 agent 点位避开家具(休息区/工作区) 守护进程与检测器: - 进程存在 = writing(交互式编程工具,非后台服务) - OpenClaw 通过 gateway.log 修改时间判断 idle/writing - 优雅退出时清除所有已追踪 agent 其他: - 国际化:检测相关文案支持中/英/日三语 - 压缩背景图 1MB → 105KB --- Addresses ringhyacinth's review on PR ringhyacinth#75: 1. Port: 28791 → 19000 across all scripts and docs 2. Consent: off by default. Users must explicitly enable via UI. Daemon checks consent every poll — no local process state read until opted in. Disabling clears all detected agents. Consent: /config/auto-detect GET/POST API, consent version tracking, agent source tagged "local-auto-detect", max 8 agents (429 on exceed). daemon_status: disabled / waiting-consent / running / stopped. Frontend: steel-blue pixel sprite button with 3 states (off/detecting/on), popup confirm to enable, single click to disable, scroll-following popup, agent spawn points avoid furniture. Daemon: process-based detection (running = writing). OpenClaw uses gateway.log for idle/writing. Graceful cleanup on shutdown. i18n: zh/en/ja. Compress office_bg_small.webp (1MB → 105KB). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d36b1f5 to
6107aa7
Compare
|
Hi @ringhyacinth, thanks for the detailed review! I've addressed both points: 1. Port: 28791 → 19000 ✅ 2. Explicit user consent ✅
Other improvements in this update:
Happy to iterate further if needed! |
Summary
Implements #65.
Files
Pure addition — no changes to existing code.
Key design decisions
urllib,subprocess,json)Usage
python scripts/auto_detect/daemon.py python scripts/auto_detect/daemon.py --url https://office.hyacinth.im --key ocj_xxx --interval 15 python -m scripts.auto_detect.daemon # module mode also worksTest plan
python -m scripts.auto_detect.daemonworks概要
实现 #65。
关键设计决策
urllib、subprocess、json)#2)在每轮保持稳定用法
python scripts/auto_detect/daemon.py python scripts/auto_detect/daemon.py --url https://office.hyacinth.im --key ocj_xxx --interval 15 python -m scripts.auto_detect.daemon # 也支持模块方式运行Closes #65
🤖 Generated with Claude Code