Repository navigation
fix(daemon): Preserve sessions when active-work close is refused #9134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
b316e9e
618717f
211d0cb
70cc7b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -216,6 +216,18 @@ export const ACTIVE_WORK_CLOSE_IF_UNHELD_PARAM = 'onlyIfUnheld'; | |
| * longer buys nothing — an unanswered request is simply left for the next | ||
| * snapshot to settle. */ | ||
| export const ACTIVE_WORK_CLOSE_TIMEOUT_MS = 10_000; | ||
|
|
||
| /** | ||
| * The child's drain budget for a `sessionClose` round trip: strictly under | ||
| * the daemon's outer wait so the child deadline always fires first, clamped | ||
| * to ≥1ms so a tiny outer wait still yields a usable budget. An outer wait | ||
| * that fires first leaves the close outcome unknown, which the close path | ||
| * recovers by killing the whole channel — the coupling lives here exactly | ||
| * once so the ratio cannot drift between call sites. | ||
| */ | ||
|
doudouOUC marked this conversation as resolved.
Resolved
|
||
| export function sessionCloseDrainBudgetMs(outerWaitMs: number): number { | ||
| return Math.max(1, Math.floor(outerWaitMs * 0.8)); | ||
| } | ||
|
doudouOUC marked this conversation as resolved.
Resolved
Comment on lines
+228
to
+230
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] R4-8: The docstring invariant — "strictly under the daemon's outer wait so the child deadline always fires first" — does not hold for Suggested fix: state the ≥2ms precondition in the doc comment (keeping the pinned test honest) — or, for 中文说明docstring 断言的不变量——“严格小于 daemon 的外层等待,使 child 截止总是先触发”——在 建议修复:在文档注释中注明 ≥2ms 前提(使被钉住的测试保持诚实)——或在 — qwen3.8-max via Qwen Code /review (v0.21.11) |
||
| /** Bounds on a single snapshot. Generous next to any real deployment — they | ||
| * exist so a version-skewed or buggy child cannot make the daemon walk an | ||
| * unbounded structure per report, not to constrain legitimate use. A packet | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.