Skip to content

Commit c223ca8

Browse files
committed
Clarify headless app-server worker naming
1 parent 64df055 commit c223ca8

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

crates/broker/src/cli/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ enum Commands {
2525
Init(InitCommand),
2626
Pty(PtyCommand),
2727
Headless(HeadlessCommand),
28-
AppServer(AppServerCommand),
28+
/// Internal: headless worker shim for app-server-backed harnesses.
29+
#[command(name = "app-server", hide = true)]
30+
HeadlessAppServer(HeadlessAppServerCommand),
2931
/// Compute MCP injection args and side-effect config file paths for a CLI
3032
/// without spawning it. Outputs JSON to stdout.
3133
McpArgs(McpArgsCommand),
@@ -53,7 +55,7 @@ impl Commands {
5355
Commands::Init(_) => "init",
5456
Commands::Pty(_) => "pty",
5557
Commands::Headless(_) => "headless",
56-
Commands::AppServer(_) => "app_server",
58+
Commands::HeadlessAppServer(_) => "app_server",
5759
Commands::McpArgs(_) => "mcp_args",
5860
Commands::Swarm(_) => "swarm",
5961
Commands::DumpPty(_) => "dump_pty",
@@ -88,8 +90,8 @@ impl Commands {
8890
}
8991
Commands::Headless(cmd) => non_empty_name(cmd.agent_name.as_deref())
9092
.unwrap_or_else(|| format!("headless-{pid}")),
91-
Commands::AppServer(cmd) => non_empty_name(cmd.agent_name.as_deref())
92-
.unwrap_or_else(|| format!("app_server-{pid}")),
93+
Commands::HeadlessAppServer(cmd) => non_empty_name(cmd.agent_name.as_deref())
94+
.unwrap_or_else(|| format!("headless-app-server-{pid}")),
9395
Commands::Wrap { cli, .. } => format!("wrap-{cli}-{pid}"),
9496
Commands::McpArgs(_) => format!("mcp_args-{pid}"),
9597
Commands::DumpPty(cmd) => format!("dump_pty-{}-{}", cmd.name, pid),
@@ -118,7 +120,7 @@ pub(crate) async fn run() -> Result<()> {
118120
Commands::Init(cmd) => runtime::run_init(cmd, telemetry).await,
119121
Commands::Pty(cmd) => pty_worker::run_pty_worker(cmd).await,
120122
Commands::Headless(cmd) => runtime::run_headless_worker(cmd).await,
121-
Commands::AppServer(cmd) => runtime::run_app_server_worker(cmd).await,
123+
Commands::HeadlessAppServer(cmd) => runtime::run_headless_app_server_worker(cmd).await,
122124
Commands::McpArgs(cmd) => cli_mcp_args::run_mcp_args(cmd).await,
123125
Commands::Swarm(args) => swarm::run_swarm(args).await,
124126
Commands::DumpPty(cmd) => runtime::run_dump_pty(cmd).await,
@@ -277,7 +279,7 @@ pub(crate) struct HeadlessCommand {
277279
}
278280

279281
#[derive(Debug, clap::Args, Clone)]
280-
pub(crate) struct AppServerCommand {
282+
pub(crate) struct HeadlessAppServerCommand {
281283
#[arg(long)]
282284
pub(crate) protocol: String,
283285

crates/broker/src/runtime/app_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct AppServerAuthConfig {
1010

1111
const APP_SERVER_HTTP_TIMEOUT: Duration = Duration::from_secs(30);
1212

13-
pub(crate) async fn run_app_server_worker(cmd: AppServerCommand) -> Result<()> {
13+
pub(crate) async fn run_headless_app_server_worker(cmd: HeadlessAppServerCommand) -> Result<()> {
1414
let protocol = cmd.protocol.trim().to_ascii_lowercase();
1515
let endpoint = cmd.endpoint.trim().trim_end_matches('/').to_string();
1616
let session_id = cmd.session_id.clone();

crates/broker/src/runtime/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ use crate::{
4949
},
5050
};
5151

52-
use crate::cli::{AppServerCommand, DumpPtyCommand, DumpPtyFormat, HeadlessCommand, InitCommand};
52+
use crate::cli::{
53+
DumpPtyCommand, DumpPtyFormat, HeadlessAppServerCommand, HeadlessCommand, InitCommand,
54+
};
5355
use crate::worker::{WorkerEvent, WorkerHandle, WorkerRegistry};
5456
use crate::{broker, listen_api, routing, worker_request};
5557

0 commit comments

Comments
 (0)