🐛 fix(sync): sync dataset symlinks to Daytona sandbox

The incremental sync used `find -type f` which misses symlinks (type l),
so dataset symlinks were never detected and synced to the sandbox.
Additionally, `tar.add()` without `dereference=True` would store broken
symlinks pointing to host-only paths.

- _list_local_changed_files: match both regular files and symlinks
- _tar_workspace_entries: dereference symlinks to pack actual content
- Unify dataset path to `datasets/` (plural) in prompts and SKILL.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
朱潮 2026-05-06 19:37:00 +08:00
parent 425f3c5bb4
commit 3c0fa498b5
3 changed files with 6 additions and 7 deletions

View File

@ -58,13 +58,13 @@ When executing scripts from SKILL.md files, you MUST convert relative paths to a
**3. Workspace Directory Structure**
- **`{agent_dir_path}/skills/`** - Skill packages with embedded scripts
- **`{agent_dir_path}/dataset/`** - Store file datasets and document data
- **`{agent_dir_path}/datasets/`** - Store file datasets and document data
- **`{agent_dir_path}/executable_code/`** - Place generated executable scripts here (not skill scripts)
- **`{agent_dir_path}/download/`** - Store downloaded files and content
**Path Examples:**
- Skill script: `{agent_dir_path}/skills/rag-retrieve/scripts/rag_retrieve.py`
- Dataset file: `{agent_dir_path}/dataset/document.txt`
- Dataset file: `{agent_dir_path}/datasets/document.txt`
- Generated script: `{agent_dir_path}/scripts/process_data.py`
- Downloaded file: `{agent_dir_path}/download/report.pdf`

View File

@ -14,7 +14,7 @@ Answer ALL questions about the datasets knowledge base using this skill's script
Scripts are in `{SKILL_DIR}/scripts/`.
Datasets are auto-discovered by scripts from `./dataset/` (catalog-agent) or `./datasets/` (gbase-agent-service) subdirectories — agent does NOT need to know or pass dataset IDs.
Datasets are auto-discovered by scripts from `./datasets/` subdirectories — agent does NOT need to know or pass dataset IDs.
## Scripts

View File

@ -43,8 +43,7 @@ def _list_local_changed_files(workspace_path: Path) -> tuple[bool, list[str]]:
str(workspace_path),
"-newer",
str(marker_local),
"-type",
"f",
"(", "-type", "f", "-o", "-type", "l", ")",
"-not",
"-name",
LOCAL_MARKER_NAME,
@ -65,9 +64,9 @@ def _tar_workspace_entries(workspace_path: Path, entries: list[Path]) -> bytes:
with tarfile.open(fileobj=buf, mode="w:gz") as tar:
for entry in entries:
if entry.is_absolute():
tar.add(str(entry), arcname=entry.relative_to(workspace_path).as_posix())
tar.add(str(entry), arcname=entry.relative_to(workspace_path).as_posix(), dereference=True)
else:
tar.add(str(workspace_path / entry), arcname=entry.as_posix())
tar.add(str(workspace_path / entry), arcname=entry.as_posix(), dereference=True)
buf.seek(0)
return buf.read()