Fix restart delay operator precedence and status KV write initialization#80
Draft
Copilot wants to merge 2 commits into
Draft
Fix restart delay operator precedence and status KV write initialization#80Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…ialization Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review issues and fix low hanging fruit
Fix restart delay operator precedence and status KV write initialization
Feb 20, 2026
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.
Two bugs in process lifecycle management:
restartDelayMswas silently ignored whenwatchwas also configured, and application state was not persisted to KV store for the first 20 seconds after startup.Operator precedence:
restartDelayMsignored whenwatchis set??has higher precedence than?:, so the intended fallback expression was evaluated incorrectly:Any process with both
restartDelayMsandwatchconfigured would always restart with a 500ms delay regardless of the configured value.Status KV write skipped for first 20 seconds
lastWritewas initialized toDate.now(), causingDate.now() - this.lastWrite > APPLICATION_STATE_WRITE_LIMIT_MSto be false on every watchdog tick until 20 seconds had elapsed. Changed initialization to0so the first write happens on the first watchdog tick. Also removed the now-unreachableif (!this.lastWrite)dead code block, and corrected the misleading docblock that claimedlast_application_statewas written on every iteration.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.deno.land/usr/bin/curl curl -s REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.