feat(orchestrator): ✨ Add host label parameter to bootstrap registration for per-host instance identification
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
1d89a522f1
commit
d8cdd3d259
1 changed files with 19 additions and 4 deletions
|
|
@ -347,8 +347,9 @@ def _send_kick(*, rcl: Rclaude, cwd: str) -> None:
|
|||
)
|
||||
|
||||
|
||||
def _register_remote_control(*, rcl: Rclaude, cwd: str) -> None:
|
||||
"""Register the orchestrator session with claude.ai/code.
|
||||
def _register_remote_control(*, rcl: Rclaude, cwd: str, host_label: str) -> None:
|
||||
"""Register the orchestrator session with claude.ai/code as
|
||||
`claire@<host>` so per-host Claires are distinguishable in the browser.
|
||||
|
||||
`/remote-control` is a Claude *slash command* — it only takes effect
|
||||
delivered as literal input, never from prose. The bootstrap kick is a
|
||||
|
|
@ -356,9 +357,14 @@ def _register_remote_control(*, rcl: Rclaude, cwd: str) -> None:
|
|||
text), so the command itself is delivered as a separate send. This is
|
||||
what makes the orchestrator appear as a remote session the user can
|
||||
drive from the browser / claude.ai/code.
|
||||
|
||||
`host_label` is the canonical fleet label for the machine running this
|
||||
orchestrator (apricot / plum / …) — caller passes
|
||||
`cfg.this_host_label()` for local spawns, `cfg.orchestrator.host` for
|
||||
remote spawns.
|
||||
"""
|
||||
rcl.send(
|
||||
text="/remote-control claire",
|
||||
text=f"/remote-control claire@{host_label}",
|
||||
match=_cwd_slug(cwd),
|
||||
yes=True,
|
||||
dry_run=False,
|
||||
|
|
@ -593,8 +599,17 @@ def ensure_running(
|
|||
# Register with claude.ai/code so the user can drive the orchestrator
|
||||
# from the browser. Non-fatal — it still works via Claire's chat
|
||||
# regardless of whether remote-control registration succeeds.
|
||||
# The registration name is `claire@<host>` so per-host Claires stay
|
||||
# distinct in the browser dropdown.
|
||||
host_label = (
|
||||
cfg.orchestrator.host
|
||||
if is_remote
|
||||
else cfg.this_host_label()
|
||||
)
|
||||
try:
|
||||
_register_remote_control(rcl=rcl, cwd=effective_cwd)
|
||||
_register_remote_control(
|
||||
rcl=rcl, cwd=effective_cwd, host_label=host_label,
|
||||
)
|
||||
except RclaudeError:
|
||||
pass
|
||||
return new_uuid
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue