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
+19
View File
@@ -41,6 +41,15 @@ def _pi_bottle(prompt_path: str | None = None) -> DockerBottle:
)
def _workspace_bottle() -> DockerBottle:
return DockerBottle(
container="bot-bottle-dev-abc",
teardown=lambda: None,
prompt_path_in_container=None,
agent_workdir="/home/node/workspace",
)
class TestClaudeArgv(unittest.TestCase):
def test_minimal_argv_no_prompt(self):
argv = _bottle().agent_argv([])
@@ -89,6 +98,16 @@ class TestClaudeArgv(unittest.TestCase):
argv,
)
def test_workspace_workdir_is_used_when_set(self):
argv = _workspace_bottle().agent_argv([])
self.assertEqual(
[
"docker", "exec", "-it", "-w", "/home/node/workspace",
"bot-bottle-dev-abc", "claude",
],
argv,
)
def test_caller_argv_not_mutated(self):
# `agent_argv` builds `full_argv` from a copy, so a
# caller passing a long-lived list (e.g., the dashboard's