fix(pi): keep interactive sessions open
lint / lint (push) Successful in 1m29s
test / unit (pull_request) Successful in 30s
test / integration (pull_request) Successful in 17s

This commit is contained in:
2026-06-09 06:00:40 -04:00
parent c8b5ba3812
commit 598a20a3f0
7 changed files with 55 additions and 10 deletions
+19
View File
@@ -28,6 +28,15 @@ def _bottle(prompt_path: str | None = None, **env: str) -> SmolmachinesBottle:
)
def _pi_bottle(prompt_path: str | None = None) -> SmolmachinesBottle:
return SmolmachinesBottle(
"bot-bottle-dev-abc",
prompt_path=prompt_path,
agent_command="pi",
agent_prompt_mode="append_system_prompt",
)
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
@@ -122,6 +131,16 @@ class TestClaudeArgvWrapped(unittest.TestCase):
argv[agent_idx - 7:agent_idx - 2],
)
def test_pi_provider_appends_system_prompt_without_print_mode(self):
argv = _unwrap(
_pi_bottle("/home/node/.bot-bottle-prompt.txt").agent_argv([])
)
self.assertEqual(
["pi", "--append-system-prompt", "/home/node/.bot-bottle-prompt.txt"],
argv[argv.index("pi"):],
)
self.assertNotIn("-p", argv)
class TestClaudeArgvNoTTY(unittest.TestCase):
"""`tty=False` paths skip the pty_resize wrapper — there's no