feat(sdk): 并发面零机制——无背压无并发上限,同 session 并发 resume 未定义,洪峰行为(排队 vs 丢弃)未显式化
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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 一进程。具体缺口:
- 同 session 两条快消息 → 两个 CLI 进程并发
--resume同一 session——协议只字未提其行为(CLI 侧 transcript 分叉与否未定义); - 每会话状态仅
~/.agentproc/sessions/<id>.jsonl(__init__.py:269),append_history无文件锁(:311-317)——并发追加交错; - run lock 是 opt-in 且同 key 并发时
write_run_lock后写覆盖前写、先结束者clear_run_lock误清在跑者的锁; - 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 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
good first issue
难度 2/5 1-3 小时 新手友好度 85/100
btclib-org/btclib-node#1955 ·
维护者通常 1 天内回复
-
documentation v0.9.2
难度 2/5 半天 新手友好度 72/100
khuisman/mcp-gee-sweet#1033 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
ossf/cve-bin-tool#5966 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
write_iceberg ignores the table's write.parquet.compression-codec property可能已有人在做 @YuangGao 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
Eventual-Inc/Daft#7606 ·
维护者通常 1 天内回复