8000 feat(collector): run registered extra tasks and reveal Paseo sessions in resume for 0.12.4 by InfinityPacer · Pull Request #53 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content

feat(collector): run registered extra tasks and reveal Paseo sessions in resume for 0.12.4 - #53

Merged
InfinityPacer merged 1 commit into
mainfrom
feat/collector-tasks
Oct 25, 2026
Merged

InfinityPacer merged 1 commit into
mainfrom
feat/collector-tasks

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

问题

  • 想在 Mac 上定期跑的小脚本只能各自装定时任务,分散难管。
  • Paseo 以无界面模式启动 Claude Code,产生的会话不出现在 claude --resume / /resume 的列表里,只能凭会话 ID 打开。Claude Code 按会话记录开头的 entrypoint 是否为 sdk-cli、sdk-ts、sdk-py 决定是否列出。

变化

  • 本机采集器新增额外任务:meterleaf-collector tasks add <名称> [--every 分钟] [--timeout 秒] -- <绝对路径> [参数...],以及 tasks、tasks run、tasks remove。任务在每轮同步之后、同一把运行锁内按间隔顺序运行,服务端不可达时照常运行;失败或超时只写错误日志,不影响同步和其他任务;status 显示已登记的任务。
  • 任务输出写入文件而不是管道,任务结束或超时时整个进程组一起终止,脱离进程组的子进程也不会拖住同步持锁。
  • 帮助和文档说明:只读保证只针对采集器本身,额外任务读写什么由登记者负责。
  • 新增可选脚本 scripts/claude-resume-visibility.ts。只处理属于 Paseo 代理、有你直接发出的消息、且没有进程在运行的会话,把开头 64 KiB 内的 entrypoint 原地改成等长的 "cli" 加空格。文件身份和大小不变,Claude Code 的追加写入与采集器的续读都不受影响。改动记入任务状态目录,可用 --revert 改回。子代理、上下文压缩摘要和中断提示不算你发出的消息。
  • 版本 0.12.4。只需替换本机采集器,服务端不用升级,数据库结构未变。

验证

  • bun test tests:567 通过,0 失败,含新增的任务调度、超时、进程组、校验和脚本改写、改回、资格判断测试。
  • bun run typecheck、bun run build、bun run build:collector 通过。
  • 端到端:用构建出的 Meterleaf.app 在独立数据目录登记任务并 tasks run,一个新建的 claude -p 会话从隐藏变为出现在真实的 claude --resume 列表里,打开后对话历史正常,文件逐行可解析。
  • 真实数据预演(--dry-run):21 个会话将显示,12 个运行中暂不处理。
  • 独立代码审查发现的任务挂起、退出码误记为超时、压缩摘要被当成人发消息、空命令校验抛异常等问题均已修复并补了回归测试。

🤖 Generated with Claude Code

… in resume for 0.12.4

The collector can now run user-registered local commands after each sync,
under the same run lock, with a per-task interval and timeout. Output goes to
a file rather than pipes so a lingering child cannot hold sync open, and the
task's process group is killed when it exits or times out.

scripts/claude-resume-visibility.ts is an optional task that makes Claude
Code sessions you talked to through Paseo appear in the resume picker, by
rewriting the head entrypoint in place with equal-length bytes. Sub-agent and
running sessions are left alone, and every change can be reverted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@InfinityPacer
InfinityPacer merged commit 74794e6 into main Oct 25, 2026
2 checks passed
@InfinityPacer
InfinityPacer deleted the feat/collector-tasks branch October 25, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0