fix: remove abort listener leak in abortableSleep - #4
Conversation
The onAbort listener was attached to the AbortSignal but never removed when the timer resolved normally. Over repeated retry attempts this leaked listeners on the signal, causing a slow memory leak for long-lived AbortController instances. Remove the listener in the timer callback, matching the cleanup pattern used by fetchWithTimeout above. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thank you for your interest in contributing to kimi-code. |
|
Planning note for issue/PR #4 (investigation only, no code changes made in this phase). Requirement confirmed:
Affected scope:
Implementation plan:
Validation plan:
Environment note from investigation:
|
|
Execution update for #4 Actual changes:
Validation:
E2E:
Remaining risk:
|
|
Planning update for #4 (2026-06-17, investigation only; no code changes made in this phase). Requirement confirmed:
Affected scope found in code:
Implementation plan:
Validation plan:
Local investigation note:
|
|
Workmonitor issue-flow plan stage 20260618-024737 issue #4 Planning phase only; no code changes made in this phase. Requirement confirmed:
Code scope checked:
Implementation plan:
Validation plan:
Environment note from this investigation:
|
|
Workmonitor issue-flow investigation stage 20260618-032544 issue #4 Investigation stage only; no code changes were made in this phase. Requirement confirmed:
Code scope checked:
Specific implementation plan:
Validation plan:
Environment note from this investigation:
|
|
Workmonitor issue-flow execute stage 20260618-032544 issue #4 Execution summary:
Validation results:
E2E/API/browser verification:
Remaining risk:
This stage intentionally does not close #4. |
|
Workmonitor issue-flow e2e stage 20260618-032544 issue #4 E2E/API verification completed for the telemetry retry cleanup. Command run:
What the temporary API e2e script verified:
Result:
Notes and remaining risk:
This stage intentionally does not close #4. |
|
Workmonitor issue-flow final stage 20260618-032544 issue #4 Final summary for #4:
Validation completed:
E2E/API status:
Residual risk:
Requirement status:
|
|
Workmonitor issue-flow investigation stage 20260618-133001 issue #4 Investigation stage only; no code changes were made in this phase. Requirement confirmed:
Code scope checked:
Specific implementation plan:
Validation plan:
Environment note from this investigation:
|
|
Workmonitor issue-flow execute stage 20260618-133001 issue #4 Execution summary:
Validation results:
E2E/API verification:
Remaining risk:
This execution stage intentionally does not close #4. |
|
Workmonitor issue-flow e2e stage 20260618-133001 issue #4 E2E/API verification completed for the telemetry retry listener cleanup. Command run:
What this verified:
Result:
Why this is API e2e rather than browser/Playwright:
Remaining risk:
This stage intentionally does not close #4. |
|
Workmonitor issue-flow final stage 20260618-133001 issue #4 Final summary for #4:
Key behavior/file changes:
Validation results:
E2E/API status:
Residual risk:
Requirement status:
|
- kimy wrapper: move hash writes after smoke test (MoonshotAI#1) - kimy wrapper: add public/ to web hash inputs (MoonshotAI#3) - kimy wrapper: widen vis hash to include config files (MoonshotAI#4) - kimy wrapper: move lockfile from /tmp to ~/.kimy/bin (MoonshotAI#5) - kimy wrapper: use explicit package list for native hash (MoonshotAI#7) - 01-bundle.mjs: skip vis-asset build when already done (MoonshotAI#2) - justfile: sync deploy with new wrapper, add deploy-full (MoonshotAI#9,MoonshotAI#10,MoonshotAI#11) - flake.nix: add unpin guidance to nixpkgs comment (MoonshotAI#12)
…MoonshotAI#4) Root cause of 'user message not displayed, only AI output': sendPrompt and startSessionAndSendPrompt submitted the prompt via the REST API but did NOT insert anything into rawState.messagesBySession until the daemon's WS messageCreated event came back. When that event was slow (network, daemon busy, sub-agent fan-out), the user saw their text vanish into the void — the agent's response would stream in but the user's own message was missing until the echo arrived, sometimes seconds later. The reducer already had full machinery for optimistic reconciliation (findOptimisticUserEchoIndex, OPTIMISTIC_USER_MESSAGE_METADATA_KEY, matching by promptId / exact content / loose content) but nothing was producing optimistic messages to feed it. Fix: insert an AppMessage placeholder into messagesBySession[sid] BEFORE calling submitPrompt, tagged with the OPTIMISTIC_USER_MESSAGE_ METADATA_KEY so the reducer recognizes it. After submitPrompt resolves, stamp the returned promptId onto the placeholder — that gives the reducer its fastest reconciliation path when the echo arrives. On submit failure the placeholder is removed (better than leaving a bubble the user thinks succeeded). Exported OPTIMISTIC_USER_MESSAGE_METADATA_KEY_EXPORT from eventReducer so client.svelte.ts can build the placeholder without hardcoding the metadata key string. svelte-check 0 errors.
Summary
Test plan
🤖 Generated with Claude Code