Skip to content

Commit b91a1c5

Browse files
maxholmanclaude
andcommitted
fix: show fixed role immediately in info, fix -H flag dispatch
1. When --role is set with Fixed hint, info now shows the configured role immediately instead of "indeterminate" until a peer connects. With a fixed hint there is no negotiation — the role is decided. 2. -H/--host flag no longer triggers daemon dispatch. The heuristic "first arg starts with dash = daemon mode" incorrectly routed wallhack -H /path route list to the daemon CLI instead of the control client. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1b78edb commit b91a1c5

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

crates/cli/src/bin/wallhack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ fn main() {
4747
&& args.get(1).is_some_and(|a| {
4848
// "wallhack daemon" passthrough.
4949
a == "daemon"
50-
// Any flag argument: auto-negotiation or global daemon options.
50+
// Any flag argument EXCEPT -H/--host (shared with ctl CLI).
5151
// Control client commands are always bare words, never flags.
52-
|| a.starts_with('-')
52+
|| (a.starts_with('-') && *a != "-H" && *a != "--host")
5353
}));
5454

5555
if is_daemon {

crates/daemon/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,15 @@ pub fn start_node(
137137
ModeConfig::Entry(_) => NodeRole::Entry,
138138
ModeConfig::Exit(_) => NodeRole::Exit,
139139
ModeConfig::Relay(_) => NodeRole::Relay,
140-
ModeConfig::Auto(_) => NodeRole::Indeterminate,
140+
ModeConfig::Auto(cfg) => match &cfg.hint {
141+
Some(hint) if hint.level == wallhack_wire::data::HintLevel::Fixed as i32 => {
142+
wallhack_wire::data::NodeRole::try_from(hint.target)
143+
.ok()
144+
.map(NodeRole::from)
145+
.unwrap_or(NodeRole::Indeterminate)
146+
}
147+
_ => NodeRole::Indeterminate,
148+
},
141149
};
142150

143151
let metrics = Arc::new(Metrics::default());

0 commit comments

Comments
 (0)