Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions dreadnode_cli/agent/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ def deploy(
agent_config = AgentConfig.read(directory)
ensure_profile(agent_config)

user_config = UserConfig.read()
server_config = user_config.get_server_config()

active_link = agent_config.active_link

client = api.create_client()
Expand Down Expand Up @@ -375,7 +378,7 @@ def deploy(

run = client.start_strike_run(agent.latest_version.id, strike=strike, model=model, user_model=user_model)
agent_config.add_run(run.id).write(directory)
formatted = format_run(run)
formatted = format_run(run, server_url=server_config.url)

if not watch:
print(formatted)
Expand All @@ -385,7 +388,7 @@ def deploy(
while run.is_running():
time.sleep(1)
run = client.get_strike_run(run.id)
live.update(format_run(run))
live.update(format_run(run, server_url=server_config.url))


@cli.command(help="List available models for the current (or specified) strike")
Expand Down Expand Up @@ -440,6 +443,9 @@ def latest(
agent_config = AgentConfig.read(directory)
ensure_profile(agent_config)

user_config = UserConfig.read()
server_config = user_config.get_server_config()

active_link = agent_config.active_link
if not active_link.runs:
print(":exclamation: No runs yet, use [bold]dreadnode agent deploy[/]")
Expand All @@ -451,7 +457,7 @@ def latest(
if raw:
print(run.model_dump(mode="json"))
else:
print(format_run(run, verbose=verbose, include_logs=logs))
print(format_run(run, verbose=verbose, include_logs=logs, server_url=server_config.url))


@cli.command(help="Show the status of the active agent")
Expand Down
8 changes: 7 additions & 1 deletion dreadnode_cli/agent/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def format_zones_verbose(zones: list[api.Client.StrikeRunZone], *, include_logs:
return Group(*components)


def format_run(run: api.Client.StrikeRunResponse, *, verbose: bool = False, include_logs: bool = False) -> Panel:
def format_run(
run: api.Client.StrikeRunResponse, *, verbose: bool = False, include_logs: bool = False, server_url: str = ""
) -> Panel:
# Main run information
table = Table(show_header=False, box=box.SIMPLE)
table.add_column("Property", style="dim")
Expand All @@ -278,6 +280,10 @@ def format_run(run: api.Client.StrikeRunResponse, *, verbose: bool = False, incl
table.add_row("model", run.model.replace(USER_MODEL_PREFIX, "") if run.model else "<default>")
table.add_row("agent", f"{agent_name} ([dim]rev[/] [yellow]{run.agent_revision}[/])")
table.add_row("image", Text(run.agent_version.container.image, style="cyan"))
if server_url != "":
table.add_row(
"run url", Text(f"{server_url.rstrip('/')}/strikes/agents/{run.agent_key}/runs/{run.id}", style="cyan")
)
table.add_row("notes", run.agent_version.notes or "-")

table.add_row("", "")
Expand Down
Loading