refactor(docker): extract provision_skills to mirror the others
test / run tests/run_tests.py (pull_request) Successful in 15s
test / run tests/run_tests.py (pull_request) Successful in 15s
Four symmetric provision sub-methods now: provision_prompt, provision_skills, provision_ssh, provision_git. Each self-gates with an early return; provision is pure orchestration.
This commit is contained in:
@@ -271,9 +271,7 @@ class DockerBottleBackend(BottleBackend):
|
|||||||
container = target
|
container = target
|
||||||
|
|
||||||
prompt_path = self.provision_prompt(plan, container)
|
prompt_path = self.provision_prompt(plan, container)
|
||||||
agent = plan.spec.manifest.agents[plan.spec.agent_name]
|
self.provision_skills(plan, container)
|
||||||
if agent.skills:
|
|
||||||
skills_mod.skills_copy_into(container, list(agent.skills))
|
|
||||||
self.provision_ssh(plan, container)
|
self.provision_ssh(plan, container)
|
||||||
self.provision_git(plan, container)
|
self.provision_git(plan, container)
|
||||||
return prompt_path
|
return prompt_path
|
||||||
@@ -307,6 +305,15 @@ class DockerBottleBackend(BottleBackend):
|
|||||||
agent = plan.spec.manifest.agents[plan.spec.agent_name]
|
agent = plan.spec.manifest.agents[plan.spec.agent_name]
|
||||||
return in_container_prompt_path if agent.prompt else None
|
return in_container_prompt_path if agent.prompt else None
|
||||||
|
|
||||||
|
def provision_skills(self, plan: DockerBottlePlan, container: str) -> None:
|
||||||
|
"""Copy each of the agent's named skills from the host's
|
||||||
|
~/.claude/skills/<name>/ into the container's equivalent path.
|
||||||
|
No-op when the agent has no skills."""
|
||||||
|
agent = plan.spec.manifest.agents[plan.spec.agent_name]
|
||||||
|
if not agent.skills:
|
||||||
|
return
|
||||||
|
skills_mod.skills_copy_into(container, list(agent.skills))
|
||||||
|
|
||||||
def provision_ssh(self, plan: DockerBottlePlan, container: str) -> None:
|
def provision_ssh(self, plan: DockerBottlePlan, container: str) -> None:
|
||||||
"""If the bottle has SSH entries, set up the in-container
|
"""If the bottle has SSH entries, set up the in-container
|
||||||
ssh-agent and config so node can authenticate without ever
|
ssh-agent and config so node can authenticate without ever
|
||||||
|
|||||||
Reference in New Issue
Block a user