mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 22:19:42 +02:00
docs(remote): document the wake-on-LAN invariants; drop wake state on bulk delete
Self-review pass: the input-ladder's two 'buffer' branches were the same three lines, and bulk delete left a session's (bounded, per-random-uuid) wake state behind. Documents the design where the code refers to it - remote-sessions.md section, the architecture invariant, and the CLAUDE.md key pattern.
This commit is contained in:
+4
-8
@@ -214,15 +214,11 @@ export class RemoteWakeRegistry {
|
||||
|
||||
if (action === 'deliver') return 'deliver';
|
||||
if (action === 'buffer') {
|
||||
// A buffered decision with no wake in flight (the wake failed and the state
|
||||
// was reset, or the very first input of a session in the throttle window)
|
||||
// must still drive a wake, or the bytes would sit in the buffer forever.
|
||||
if (state.waking == null && remote?.wakeCommand) {
|
||||
this._enqueue(session.id, data);
|
||||
void this.wake(session);
|
||||
return 'buffered';
|
||||
}
|
||||
this._enqueue(session.id, data);
|
||||
// A buffered verdict with no wake in flight still has to DRIVE a wake (the
|
||||
// previous one failed and reset the probe state, or the ladder landed here
|
||||
// directly) — otherwise the bytes would sit in the buffer forever.
|
||||
if (state.waking == null && remote?.wakeCommand) void this.wake(session);
|
||||
return 'buffered';
|
||||
}
|
||||
|
||||
|
||||
@@ -1322,6 +1322,7 @@ export function registerSessionRoutes(
|
||||
|
||||
for (const id of sessionIds) {
|
||||
if (ctx.sessions.has(id)) {
|
||||
remoteWake.drop(id);
|
||||
await ctx.cleanupSession(id, true, 'user_bulk_delete');
|
||||
killed++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user