fix: copy microagents file into runtime image (#10245)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: mamoodi <mamoodiha@gmail.com>
This commit is contained in:
Xingyao Wang 2025-08-12 08:42:42 -04:00 committed by GitHub
parent 1d0d88d491
commit 0699a0ce7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View File

@ -280,6 +280,11 @@ def prep_build_folder(
),
)
# Copy the 'microagents' directory (Microagents)
shutil.copytree(
Path(project_root, 'microagents'), Path(build_folder, 'code', 'microagents')
)
# Copy pyproject.toml and poetry.lock files
for file in ['pyproject.toml', 'poetry.lock']:
src = Path(openhands_source_dir, file)

View File

@ -239,7 +239,8 @@ COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
# ================================================================
RUN if [ -d /openhands/code/openhands ]; then rm -rf /openhands/code/openhands; fi
COPY ./code/pyproject.toml ./code/poetry.lock /openhands/code/
RUN if [ -d /openhands/code/microagents ]; then rm -rf /openhands/code/microagents; fi
COPY ./code/microagents /openhands/code/microagents
COPY ./code/openhands /openhands/code/openhands
RUN chmod a+rwx /openhands/code/openhands/__init__.py

View File

@ -89,8 +89,8 @@ def test_prep_build_folder(temp_dir):
extra_deps=None,
)
# make sure that the code was copied
shutil_mock.copytree.assert_called_once()
# make sure that the code (openhands/) and microagents folder were copied
assert shutil_mock.copytree.call_count == 2
assert shutil_mock.copy2.call_count == 2
# Now check dockerfile is in the folder