Conversation
The services-host question took the first configured ADMIN_HOSTMASKS entry as its default and wrote [that one] back on a blank answer, so a re-run with two hosts dropped the second silently. It also indexed the value directly - a comma-separated setting offered its first character - and ran a wildcard first entry through the validator as if typed. Hosts are read as the console reads them (admin_host_patterns) and shown; blank writes nothing, a host already there changes nothing, a new one replaces a single host or is added beside several. Eight tests through collect_answers(), six failing on the old code; two source guards follow the moved statements. INSTALL.md and both changelogs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AP6LSxkr4n9dMFNSNMogmW
This was referenced Sep 22, 2026
Collaborator
Author
|
Superseded by #909 (merged), which fixed the reported case - Enter no longer collapses the hosts. Two cases this PR covered are still open on main and are filed separately rather than lost: retyping a host that is already configured still replaces all the others, and a comma-separated ADMIN_HOSTMASKS is read as characters. The chain that was stacked on this (#904 -> #905 -> #906) has been rebased onto main. |
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.
Fixes #891. Found reviewing #811.
What was wrong
configure.py's services-host question took the first configuredADMIN_HOSTMASKSentry as its default and, on a blank answer, wrote[that one]back. An operator with two hosts (home and phone) who re-ranconfigure.pyand pressed Enter lost the second - silently - and the phone could no longer run admin commands.configure._current()'s own promise is that re-running never does that.Two smaller faults in the same lines: it indexed the value directly, so a comma-separated string setting (which
adminchataccepts) offered its first character as the default; and a wildcard first entry (*!*@*.home.net) was run through the validator as if just typed - Enter printed "That will not do: '*.home.net' has a '*' in it" about a value nobody entered.What changed
adminchat.admin_host_patterns(): either form, deduplicated, host part only - and shown (Configured now: ...), with the prompt saying what blank does.Test
tests/test_a_rerun_of_configure_keeps_every_admin_host.py(8), throughcollect_answers()with canned input like #811's own tests: two hosts + blank writes nothing (the reported case); one host + blank; typing a host already there (case-insensitively); a new host beside several is added and they are kept; a new host replacing the only one; a wildcard entry is not put through the validator; a comma-separated setting read as hosts; and nothing configured behaving exactly as #811 wrote it. Six fail on the old code; the other two are the cases that deliberately do not change.Two source guards followed the moved statements: #700's question-order guard anchors on the prompt's new home (a variable, at the same point in the source), and
test_a_blank_answer_writes_nothingon the new condition - its property is now also executed by the tests above.Verified
Full suite on current main: 6429 OK (18 skipped).
🤖 Generated with Claude Code
https://claude.ai/code/session_01AP6LSxkr4n9dMFNSNMogmW