Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#17 17 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend, cli

Research direction

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.

Written by the indexing model from the issue text.

Description

场景 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 写入加进程内互斥 + 世代号;把「洪峰时排队还是丢弃」的决策点显式暴露给桥方。

Dominant language
Python
Stars
2
Forks
0
Avg merge
3h 32m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.