Build1 distinct publisher3 min readUpdated
A cancel that still bounced the gateway traced to a planning baseline that had moved during planning. The fix ships with a test that counts a callback nobody wanted twice.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
Two different facts were sharing one variable. `currentCompareConfig` served as the acceptance baseline that planning needs in order to classify a candidate as hot, no-op or restart-required, and it was also read as though it described what the gateway had actually adopted [8][10]. Those two readings agree right up to the moment a restart is deferred, and a deferred restart is the case the issue is about.
The sequence in the pull request text is short. Candidate B arrives on a restart-required path, say `gateway.tools.allow`, and is accepted, so the baseline becomes B [9]. The file then settles back to bytes identical to the original A [6]. The planner diffs A against B, still sees protected-path changes, and re-arms the deferred restart [9]. The issue calls the leftover state restart debt: it latches onto the first restart-required candidate and survives every write that supersedes it, so an operator who probes a setting and immediately undoes it still loses Control UI and channel sessions for a full drain-then-SIGUSR1 cycle [7][6].
The patch leaves the acceptance baseline alone, because hot and no-op classification, runtime-overlay handling and managed-restart choreography all depend on it [10]. It adds `currentRuntimeCompareConfig` for exactly one decision, advancing it when the process adopts a snapshot and deliberately not advancing it for restart-deferred or runtime-skipped candidates [11]. That refusal is the fix. Advance it in the deferred case and you have rebuilt the original bug under a longer name.
The cancel itself is timid on purpose. It runs in both restart branches, immediately before `prepareRestart` arms anything, and only when the candidate deep-equals the runtime reference [12]. The published condition fires only with config-level diffs present, no plugin reload planned, no MCP disposal planned and an empty runtime diff [13]; plugin reload and MCP dispose plans are exempt so bundled-plugin work is never dropped by the shortcut [14]. That caution reads as earned, since a cancel gate in a reload path sits one loose boolean away from swallowing a restart somebody needed.
The test is the part worth stealing. It walks the runtime from A to B and back to A, then asserts a negative: `onRestart` exactly once, no `onHotReload`, no `onNoopConfigCommit` [15], with matching coverage at the handler surface [16]. Latched state rarely announces itself with a wrong value. It announces itself with an extra call, and only a test that counts calls will catch it.
One caveat on the day's scoreboard. The author reports three projects and three pull requests under the test-first rule, written for a DEV bug-smash contest [1][2][3], and two of the three are not described in the material at hand [17]. The documented one is the one worth reading anyway.
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
A new regression test in src/gateway/config-reload.test.ts, "does not re-request a restart when a deferred config reverts to the runtime baseline", starts the runtime on baseline config A, observes restart-required config B so onRestart fires once, then observes bytes identical to A again, and asserts onRestart is still exactly once with no onHotReload and no onNoopConfigCommit.
The author set one rule for the day: every fix has to be real and has to carry its own test that fails before the change and passes after it.
The author gave himself one day, and it produced work across three open source projects and three pull requests.
The write-up is a submission for DEV's Summer Bug Smash: Clear the Lineup, powered by Sentry.
OpenClaw is a personal AI assistant project written in TypeScript.
OpenClaw issue 119360 described that when a user changed a setting in the UI and then pressed cancel, the gateway still restarted, dropping every active session.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Detailed but single-sourced and self-reported
The OpenClaw portion is unusually specific for a blog post: a named issue, named code symbols, the exact gate condition, two named test files with test titles and asserted callback counts, a recorded failed first design, and a CI result. That specificity is checkable in principle, but everything comes from one self-reported publisher item with no maintainer confirmation, no merge record, and no second source; the other two claimed pull requests are not documented.
Pull request filed with green CI; no merge or downstream use shown
The only observable uptake is the contribution itself: a pull request against OpenClaw with a reported 206-check green CI matrix. Nothing in the source shows the change merged, released, or running for any operator, and no third-party usage of the pattern is reported.
Slightly overstated at the headline, disciplined in the body
The technical body is measured — scope limits are spelled out, plugin/MCP plans are exempted, and a failed first attempt is disclosed — so most claims sit close to their evidence. The overstatement is at framing level: 'three real open source bugs' and 'three pull requests' with 'a lot of green check marks' implies three verified landed fixes, while the text substantiates one in depth, one partially, and none as merged.
Contest submission sponsored by a vendor; author is the contributor
The post is explicitly a submission to DEV's Summer Bug Smash: Clear the Lineup powered by Sentry, which rewards visible, plentiful fixes, and the author is also the person whose work is being assessed. That combination biases toward emphasizing throughput and green results and away from unresolved review outcomes. There is no evidence of payment from the affected projects or of claims about the sponsor's product.
Moderate on the technical mechanism, low on outcomes
Confidence in the described mechanism and tests is reasonable because the account is internally consistent and highly specific, including a self-reported design correction forced by upstream CI. Confidence in outcomes is low: one publisher, one author, contest incentives, no merge or release confirmation, and an acknowledged gap in local test execution.
build
OpenClaw makes the channel the architecture, and the reasoning loop a lodger1 distinct publisher
build
Allow-list the closed set, block-list the open one: 193 thin geo pages, one gate1 distinct publisher
build
A GAN beauty filter is a device budget allocation, not a feature toggle1 distinct publisher
build
A build-tool swap that took 70 days and 166 files, and the build was the easy part1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 23, 2026