fix(http): SSE 无 Last-Event-ID/重放——lagged 静默丢弃 + 1h 硬超时强制重连,断线窗口事件永久丢失
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Read src/http/handlers.rs around lines 1155, 1301, 1308-1328, and 1338 to trace the per-session broadcast channel, lag handling, and one-hour timeout. Check how SSE requests are parsed and how GET /sessions/:id is exposed before defining the event sequence and bounded replay behavior. Done means SSE events have monotonic IDs, reconnects honor Last-Event-ID, and the since endpoint can replay missed events.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:depends-on: #117(未终态时 keeper 自动 hold)
基线 HEAD = 9165b9a0。
Summary
- 每会话
broadcast::channel(64)(src/http/handlers.rs:1155,1301);消费慢于 64 条时BroadcastStream的 Lagged 错误被Err(_) => None静默丢弃(handlers.rs:1308-1328)——不报错、不重放,直接缺段。 - 全程无
Last-Event-ID读取、无事件序号/重放缓冲;连接有 1h 硬超时强制重连(handlers.rs:1338),重连即从订阅时刻开始。 - C 端弱网/移动端网络切换/代理超时重连是常态:断连窗口内的 PartialMessage/ToolCall/ToolResult/Done 全部丢失,客户端流式状态机无法恢复;最终兜底只有
GET /sessions/:id的 committed 消息(partial 与工具进度无补偿)。
建议
每会话保留有界事件环形缓冲 + 单调 seq,SSE 事件带 id,支持 Last-Event-ID 头与 GET /sessions/:id/events?since=<seq> 重放。
- Dominant language
- Rust
- Stars
- 4
- Forks
- 0
- Avg merge
- 5h 32m
- Merged PRs (30d)
- 7
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jeffkit/recursive
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
jeffkit/recursive#159 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 8/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
Maintainers usually reply within 1 day
All issues in jeffkit/recursive
Similar issues
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
NuSkooler/enigma-bbs#907 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug pixi-build-r
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
prefix-dev/pixi#7229 ·
Maintainers usually reply within 1 day