🐛 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:
parent
425f3c5bb4
commit
3c0fa498b5
@ -58,13 +58,13 @@ When executing scripts from SKILL.md files, you MUST convert relative paths to a
|
|||||||
**3. Workspace Directory Structure**
|
**3. Workspace Directory Structure**
|
||||||
|
|
||||||
- **`{agent_dir_path}/skills/`** - Skill packages with embedded scripts
|
- **`{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}/executable_code/`** - Place generated executable scripts here (not skill scripts)
|
||||||
- **`{agent_dir_path}/download/`** - Store downloaded files and content
|
- **`{agent_dir_path}/download/`** - Store downloaded files and content
|
||||||
|
|
||||||
**Path Examples:**
|
**Path Examples:**
|
||||||
- Skill script: `{agent_dir_path}/skills/rag-retrieve/scripts/rag_retrieve.py`
|
- 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`
|
- Generated script: `{agent_dir_path}/scripts/process_data.py`
|
||||||
- Downloaded file: `{agent_dir_path}/download/report.pdf`
|
- Downloaded file: `{agent_dir_path}/download/report.pdf`
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ Answer ALL questions about the datasets knowledge base using this skill's script
|
|||||||
|
|
||||||
Scripts are in `{SKILL_DIR}/scripts/`.
|
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
|
## Scripts
|
||||||
|
|
||||||
|
|||||||
@ -43,8 +43,7 @@ def _list_local_changed_files(workspace_path: Path) -> tuple[bool, list[str]]:
|
|||||||
str(workspace_path),
|
str(workspace_path),
|
||||||
"-newer",
|
"-newer",
|
||||||
str(marker_local),
|
str(marker_local),
|
||||||
"-type",
|
"(", "-type", "f", "-o", "-type", "l", ")",
|
||||||
"f",
|
|
||||||
"-not",
|
"-not",
|
||||||
"-name",
|
"-name",
|
||||||
LOCAL_MARKER_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:
|
with tarfile.open(fileobj=buf, mode="w:gz") as tar:
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
if entry.is_absolute():
|
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:
|
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)
|
buf.seek(0)
|
||||||
return buf.read()
|
return buf.read()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user