agentscope-ai / agentscope-ai/agentscope

[Bug]: three tests fail on Windows dev machines without Git usr/bin on PATH (POSIX shell tool dependency)

Aberta
#2,608 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
31.6k
Forks
3.5k
Merge médio
1d 16h
PRs com merge (30d)
103

Descrição

- [x] I have searched the existing [issues](https://github.com/agentscope-ai/agentscope/issues) and [discussions](https://github.com/agentscope-ai/agentscope/discussions), and this is not a duplicate.
- [x] This is a bug, not a usage question. (For questions, please use [Discussions](https://github.com/agentscope-ai/agentscope/discussions/new?category=general) instead.)

### Background / Description

Three tests fail on a stock Windows dev machine where Git''s `usr/bin` (POSIX coreutils: `mv`, `mkdir`, `test`, `rm`) is not on `PATH`:

```
FAILED tests/workspace_skill_archive_test.py::AddSkillArchiveSandboxedTest::test_directory_name_is_suffixed_when_taken
FAILED tests/workspace_skill_archive_test.py::AddSkillArchiveSandboxedTest::test_flat_archive_is_accepted
FAILED tests/workspace_daytona_test.py::TestDaytonaWorkspaceBuiltinToolsMock::test_offload_context_tool_result_and_reset
```

Both clusters depend on POSIX shell tools being executable on the *host*:

1. `AddSkillArchiveSandboxedTest` deliberately exercises the base `WorkspaceBase.add_skill_archive` implementation over a `LocalBackend`. That base implementation is written for POSIX sandboxes and shells out to `mkdir -p` / `mv` (`src/agentscope/workspace/_base.py`), which do not exist on stock Windows — `LocalBackend.exec_shell` spawns programs directly without a shell. (`LocalWorkspace.add_skill_archive` itself is overridden and its own test class passes; only the base-implementation-over-local-backend tests fail.)

2. `test_offload_context_tool_result_and_reset` runs through the "host-backed Daytona fake" (`_MappedProcess`), which re-executes sandbox shell commands (`test -e`, `mkdir -p`, `rm -rf`) on the host via `asyncio.create_subprocess_shell` — i.e. `cmd.exe` on Windows, where these commands do not exist.

These pass on `windows-latest` CI because the runner image puts Git''s `usr/bin` on `PATH`, so `mv.exe`/`test.exe`/etc. resolve. On a dev machine without that on `PATH` (e.g. Git installed elsewhere, or only `Git/cmd` on `PATH`), they fail. The repo already acknowledges this class of problem: `test_add_skill_rejects_duplicate_skill` in the same Daytona test file carries `@unittest.skipIf(os.name == "nt", "host-backed Daytona fake relies on POSIX sandbox commands")`.

### Error Messages

```
RuntimeError: Failed to install skill ''pack'': [WinError 2] The system cannot find the file specified
File "src/agentscope/workspace/_base.py", line 1399, in add_skill_archive
```

```
tests/workspace_daytona_test.py:1254: in test_offload_context_tool_result_and_reset
self.assertTrue(await self.workspace._backend.file_exists("/home/daytona/sessions"))
E AssertionError: False is not true
# (`test -e` runs on the host via cmd.exe and fails, so file_exists is always False)
```

### Steps to Reproduce

1. On Windows, ensure Git''s `usr/bin` is not on `PATH` (`where mv` finds nothing).
2. `uv venv --python 3.11 && uv pip install -e ".[dev]"`
3. `python -m pytest tests/workspace_skill_archive_test.py tests/workspace_daytona_test.py -q`
4. Observe the three failures above.

### Environment

- AgentScope Version: 2.0.8 (main @ b82253b)
- Python Version: 3.11.15 / 3.13.9 (both affected)
- OS: Windows 11

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Run the two named test files on Windows without Git's usr/bin on PATH, then inspect src/agentscope/workspace/_base.py around add_skill_archive and the host-backed Daytona fake used by tests/workspace_daytona_test.py. Confirm the three failures are caused by host POSIX commands, and consider the work complete when both test files pass without that PATH dependency while the existing sandbox behavior remains covered.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python, shell
Domínio
operating-systems, testing-qa
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Ativa
Clareza
Claramente especificada
Facilidade para iniciantes
68/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.