bytedance / bytedance/agentkit-samples
Situla cannot persist configuration on Windows
- Dominant language
- Python
- Stars
- 454
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
### Description
Situla cannot persist its configuration on Windows. The atomic writer derives the temporary filename with `path.split("/")`, but native Windows paths contain backslashes. The resulting basename still contains the absolute path, so `writeFileSync` receives an invalid path nested under the configuration directory.
### Reproduction
Environment: Windows 11, Node.js v24.14.1, commit `0890278a6571e4190c1ab8cacd9becc147f74d9c`.
```powershell
cd python/01-tutorials/04-agentkit-tools/situla
npm ci --ignore-scripts
npm test
```
Two configuration tests fail with `ENOENT` while trying to open a path shaped like:
```text
...\situla\.C:\...\situla\config.json...tmp
```
The suite reports 79 passing and 2 failing tests. Both failures reach `writeJsonAtomic` through `writeSitulaConfiguration`.
### Expected behavior
The temporary file should be created next to `config.json`, renamed atomically, and the configuration tests should pass on Windows as they do on POSIX systems.
### Impact
The interactive configuration flow cannot save settings on a normal Windows checkout, so Windows users cannot complete the documented Situla setup.
### Suggested fix
Use the platform-aware `node:path` basename helper when constructing the temporary filename, and keep a regression assertion that the writer leaves only the final configuration file behind.
Contributor guide
Research direction
Start at writeJsonAtomic and its call from writeSitulaConfiguration, then run the reproduction commands and the configuration test suite on Windows. Done means the temporary file is created beside config.json, only the final configuration file remains, and all configuration tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100