fix: grouped low-severity backend & frontend correctness fixes (lr-129b)#237
Open
akuehner wants to merge 1 commit into
Open
fix: grouped low-severity backend & frontend correctness fixes (lr-129b)#237akuehner wants to merge 1 commit into
akuehner wants to merge 1 commit into
Conversation
9a: daemon-projects rescan now broadcasts relay.getProjects().length instead of
config.projects.length (config was always undefined in the interval closure)
9b: loop_complete notification captures currentSessionId into _lastSessionId
before clearing loopState, so sessionId is no longer always null
9c: add cyan entry to ANSI table in bin/cli.js so the setfacl install hint
renders correctly instead of printing literal "undefined"
9d: spawnAndRestart writes updated PID synchronously (fs.writeFileSync) before
process.exit(120), preventing a race window with a concurrent CLI read
9e: worker shutdown resolves pendingAskUser with {behavior:"deny",...} and
pendingElicitations with {action:"reject"} instead of Error objects
9f: parseJsonBody tracks accumulated byte length during streaming and destroys
the request once it exceeds MAX_UPLOAD_BYTES*1.4, before full buffering
9g: renderSessionList calls startCountdownTimer() after each render so the
countdown UI appears when schedules enter the 3-minute window post-init
9h: renderPermissionRequest checks DOM for an existing data-request-id node
before appending, preventing duplicate cards on WS reconnect
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task: lr-129b
Eight independent low-severity correctness fixes across backend and frontend.
9a. daemon-projects periodic rescan broadcasts projectCount: 0
rescanWorktreesinterval closure did not passconfig, soconfigwas always undefined andprojectCountwas always 0. Broadcast now usesrelay.getProjects().lengthdirectly.9b. loop_complete notification always reported sessionId: null
loopState.currentSessionIdwas cleared at line 693 before being read at the notification call. Captured into_lastSessionIdbefore the clear, following the same pattern used for_loopOwnerUserId.9c. cli.js printed literal "undefined" in the setfacl install hint
The ANSI table
ahad nocyankey. Addedcyan: "\x1b[36m"so thea.cyanreference in the setfacl hint renders correctly.9d. saveConfig fire-and-forget before process.exit(120) in spawnAndRestart
saveConfigis async;process.exit(120)frequently fired before the write flushed, leavingdaemon.jsonwith a stale PID. Now usesfs.writeFileSyncon the exit path with a synchronous fallback tosaveConfigon write error.9e. worker shutdown resolved callbacks with Error objects
pendingAskUser[k]andpendingElicitations[k]were resolved withnew Error(...)where the SDK expects shaped objects. Changed to{ behavior: "deny", message: "Worker shutting down" }and{ action: "reject" }.9f. upload size limit enforced only after full body was buffered
parseJsonBodyaccumulatedbody += chunkunbounded; the size check ran only after full accumulation. Now tracks accumulated byte length per chunk and destroys the request once it exceedsMAX_UPLOAD_BYTES * 1.4, preventing large in-memory buffers before the limit fires.9g. countdown timer never started after sessions loaded
startCountdownTimer()was called once at init when the schedule list was empty and returned early. Nothing re-invoked it when schedules later entered the 3-minute window. Added a call at the end ofrenderSessionList— it is a no-op when schedules are outside the window or the timer is already running.9h. permission_request re-render duplicated a card on WS reconnect
renderPermissionRequestdeduped against the in-memorypendingPermissionsmap only. On reconnect,pendingPermissionsis cleared while the prior DOM node (carryingdata-request-id) may survive, causing a duplicate card. Added a DOM query check before the append.Test plan
npm testpasses (exit 0)