fix(pi): prepare runtime state and agent workdir
lint / lint (push) Failing after 1m58s
test / unit (push) Successful in 41s
test / integration (push) Successful in 24s
Update Quality Badges / update-badges (push) Successful in 1m27s

This commit is contained in:
2026-06-10 00:02:28 -04:00
parent 86374ab293
commit 504144eb9c
13 changed files with 236 additions and 18 deletions
+21
View File
@@ -37,6 +37,14 @@ def _pi_bottle(prompt_path: str | None = None) -> SmolmachinesBottle:
)
def _workspace_bottle() -> SmolmachinesBottle:
return SmolmachinesBottle(
"bot-bottle-dev-abc",
prompt_path=None,
agent_workdir="/home/node/workspace",
)
def _unwrap(argv: list[str]) -> list[str]:
"""Strip the pty_resize wrapper from the front of a TTY-mode
argv, return the inner smolvm argv. Mirrors what the kernel
@@ -141,6 +149,19 @@ class TestClaudeArgvWrapped(unittest.TestCase):
)
self.assertNotIn("-p", argv)
def test_workspace_workdir_wraps_agent_command(self):
argv = _unwrap(_workspace_bottle().agent_argv([]))
agent_idx = argv.index("claude")
self.assertEqual(
[
"sh", "-lc",
"cd /home/node/workspace && exec \"$@\"",
"bot-bottle-agent",
"claude",
],
argv[agent_idx - 4:agent_idx + 1],
)
class TestClaudeArgvNoTTY(unittest.TestCase):
"""`tty=False` paths skip the pty_resize wrapper — there's no