refactor(agent): use agent-neutral runtime names
Assisted-by: Codex
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
"""Unit: SmolmachinesBottle's `claude_argv` builder.
|
||||
"""Unit: SmolmachinesBottle's `agent_argv` builder.
|
||||
|
||||
The dashboard's tmux pane-respawn path calls `bottle.claude_argv`
|
||||
The dashboard's tmux pane-respawn path calls `bottle.agent_argv`
|
||||
directly (it spawns claude inside a tmux pane rather than as a
|
||||
child of the current process), so the argv shape is the
|
||||
non-trivial part. `exec_claude` is a thin wrapper around the same
|
||||
non-trivial part. `exec_agent` is a thin wrapper around the same
|
||||
builder + `subprocess.run`; we lock the shape here.
|
||||
|
||||
The TTY-mode argv is wrapped in the pty_resize helper (issue #82
|
||||
@@ -40,7 +40,7 @@ class TestClaudeArgvWrapped(unittest.TestCase):
|
||||
"""TTY-mode argv: pty_resize wrapper + inner smolvm exec."""
|
||||
|
||||
def test_pty_resize_wrapper_prefix(self):
|
||||
argv = _bottle().claude_argv([])
|
||||
argv = _bottle().agent_argv([])
|
||||
# Absolute script path (not `-m <dotted>`) so the tmux
|
||||
# pane's cwd doesn't matter — see the `_PTY_RESIZE_SCRIPT`
|
||||
# docstring in bottle.py.
|
||||
@@ -53,7 +53,7 @@ class TestClaudeArgvWrapped(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_minimal_inner_argv_no_prompt(self):
|
||||
argv = _unwrap(_bottle().claude_argv([]))
|
||||
argv = _unwrap(_bottle().agent_argv([]))
|
||||
self.assertEqual(
|
||||
[
|
||||
"smolvm", "machine", "exec", "--name",
|
||||
@@ -69,7 +69,7 @@ class TestClaudeArgvWrapped(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_appends_passed_args_after_claude(self):
|
||||
argv = _unwrap(_bottle().claude_argv(
|
||||
argv = _unwrap(_bottle().agent_argv(
|
||||
["--dangerously-skip-permissions", "--continue"],
|
||||
))
|
||||
self.assertEqual(
|
||||
@@ -79,7 +79,7 @@ class TestClaudeArgvWrapped(unittest.TestCase):
|
||||
|
||||
def test_appends_prompt_file_flag_when_set(self):
|
||||
argv = _unwrap(
|
||||
_bottle("/home/node/.bot-bottle-prompt.txt").claude_argv(
|
||||
_bottle("/home/node/.bot-bottle-prompt.txt").agent_argv(
|
||||
["--dangerously-skip-permissions"],
|
||||
)
|
||||
)
|
||||
@@ -94,11 +94,11 @@ class TestClaudeArgvWrapped(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_no_prompt_flag_when_none(self):
|
||||
argv = _bottle(None).claude_argv(["--continue"])
|
||||
argv = _bottle(None).agent_argv(["--continue"])
|
||||
self.assertNotIn("--append-system-prompt-file", argv)
|
||||
|
||||
def test_empty_prompt_string_is_treated_as_no_prompt(self):
|
||||
argv = _bottle("").claude_argv(["--continue"])
|
||||
argv = _bottle("").agent_argv(["--continue"])
|
||||
self.assertNotIn("--append-system-prompt-file", argv)
|
||||
|
||||
def test_guest_env_forwarded_as_e_flags(self):
|
||||
@@ -106,7 +106,7 @@ class TestClaudeArgvWrapped(unittest.TestCase):
|
||||
None,
|
||||
HTTPS_PROXY="http://127.0.0.1:1234",
|
||||
NO_PROXY="localhost",
|
||||
).claude_argv([]))
|
||||
).agent_argv([]))
|
||||
self.assertIn("-e", argv)
|
||||
self.assertIn("HTTPS_PROXY=http://127.0.0.1:1234", argv)
|
||||
self.assertIn("NO_PROXY=localhost", argv)
|
||||
@@ -116,11 +116,11 @@ class TestClaudeArgvWrapped(unittest.TestCase):
|
||||
# the `claude` token to split exec-framing from the claude
|
||||
# tail. `runuser -u node --` must sit on the prefix side so
|
||||
# the shell wrap inherits the UID switch.
|
||||
argv = _bottle().claude_argv([])
|
||||
claude_idx = argv.index("claude")
|
||||
argv = _bottle().agent_argv([])
|
||||
agent_idx = argv.index("claude")
|
||||
self.assertEqual(
|
||||
["runuser", "-u", "node", "--"],
|
||||
argv[claude_idx - 4:claude_idx],
|
||||
argv[agent_idx - 4:agent_idx],
|
||||
)
|
||||
|
||||
|
||||
@@ -129,12 +129,12 @@ class TestClaudeArgvNoTTY(unittest.TestCase):
|
||||
PTY whose SIGWINCH we'd need to bridge."""
|
||||
|
||||
def test_no_wrapper_when_tty_false(self):
|
||||
argv = _bottle().claude_argv([], tty=False)
|
||||
argv = _bottle().agent_argv([], tty=False)
|
||||
self.assertEqual("smolvm", argv[0])
|
||||
self.assertFalse(any("pty_resize" in a for a in argv))
|
||||
|
||||
def test_tty_false_drops_it_flags(self):
|
||||
argv = _bottle().claude_argv([], tty=False)
|
||||
argv = _bottle().agent_argv([], tty=False)
|
||||
self.assertNotIn("-i", argv)
|
||||
self.assertNotIn("-t", argv)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user