Repository navigation
fix(provider): forward the delta-checkpoint rollback to the launchd provider job - #1630
Conversation
…rovider job Delta complete checkpoints (#1591) are on by default and DARKBLOOM_PREFIX_CACHE_SSD_INCREMENTAL_CHECKPOINTS=0 is their rollback, but the key was not in LaunchAgent's environment allowlist. launchd does not inherit the installing shell, so the export reached only a foreground provider; the background provider job kept writing deltas, and restarts and watchdog recovery reuse its saved plist. Add SSDPrefixCachePolicy.incrementalCheckpointsFlag to LaunchAgent.inferencePassthroughEnvKeys, next to the MiMo complete-prefix rollback, so `darkbloom start` persists it into the provider plist. The watchdog plist stays without it: the watchdog never writes the cache. LaunchAgentEnvironmentTests.forwardsDeltaCheckpointRollbackToProviderJob checks list membership, the watchdog exclusion, and that the provider plist resolves the same setting as the shell through the production reader for unset, empty, 0, " OFF ", false, no, 1 and an unknown value. It fails with 7 issues when the allowlist entry is removed. Docs: the configuration row says the key is forwarded; the CLI reference lists it among the forwarded variables; the SSD cache reference names it with the forwarded cache switches. The unreleased delta-complete-checkpoints fragment now says the rollback reaches the background provider.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Threat model review — advisoryReviewed head Reviewers: anthropic/claude-sonnet-5.5: first pass completed; anthropic/claude-opus-5.5: selected depth completed (3 batches); openai/gpt-6.1-sol: not needed by escalation policy No actionable findings in the reviewed text. This is not a security approval. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Scan completed. Coverage: 47/47 source units; cross-file integration complete. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned. Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 10 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. Bedrock: 7 request(s), 339482 uncached + 0 cache-read + 0 cache-write input / 5235 output tokens; 0 request(s) with unknown usage. OpenRouter backup used 0 time(s). Dollar amounts above cover OpenRouter only; AWS billing is reconciled separately. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The fragment said the rollback reaches the background provider "like the other rollback switches", but not every default-on rollback is forwarded: configuration.md says the Bonsai performance controls are not in the LaunchAgent passthrough, and cli-reference.md says the same of the Qwen4 profile rollbacks. State only what this switch does. The cli-reference forwarded-variables row restated the negative values 0/false/no/off, which configuration.md defines once as its parsing convention; the section itself says effects and defaults are specified once there. Say "a negative value", as the ssd-kv-cache.md row for the same variable already does. Docs only; no code or test change. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(release): prepare provider 0.10.4 Set ProviderCore.version to 0.10.4 and mark v0.10.3 as published on 2026-10-26 (tag target 3ddd11c). Open the v0.10.4 candidate entry with its upgrade and rollout notes: deploy darkbloom-platform#516 close to the rollout (Qwen JSON prompts render without thinking; mixed versions fail cache receipts with prompt_anchor_mismatch but still serve), the client-visible Qwen JSON changes (no default reasoning, a grammar-constrained answer cut short is a 422 after streaming, no MTP beside a constrained row), forced tool_choice on four more models without a version floor, delta checkpoints across upgrade and rollback, the unauthorized re-registration cadence, the status served-line format, the add-on hold (darkbloom-platform#514 already in production), unchanged MLX pins, and the entries that build no provider artifact. Update the release runbook: the 0.10.4 scope, the pin and metallib checks before tagging, the rollout order and post-tag platform snapshot, the 0.10.2 enablement steps that still apply, platform evidence inspected on 2026-10-27, and the published history. The pending changelog fragments are rendered in the next commit. * chore(release): render the pending changelog fragments into provider 0.10.4 Insert the output of python3 scripts/changelog.py render --version 0.10.4 --date 2026-10-27 \ base-reward-zero-reason.md ci-darkbloom-runner-routing.md \ coordinator-reconnect-stall.md coordinator-traffic-verdict.md \ delta-complete-checkpoints.md desktop-release-sign-dmg.md \ desktop-update-feed.md forced-tool-choice-admission.md \ json-response-format-enforcement.md landing-agent-documents.md \ provider-addon-hold-hardening.md provider-addon-hold.md \ status-served-session-counts.md switch-model-cache-directory.md verbatim, without its heading line, below the v0.10.4 upgrade and rollout notes, and remove exactly those 14 fragments. The render ran against an export of origin/master aa2887f, whose changelog.d matches this branch, because the renderer refuses a version that CHANGELOG.md already names. This commit is mechanical so the final roll-up can revert it, merge master and render again once the in-flight 0.10.4 changes have landed. * Revert "chore(release): render the pending changelog fragments into provider 0.10.4" This reverts commit f673fff. * chore(release): update 0.10.4 rollout notes for #1630, #1631, #1633 and platform #491/#541 The re-registration note now states which evidence counts (#1633); the delta-checkpoint off switch is forwarded to the launchd job (#1630); the coordinator to deploy before the tag must include #516, #491 and #541; #1631 joins the non-provider entries. * chore(release): correct the 0.10.4 rollout notes from the review pass - A prompt_anchor_mismatch receipt quarantines the provider's cache capability for the whole model (coordinator CacheQuarantineCommit.Apply; ProofFenceBase 60 s, doubling to ProofFenceMax 10 min), not only the mismatched requests' affinity. Say so in the changelog note and runbook step 1, and cite the platform code in the evidence table. - #1599 shipped in v0.10.2 (99e1059 is an ancestor of f9d1af3), not first in the v0.10.3 hotfix. - Drop the runbook's "platform change that pushes trust_status when legacy authorization starts is in progress": that change is darkbloom-platform#541, merged as 6beb8514, which step 1 already requires. - Step 1: deploy shortly before the tag, matching the changelog's "close to this rollout" for #516, and limit #491's 5 s refresh to App Attest serving (startUnauthorizedStatusRefresh returns unless ServingEnabled). - Step 3: name LatestProviderVersion instead of the dangling "That fallback constant", and scope "only ProviderCore.swift should change" to the snapshotted inputs. - Evidence: production 2acffb5c also lacks #491 and #541; add rows for the #491/#541 status behavior and the quarantine. * changelog: delta complete checkpoints apply to Qwen native recurrent layouts, not only Qwen 3.8 Eligibility follows the checkpoint layout (native-paged/contiguous-full-recurrent-v1), which Qwen 3.5/3.6 MTP builds also produce; the fragment is rendered verbatim into 0.10.4. * chore(release): render the pending changelog fragments into provider 0.10.4 Verbatim scripts/changelog.py render output for the 15 fragments pending on master (rendered from a master export, since CHANGELOG.md already names 0.10.4), inserted below the rollout notes; exactly those fragments deleted. #1427 is not in 0.10.4 and its fragments stay with it.
The merge adds #1566, #1591, #1602, #1605, #1606, #1607, #1612, #1621, #1622, #1623, #1625, #1629, #1630, #1631, #1632 (provider 0.10.4), #1633, #1644, #1652 and #1653 to this branch. Conflicts and resolutions: - CoordinatorClient+Connection.swift: #1606 moves the transport setup out of connectAndRun into the static function connectionParameters(for:), and puts the connectAndRun header below it. This branch adds the session parameter to the same header. The merge keeps the layout of master. The moved header has the signature of this branch: connectAndRun(_ session: CoordinatorSessionRecorder). Git merged the other changes without a conflict: the bounded handshake of master (CoordinatorConnectionHandshake.start) and the session recorder of this branch (markOpened after register, the session parameter of sessionLoop and receiveLoop, and the close-code read). - docs/provider/cli-reference.md: the runtime constants table. The merge keeps the three reconnect rows and the ping/pong row of this branch. It adds the handshake deadline row of master after the ping/pong row, where master has it. - docs/provider/troubleshooting.md: only the "Last updated" stamp had a conflict (2026-10-26 on this branch, 2026-10-27 on master). The merge keeps one stamp, 2026-10-27. Git merged the rows: the backoff citation of this branch and the new rows of master. Each decision has one owner after the merge: - CoordinatorReconnectPolicy chooses the wait before the next connection attempt, after each end of a session or of an attempt. - CoordinatorConnectionHandshake (#1606) cancels a handshake that does not complete in 30 s. runLoop catches the timeout error. That attempt did not send register, so the policy gives the next backoff range, as on master. - UnauthorizedConnectionRecovery (#1607, #1633) decides when to start a re-registration of a connection that the coordinator refuses. Its retry backoff counts re-registrations, not connection attempts, and an authorized verdict sets that count to zero. The re-registration closes the session. Then the policy chooses the wait, as for each other end. Checks: against master, the merge has only the changes of this branch, in its 15 files. The troubleshooting stamp is the one exception: it has the date of master. Against this branch, the merge has only the changes of master, in 651 files. The one exception is the connectAndRun header, which has the session parameter. The gitlinks do not change: libs/mlx 31f550af, libs/mlx-swift 4926d3d9, libs/mlx-swift-lm aee6ebb6. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Summary
Delta complete checkpoints (#1591, merged, unreleased; ships in 0.10.4) are on by default, and
DARKBLOOM_PREFIX_CACHE_SSD_INCREMENTAL_CHECKPOINTS=0is their rollback. The key was not in the LaunchAgent environment allowlist (docs/reference/configuration.mdeven said "Not forwarded to LaunchAgents"). launchd does not inherit the installing shell, so the rollback reached onlydarkbloom start --foreground. Production providers run as the launchd job, so operators could not roll delta checkpoints back without a new release.This PR forwards the key exactly like the other default-on rollback switches (
DARKBLOOM_MIMO_COMPLETE_PREFIX,DARKBLOOM_TTFT_GDN_BLOCKED, …): it joinsLaunchAgent.inferencePassthroughEnvKeys, sodarkbloom startpersists it into the provider plist, and restarts, updates and watchdog recovery keep it. The watchdog plist stays without it: the watchdog never writes the cache.SSDPrefixCachePolicy.incrementalCheckpointsFlagtoLaunchAgent.inferencePassthroughEnvKeys(beside the MiMo complete-prefix rollback)provider-swift/Sources/ProviderCore/Service/LaunchAgent.swiftprovider-swift/Tests/ProviderCoreTests/Service/LaunchAgentRestartTests.swift(forwardsDeltaCheckpointRollbackToProviderJob)docs/reference/configuration.md,docs/provider/cli-reference.md,docs/reference/ssd-kv-cache.mddarkbloom startcopies it;darkbloom restartkeeps the saved environment)changelog.d/delta-complete-checkpoints.mdBefore
flowchart TB subgraph PB["Behavior on master (0.10.4 candidate)"] direction LR ob["Operator exports<br/>INCREMENTAL_CHECKPOINTS=0<br/>then runs darkbloom start"]:::input --> lb["Provider plist<br/>key dropped by the allowlist"]:::gap lb --> jb["launchd provider job<br/>keeps writing delta checkpoints"]:::gap fb["darkbloom start --foreground"]:::input --> sb["SSDPrefixCachePolicy.incrementalCheckpoints<br/>false: complete files"]:::code end subgraph QB["Code and docs"] direction LR kb["LaunchAgent.inferencePassthroughEnvKeys<br/>no incremental-checkpoints key"]:::gap db["configuration.md:<br/>Not forwarded to LaunchAgents"]:::gap end PB ~~~ QB style PB fill:#f8fafc,stroke:#64748b,color:#0f172a style QB fill:#f8fafc,stroke:#64748b,color:#0f172a classDef input fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef code fill:#e0e7ff,stroke:#4338ca,color:#1e1b4b classDef gap fill:#fee2e2,stroke:#b91c1c,color:#7f1d1dAfter
flowchart TB subgraph PA["Behavior with this PR"] direction LR oa["Operator exports<br/>INCREMENTAL_CHECKPOINTS=0<br/>then runs darkbloom start"]:::input --> la["Provider plist<br/>carries the key"]:::new la --> ja["launchd provider job<br/>writes complete files;<br/>restart, update and watchdog keep it"]:::new fa["darkbloom start --foreground"]:::input --> sa["SSDPrefixCachePolicy.incrementalCheckpoints<br/>false: complete files"]:::code end subgraph QA["Code and docs"] direction LR ka["LaunchAgent.inferencePassthroughEnvKeys<br/>+ SSDPrefixCachePolicy.incrementalCheckpointsFlag"]:::new --> ta["Test: plist and shell resolve<br/>the same setting; watchdog excluded"]:::new da["configuration.md, cli-reference.md,<br/>ssd-kv-cache.md, changelog fragment"]:::new end PA ~~~ QA style PA fill:#f8fafc,stroke:#64748b,color:#0f172a style QA fill:#f8fafc,stroke:#64748b,color:#0f172a classDef input fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef code fill:#e0e7ff,stroke:#4338ca,color:#1e1b4b classDef new fill:#dcfce7,stroke:#15803d,color:#14532dLegend: blue is operator input, indigo is unchanged code, red is the gap on
master, green is what this PR adds.INCREMENTAL_CHECKPOINTSabbreviatesDARKBLOOM_PREFIX_CACHE_SSD_INCREMENTAL_CHECKPOINTS.Validation
All local, on
aa2887f1d+ this commit (Apple Silicon, Xcode Swift 6.4,swift build --build-tests, staged source-matched metallib6ccc6296…), with daemon state isolated as inscripts/run-provider-tests.sh:../scripts/run-nested-suite.sh 'LaunchAgentEnvironmentTests|LaunchAgentServicePlistTests|LaunchAgentPathsAndErrorsTests|LaunchAgentRestartTests|WatchdogLaunchAdapterTests|LaunchAgentLifecycleTests|SSDCheckpointDeltaTests' --no-parallel0," OFF ",false,no) resolving differently in the plist than in the shell, and the0rollbackmake changelog-check,make changelog-previewmake docs-impact-check BASE=origin/mastermake docs-checkorigin/master's output: all cite removedconsole-ui/paths (the known master-wide leftovers another change is removing). None involve files this PR touchesThe test reads the production parser (
SSDPrefixCachePolicy.incrementalCheckpoints) for unset, empty,0," OFF ",false,no,1and an unknown value, so renaming the key or changing the parser keeps shell and launchd in agreement or fails the test.Limitations
darkbloom startwrites the plist (it drains and replaces a running provider).darkbloom restart, self-update and watchdog recovery reuse the saved plist and do not import newly exported variables; the CLI reference already documents this, and the fragment repeats it for the rollback.darkbloom startwith the variable set. Nothing changes for operators who do not set it (deltas stay on).LaunchAgentEnvironmentTests, the test exercises the pure plist construction (makeServicePlist,passthroughEnvironment).DARKBLOOM_PREFIX_CACHE_SSD_MAX_STAGE_MB/_MS,DARKBLOOM_PREFIX_CACHE_SSD_STRICT_FSYNC, …) are unchanged.Changelog
changelog.d/delta-complete-checkpoints.mdis #1591's unreleased 0.10.4 fragment. This PR completes that change's rollback, so it amends the fragment in place rather than adding a second one:CONTRIBUTING.mdasks to keep follow-up edits in the change's fragment and not split one change across several files.CHANGELOG.mdis untouched.Refactor pass
AGENTS.md requires a dedicated refactor subagent before opening a PR. No subagent-spawning tool was available in this session, so that gate is not satisfied by a subagent; per the task owner's fallback, I did a careful self-review of the full diff instead (scope, naming, placement beside the sibling rollback, test parity with the #1536 precedent, docs consistency). Outcome: no code changes; two prose fixes (a list sentence in
ssd-kv-cache.md, the fragment's sentence structure). A maintainer may want an independent refactor review before merge.CI note
Docs Lint and Console UI currently fail on
masteritself because ofconsole-ui/leftovers (being fixed separately); expect those two to fail here for that reason only. All provider jobs should be green.Scope: Provider (Swift), Documentation. No protocol, telemetry, state-file or release-identity change.
Need help on this PR? Tag
@codesmith-botwith what you need.Independent refactor pass (completed)
A dedicated refactor reviewer (separate agent) confirmed the code and test need no changes: the key reuses
SSDPrefixCachePolicy.incrementalCheckpointsFlag, sits beside the sibling SSD-cache opt-out, and the test mirrorsforwardsGDNPromptKernelRollbackToProviderJob(#1536). It verified on every relaunch path thatrestart,update, background auto-update and watchdog recovery reuse the saved plist environment, and onlystartrebuilds it. Two doc fixes (df31a426a): the fragment no longer claims all rollback switches are forwarded (Bonsai and Qwen4 profile rollbacks are not), and the cli-reference row defers to the canonical negative-value definition.