refactor: move guest_home onto AgentProvisionPlan as source of truth
guest_home is now a field on AgentProvisionPlan (set by each provider's provision_plan() method). BottlePlan.guest_home becomes a read-only property delegating to agent_provision.guest_home so existing callers (provision_git, provision_skills, provision_prompt) are unchanged. Both resolve_plan.py files drop guest_home from the plan constructor call; the local variable still exists as an intermediary for the workspace_plan call that precedes agent_provision_plan.
This commit is contained in:
@@ -76,7 +76,6 @@ def _plan(
|
||||
current_config_dir=Path("/tmp/current-config"),
|
||||
)
|
||||
return DockerBottlePlan(
|
||||
guest_home="/home/node",
|
||||
spec=spec,
|
||||
stage_dir=Path("/tmp/stage"),
|
||||
slug="demo-abc12",
|
||||
@@ -106,7 +105,7 @@ def _plan(
|
||||
use_runsc=False,
|
||||
agent_provision=agent_provision or AgentProvisionPlan(
|
||||
template="claude", command="claude", prompt_mode="append_file",
|
||||
image="", dockerfile="", guest_env={},
|
||||
image="", dockerfile="", guest_home="/home/node", guest_env={},
|
||||
),
|
||||
workspace_plan=workspace_plan(spec, guest_home="/home/node"),
|
||||
)
|
||||
@@ -211,7 +210,7 @@ class TestClaudeProvision(unittest.TestCase):
|
||||
def test_copies_files_and_chowns(self):
|
||||
provision = AgentProvisionPlan(
|
||||
template="claude", command="claude", prompt_mode="append_file",
|
||||
image="", dockerfile="", guest_env={},
|
||||
image="", dockerfile="", guest_home="/home/node", guest_env={},
|
||||
files=(AgentProvisionFile(
|
||||
Path("/tmp/claude.json"), "/home/node/.claude.json",
|
||||
),),
|
||||
@@ -234,7 +233,7 @@ class TestClaudeProvision(unittest.TestCase):
|
||||
def test_dies_when_file_chown_fails(self):
|
||||
provision = AgentProvisionPlan(
|
||||
template="claude", command="claude", prompt_mode="append_file",
|
||||
image="", dockerfile="", guest_env={},
|
||||
image="", dockerfile="", guest_home="/home/node", guest_env={},
|
||||
files=(AgentProvisionFile(
|
||||
Path("/tmp/claude.json"), "/home/node/.claude.json",
|
||||
),),
|
||||
@@ -250,7 +249,7 @@ class TestClaudeProvision(unittest.TestCase):
|
||||
def test_runs_verify_commands(self):
|
||||
provision = AgentProvisionPlan(
|
||||
template="claude", command="claude", prompt_mode="append_file",
|
||||
image="", dockerfile="", guest_env={},
|
||||
image="", dockerfile="", guest_home="/home/node", guest_env={},
|
||||
verify=(AgentProvisionCommand(
|
||||
("/usr/bin/true",), "verify failed",
|
||||
),),
|
||||
|
||||
Reference in New Issue
Block a user