Skip to content

fix: pass effective task path to deploy_skills so already-injected ch…#230

Open
EYH0602 wants to merge 3 commits intobenchflow-ai:mainfrom
EYH0602:fix/skills-double-deploy
Open

fix: pass effective task path to deploy_skills so already-injected ch…#230
EYH0602 wants to merge 3 commits intobenchflow-ai:mainfrom
EYH0602:fix/skills-double-deploy

Conversation

@EYH0602
Copy link
Copy Markdown
Contributor

@EYH0602 EYH0602 commented May 2, 2026

Summary

  • Fixes deploy_skills double-deploys when skills_dir is set, causing 'cannot overwrite directory "/skills/..."' on container cp #229deploy_skills was receiving cfg.task_path (original) instead of the post-injection temp copy, so its already_injected check always read False and the runtime env.upload_dir(..., "/skills") fired on top of skills already baked into the image. With a colliding symlink in the source, the cp failed with cannot overwrite directory "/skills/<entry>" with non-directory "/skills".
  • Stash the post-injection path on self._effective_task_path in Trial._setup and pass it to both deploy_skills call sites (oracle + agent).
  • Add a regression test in tests/test_agent_setup.py that writes a Dockerfile carrying the injected COPY _deps/skills /skills/ line and asserts env.upload_dir is not called.

Test plan

  • pytest tests/test_agent_setup.py tests/test_trial_install_agent_timeout.py tests/test_env_setup.py tests/test_verify.py — passes (81 tests).
  • ruff check clean.
  • ty check src/ clean.
  • Re-run reporter's InfiniteBench run with skills_dir: auto to confirm 16/16 trials succeed end-to-end.

…eck works

When skills_dir is set, `_inject_skills_into_dockerfile` writes the
`COPY _deps/skills /skills/` line into a temp copy of the task. The
later `deploy_skills` call was given `cfg.task_path` (the original,
unmodified task dir), so its `already_injected` check always read
False and runtime `env.upload_dir(..., "/skills")` fired on top of
the already-baked layer — failing with `cannot overwrite directory
"/skills/<entry>" with non-directory "/skills"` when the source
contained a colliding symlink.

Stash the post-injection path on `self._effective_task_path` and pass
it to both `deploy_skills` call sites. Add a regression test that
guards the detection.

Fixes #11
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@EYH0602 EYH0602 closed this May 2, 2026
@EYH0602 EYH0602 reopened this May 2, 2026
When deploy_skills detects the Dockerfile already bakes in
`COPY _deps/skills /skills/`, the runtime upload is skipped but
effective_skills was left as task.config.environment.skills_dir
(often None), causing the subsequent linking step to silently
skip distribution to agent-specific paths like
/home/agent/.agents/skills. Sandbox users relied on that runtime
linking since Dockerfile injection only links under /root/.

Tighten the regression test to assert env.exec was called with the
expected `ln -sfn` command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy_skills double-deploys when skills_dir is set, causing 'cannot overwrite directory "/skills/..."' on container cp

1 participant