Skip to content

fix: reduce parent overhead with session reuse and bounded waits - #13

Merged
zhoushoujianwork merged 1 commit into
mainfrom
fix/issue-11
Oct 26, 2026
Merged

zhoushoujianwork merged 1 commit into
mainfrom
fix/issue-11

Conversation

@zhoushoujianwork

Copy link
Copy Markdown
Owner

Fixes #11

改动

  • 会话复用工作流:skill、README、两种模式的安装策略(basic/proactive)共用同一段 sessionReusePolicy,说明调查→实现→评审修正使用同一个 offload -r 会话、何时新开会话、压缩导致历史不是无限或逐字保留,并给出完整示例。
  • resume 保持 profile:已记录的 profile 被删除或改名时,不再静默回退到默认 provider,而是报错并给出恢复步骤(恢复 profile,或用 -p 新开会话,offload show 查看旧报告)。
  • 禁止同会话重叠:offload -r 发现该会话仍有活动运行(live 状态)时以 exit 2 拒绝;已结束的运行不阻塞。中断的运行需先用 offload show/git diff 检查,部分修改保留。
  • 减少轮询:offload watch -t <时长> 作为一次长等待;所有 worker 结束返回 0,到期仍有活动 worker 返回 124(不是 worker 失败)。STALLED/LOST/超时/失败照常输出。文档给出宿主完成通知优先、否则少量长等待的回退方案,且不操作用户桌面。
  • 紧凑报告:worker 提示词要求紧凑报告(结果、改动文件/关键引用、检查、未解决问题),并说明 resume 时需重新读文件、以后续指令的修正与验收标准为准。
  • 评估口径:文档要求报告父会话轮询/工具轮数、父/worker token(缓存与非缓存分开)、耗时、失败;成本不可用即 unknown,无可比基线不声称节省。

测试

gofmt、go vet ./...、go test -race ./... 全部通过。新增:已删除 profile 的 resume、活动会话拒绝与结束后恢复、watch -t 到期返回 124、watch 参数校验、policy/skill/README 一致性。

假设与限制

  • 活动会话检测依赖 live 状态文件(官方说明为 advisory),只缩小重叠窗口,不是强锁。
  • 未实现 token 统计或基线对比,也没有做真实的“轮询轮数”对比实验;该验收项只提供了机制(watch -t)和文档,未给出实测数据。
  • 未检查宿主(Codex/Claude)具体的完成通知机制,文档按“若有则优先”描述。
  • 已安装的策略需 offload install-agent 刷新并新开 agent 会话后生效。

@zhoushoujianwork
zhoushoujianwork merged commit f7d4b99 into main Oct 26, 2026
1 check passed
@zhoushoujianwork
zhoushoujianwork deleted the fix/issue-11 branch October 26, 2026 03:53
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.

Reduce parent-model overhead through session reuse and quieter worker coordination

1 participant