Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

feat(sdk): 并发面零机制——无背压无并发上限,同 session 并发 resume 未定义,洪峰行为(排队 vs 丢弃)未显式化

未关闭
#17 17 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend, cli

调研方向

Start with spec/protocol.md:317 and the SDK state and locking code in init.py:269 and :311-317; inspect the runner, hub, and CLI entry points for existing concurrency behavior. Clarify the per-session, global-limit, lock-generation, and surge-handling semantics before choosing an implementation. Done means the SDK exposes and tests those decisions without session history corruption or unbounded process fan-out.

由索引模型根据 Issue 内容生成。

描述

场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无

基线 HEAD = 840392d。

Summary

spec/protocol.md:317 把并发划出 scope("concurrent requests … out of scope by design"),SDK 全层也无任何原语:三语言 runner/hub/cli grep 无信号量/队列/并发上限;run() 可无限并发、每调用 spawn 一进程。具体缺口:

  1. 同 session 两条快消息 → 两个 CLI 进程并发 --resume 同一 session——协议只字未提其行为(CLI 侧 transcript 分叉与否未定义);
  2. 每会话状态仅 ~/.agentproc/sessions/<id>.jsonl(__init__.py:269),append_history 无文件锁(:311-317)——并发追加交错;
  3. run lock 是 opt-in 且同 key 并发时 write_run_lock 后写覆盖前写、先结束者 clear_run_lock 误清在跑者的锁;
  4. IM 洪峰时既不排队也不丢弃——直接进程扇出直到 OOM,每进程数百 MB RSS。

影响

im-agentproc 类常驻桥接方必须各自从零实现串行化/限流;不同桥接方行为碎片化,同用户连击产生 session 分叉/历史交错。

建议

SDK 提供 per-session 串行化原语 + 全局并发闸(信号量/拒绝语义可配);run lock 写入加进程内互斥 + 世代号;把「洪峰时排队还是丢弃」的决策点显式暴露给桥方。

主要语言
Python
星标
2
派生
0
平均合并
3 小时 32 分钟
30 天内合并 PR
13

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。