feat: wave 3 — reconfigure safety (merge writes, password, test-before-apply, drain) - #22
Merged
Merged
Conversation
…e-apply, drain) Wave 3.1 — Merge-based .setup.env writes (closes #9) - /setup now loads existing .setup.env and merges form fields into it, preserving any env vars not managed by the form (e.g. keys rotated via /manage/keys/rotate, or custom env vars) - Uses the same Settings.write path as /manage/keys/rotate (consistent) - MCP keys for unchecked MCPs are dropped; re-checked MCPs preserve keys Wave 3.2 — No surprise password regen (closes #10) - Blank password on reconfigure = keep current (not auto-generate) - Separate 'change_password' field for explicit password changes - First-run still auto-generates if blank (unchanged bootstrap behavior) - Success page only shows password when (re)generated or explicitly changed Wave 3.3 — Server-side test-before-apply on provider key (closes #11) - On reconfigure: if the provider key differs from current, validate it live before writing .setup.env or restarting the child - On failure: form re-rendered with error, no restart, no .setup.env write - First-run is exempt (the standalone Test button is the validation path) Wave 3.4 — Graceful drain on restart + 503 Retry-After (closes #12) - ChildProcess.draining flag set during restart - Proxy returns 503 + Retry-After: 10 when child is draining or down - Restart method accepts reason parameter (manual, reconfigure, etc.) Tests: 7 new test cases. 114 total, all passing. Lint + format clean.
wra-sol
force-pushed
the
feat/wave-3-reconfigure-safety
branch
from
June 29, 2026 03:26
de04915 to
a64f652
Compare
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.
Summary
Wave 3 of the opencode manager improvement plan. Four slices, one PR.
3.1 — Merge-based .setup.env writes (closes #9)
/setupnow loads the existing.setup.envand merges form fields into it, preserving any env vars not managed by the form (e.g. keys rotated via/manage/keys/rotate, or custom env vars added out-of-band). Uses the sameSettings.writepath as/manage/keys/rotatefor consistency. MCP keys for unchecked MCPs are dropped; re-checked MCPs with blank key fields preserve existing keys.3.2 — No surprise password regen (closes #10)
Blank password on reconfigure = keep current (not auto-generate). A separate
change_passwordfield is shown on the reconfigure form for explicit password changes. First-run still auto-generates if blank (unchanged bootstrap behavior). The success page only shows the password when it was (re)generated or explicitly changed.3.3 — Server-side test-before-apply on provider key (closes #11)
On reconfigure: if the provider key differs from the current one (or the provider changed),
validate_provider_keyruns before writing.setup.envor restarting the child. On failure: the form is re-rendered with an error, no restart, no.setup.envwrite. First-run is exempt (the standalone Test button is the validation path there).3.4 — Graceful drain on restart + 503 Retry-After (closes #12)
ChildProcess.drainingflag is set during restart. The proxy returns503 + Retry-After: 10when the child is draining or down (replaces the old bare 503 with no retry hint). The restart method accepts areasonparameter (manual,reconfigure, etc.) for better telemetry.Tests
7 new test cases:
114 total tests pass. Lint + format clean.