feat(admin): expose the retry-attempt controls in the UI (#4487 follow-up) - #4503
feat(admin): expose the retry-attempt controls in the UI (#4487 follow-up)#4503Yeraze wants to merge 1 commit into
Conversation
…w-up) #4502 shipped the retry mechanism and registered `adminRetryAttempts` in VALID_SETTINGS_KEYS, but never wired it into the Settings UI — so the feature could only be turned on by POSTing to the settings API by hand, and the per-send `retryAttempts` override only by crafting the request body. Both were unreachable from the app, which made the setting look wired up when it wasn't. Adds: - A new admin-only "Remote Administration" Settings section with an "Admin command attempts" input (1..10, default 1). Wired through every place the settings recipe calls for: the SettingsDraft type, buildBaseline(), the initial* snapshot and its dep array, the server load path, the post-save re-seed, and the hand-maintained handleSave literal. - A per-send "Attempts for this command" box in Admin Commands → Target Node. Blank defers to the setting, so it only ever narrows scope to the node being worked on; the key is omitted from the body entirely when unset, leaving the server's own fallback in charge. Two things the tooling caught rather than review: - server.settings-persistence.test.ts failed with `expected ['adminRetryAttempts'] to equal []` — every key SettingsTab sends must either be loaded by SettingsContext or be a known server-only key. This one is genuinely server-only (only the admin routes read it), so it joins the allowlist next to meshcoreCliTimeoutSeconds with the same reasoning. - The lint ratchet flagged react-hooks/exhaustive-deps 1→2. Not style: the executeCommand useCallback now reads retryAttemptsOverride, so without the dep it would capture a stale value and send the PREVIOUS override. tsc was happy and it only misbehaves on the second send after a change, so the ratchet was the only thing that would have caught it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9NzRtqE8eSMS8tvAeodUB
|
Claude finished @Yeraze's task —— View job PR Review: feat(admin): expose the retry-attempt controls in the UITasks:
Overall this is a clean, well-structured follow-up. The settings recipe is followed correctly across all the required touchpoints, and the PR description itself gives a clear accounting of what was done. A few observations below.
|
Follow-up to #4502.
#4502 shipped the retry mechanism and registered
adminRetryAttemptsinVALID_SETTINGS_KEYS— but never wired it into the Settings UI. The result: the feature could only be enabled by POSTing to the settings API by hand, and the per-sendretryAttemptsoverride only by crafting the request body yourself. Neither was reachable from the app, which made the setting look wired up when it wasn't. My miss.What's added
Settings → Remote Administration (new, admin-only): an "Admin command attempts" input, 1–10, default 1. Wired through every place the settings recipe calls for — the
SettingsDrafttype,buildBaseline(), theinitial*snapshot and its dep array, the server load path, the post-save re-seed, and the hand-maintainedhandleSaveliteral.Admin Commands → Target Node: a per-send "Attempts for this command" box. Blank defers to the setting, so it only ever narrows scope to the node being worked on — the key is omitted from the request body entirely when unset, leaving the server's own fallback in charge.
Two things the tooling caught, not review
server.settings-persistence.test.tsfailed withexpected ['adminRetryAttempts'] to equal []. Every keySettingsTabsends must either be loaded bySettingsContextor be a known server-only key — this guards the #2048 class of bug where a setting is saved but never read back.adminRetryAttemptsis genuinely server-only (only the admin routes read it, no frontend state depends on it), so it joins the allowlist besidemeshcoreCliTimeoutSecondswith the same reasoning spelled out.The lint ratchet flagged
react-hooks/exhaustive-depsgoing 1→2. Not a style nit: theexecuteCommanduseCallbacknow readsretryAttemptsOverride, so without the dep it captures a stale value and sends the previous override.tscwas perfectly happy, and it only misbehaves on the second send after changing the value — the ratchet was the only thing in the pipeline that would have caught it.Test plan
success: true, 13017 passed, 0 failed.server.settings-persistence.test.tspasses, including the source-extraction check over thehandleSaveliteral.npx tsc --noEmitclean;npm run lint:ciback to no FAIL lines.Note
Retry remains opt-in: the default is still 1 attempt, so nothing changes until an operator sets it. That's deliberate — every extra attempt is real airtime on a shared band.
Generated by Claude Code