mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-07 08:27:12 +00:00
parent
f5dedd4a56
commit
0b6b0a56b1
5 changed files with 118 additions and 11 deletions
|
|
@ -1,33 +1,61 @@
|
|||
{
|
||||
"timestamp": "2026-03-16T05:36:22.009134Z",
|
||||
"current_node": "setup",
|
||||
"timestamp": "2026-03-16T05:39:23.800410Z",
|
||||
"current_node": "solve",
|
||||
"completed_nodes": [
|
||||
"start",
|
||||
"setup"
|
||||
"setup",
|
||||
"solve"
|
||||
],
|
||||
"node_retries": {
|
||||
"solve": 1,
|
||||
"start": 1,
|
||||
"setup": 1
|
||||
},
|
||||
"context_values": {
|
||||
"last_response": "Perfect! Let me review the complete flow of the fix:\n\n1. A setup command like `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .` is executed\n2. If",
|
||||
"response.solve": "Perfect! Let me review the complete flow of the fix:\n\n1. A setup command like `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .` is executed\n2. If it fails with an exit code != 0 AND the stderr contains \"not an empty directory\" or \"already exists and is not an empty\" AND the command contains \"git clone\"\n3. We call `construct_git_clone_fallback()` to create a modified command\n4. The modified command `git init && git remote add origin https://github.com/django/django.git && git fetch origin && git checkout 466920f && python -m pip install -e .` is executed\n5. If this succeeds, the setup continues; if not, we report the error\n\nThis is exactly what we need! The fix handles the \"directory not empty\" error gracefully by using an alternative git initialization approach.\n\nNow let me write a summary of the changes made:\n\n## Summary of Changes\n\nI've implemented a fix for the issue where setup commands that include `git clone` into the current directory (`.`) fail when the directory already contains files (e.g., workflow configuration files, initialization files, etc.).\n\n### Changes Made:\n\n1. **Added `construct_git_clone_fallback()` function** in `/home/daytona/workspace/lib/crates/fabro-workflows/src/cli/run.rs`:\n - Parses git clone commands to extract the repository URL and destination directory\n - Converts `git clone <url> .` into `git init && git remote add origin <url> && git fetch origin`\n - Preserves any additional commands in compound commands (e.g., `&& git checkout <commit>`)\n - Only applies the fallback when cloning into the current directory\n\n2. **Added `quote_shell_arg()` helper function** to properly quote shell arguments using the existing `shell_quote` utility\n\n3. **Enhanced setup command execution** in `run_command()`:\n - When a setup command fails with the \"directory not empty\" error from git clone\n - Automatically retries using the fallback approach instead of reporting failure\n - Logs the retry attempt for debugging\n\n4. **Added comprehensive tests** to verify:\n - Simple git clone commands are converted correctly\n - Compound commands with additional git/python operations are preserved\n - Commands cloning to non-current directories are not affected\n - Non-git-clone commands are not affected\n\n### How it works:\n\nWhen a workflow setup command tries to clone a repository into a non-empty directory:\n1. **Original command fails**: `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .`\n - Error: \"fatal: destination path '.' already exists and is not an empty directory.\"\n\n2. **Fallback command executes**: `git init && git remote add origin https://github.com/django/django.git && git fetch origin && git checkout 466920f && python -m pip install -e .`\n - Initializes a new git repository in the current directory\n - Adds the remote origin\n - Fetches all branches and commits\n - Continues with the original checkout and setup commands\n\nThis approach matches the pattern already used in the SSH and exe.dev sandboxes, ensuring consistency across all sandbox providers.",
|
||||
"command.output": "fatal: destination path '.' already exists and is not an empty directory.\n",
|
||||
"internal.node_visit_count": 1,
|
||||
"internal.fidelity": "compact",
|
||||
"last_stage": "solve",
|
||||
"internal.retry_count.start": 1,
|
||||
"graph.rankdir": "LR",
|
||||
"failure_signature": "setup|deterministic|script failed with exit code: <n> ## stdout fatal: destination path '.' already exists and is not an empty directory.",
|
||||
"failure_signature": "",
|
||||
"command.stderr": "",
|
||||
"internal.retry_count.setup": 1,
|
||||
"current_node": "setup",
|
||||
"current_node": "solve",
|
||||
"internal.run_id": "01KKTJA7N831P0AH7DPCMNXPR1",
|
||||
"current.preamble": "Goal: \n",
|
||||
"outcome": "fail",
|
||||
"current.preamble": "Goal: \n\n## Completed stages\n- **setup**: fail\n - Script: `git clone https://github.com/django/django.git . && git checkout 466920f6d726eee90d5566e0a9948e92b33a122e && python -m pip install -e .`\n - Stdout:\n ```\n fatal: destination path '.' already exists and is not an empty directory.\n ```\n - Stderr: (empty)\n\n## Context\n- failure_class: deterministic\n- failure_signature: setup|deterministic|script failed with exit code: <n> ## stdout fatal: destination path '.' already exists and is not an empty directory.\n",
|
||||
"outcome": "success",
|
||||
"thread.setup.current_node": "solve",
|
||||
"thread.start.current_node": "setup",
|
||||
"failure_class": "deterministic",
|
||||
"internal.thread_id": "start"
|
||||
"internal.retry_count.solve": 1,
|
||||
"failure_class": "",
|
||||
"internal.thread_id": "setup"
|
||||
},
|
||||
"logs": [],
|
||||
"node_outcomes": {
|
||||
"solve": {
|
||||
"status": "success",
|
||||
"context_updates": {
|
||||
"last_stage": "solve",
|
||||
"last_response": "Perfect! Let me review the complete flow of the fix:\n\n1. A setup command like `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .` is executed\n2. If",
|
||||
"response.solve": "Perfect! Let me review the complete flow of the fix:\n\n1. A setup command like `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .` is executed\n2. If it fails with an exit code != 0 AND the stderr contains \"not an empty directory\" or \"already exists and is not an empty\" AND the command contains \"git clone\"\n3. We call `construct_git_clone_fallback()` to create a modified command\n4. The modified command `git init && git remote add origin https://github.com/django/django.git && git fetch origin && git checkout 466920f && python -m pip install -e .` is executed\n5. If this succeeds, the setup continues; if not, we report the error\n\nThis is exactly what we need! The fix handles the \"directory not empty\" error gracefully by using an alternative git initialization approach.\n\nNow let me write a summary of the changes made:\n\n## Summary of Changes\n\nI've implemented a fix for the issue where setup commands that include `git clone` into the current directory (`.`) fail when the directory already contains files (e.g., workflow configuration files, initialization files, etc.).\n\n### Changes Made:\n\n1. **Added `construct_git_clone_fallback()` function** in `/home/daytona/workspace/lib/crates/fabro-workflows/src/cli/run.rs`:\n - Parses git clone commands to extract the repository URL and destination directory\n - Converts `git clone <url> .` into `git init && git remote add origin <url> && git fetch origin`\n - Preserves any additional commands in compound commands (e.g., `&& git checkout <commit>`)\n - Only applies the fallback when cloning into the current directory\n\n2. **Added `quote_shell_arg()` helper function** to properly quote shell arguments using the existing `shell_quote` utility\n\n3. **Enhanced setup command execution** in `run_command()`:\n - When a setup command fails with the \"directory not empty\" error from git clone\n - Automatically retries using the fallback approach instead of reporting failure\n - Logs the retry attempt for debugging\n\n4. **Added comprehensive tests** to verify:\n - Simple git clone commands are converted correctly\n - Compound commands with additional git/python operations are preserved\n - Commands cloning to non-current directories are not affected\n - Non-git-clone commands are not affected\n\n### How it works:\n\nWhen a workflow setup command tries to clone a repository into a non-empty directory:\n1. **Original command fails**: `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .`\n - Error: \"fatal: destination path '.' already exists and is not an empty directory.\"\n\n2. **Fallback command executes**: `git init && git remote add origin https://github.com/django/django.git && git fetch origin && git checkout 466920f && python -m pip install -e .`\n - Initializes a new git repository in the current directory\n - Adds the remote origin\n - Fetches all branches and commits\n - Continues with the original checkout and setup commands\n\nThis approach matches the pattern already used in the SSH and exe.dev sandboxes, ensuring consistency across all sandbox providers."
|
||||
},
|
||||
"notes": "Stage completed: solve",
|
||||
"usage": {
|
||||
"model": "claude-haiku-4-5",
|
||||
"input_tokens": 60092,
|
||||
"output_tokens": 18222,
|
||||
"cache_read_tokens": 2711334,
|
||||
"cache_write_tokens": 85167,
|
||||
"cost": 0.1209616
|
||||
},
|
||||
"files_touched": [
|
||||
"/home/daytona/workspace/lib/crates/fabro-workflows/src/cli/run.rs"
|
||||
],
|
||||
"duration_ms": 179679
|
||||
},
|
||||
"setup": {
|
||||
"status": "fail",
|
||||
"context_updates": {
|
||||
|
|
@ -45,12 +73,13 @@
|
|||
"duration_ms": 0
|
||||
}
|
||||
},
|
||||
"next_node_id": "solve",
|
||||
"next_node_id": "extract_patch",
|
||||
"loop_failure_signatures": {
|
||||
"setup|deterministic|script failed with exit code: <n> ## stdout fatal: destination path '.' already exists and is not an empty directory.": 1
|
||||
},
|
||||
"node_visits": {
|
||||
"start": 1,
|
||||
"setup": 1
|
||||
"setup": 1,
|
||||
"solve": 1
|
||||
}
|
||||
}
|
||||
17
nodes/solve/prompt.md
Normal file
17
nodes/solve/prompt.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Goal:
|
||||
|
||||
## Completed stages
|
||||
- **setup**: fail
|
||||
- Script: `git clone https://github.com/django/django.git . && git checkout 466920f6d726eee90d5566e0a9948e92b33a122e && python -m pip install -e .`
|
||||
- Stdout:
|
||||
```
|
||||
fatal: destination path '.' already exists and is not an empty directory.
|
||||
```
|
||||
- Stderr: (empty)
|
||||
|
||||
## Context
|
||||
- failure_class: deterministic
|
||||
- failure_signature: setup|deterministic|script failed with exit code: <n> ## stdout fatal: destination path '.' already exists and is not an empty directory.
|
||||
|
||||
|
||||
Fix this GitHub issue in the repository. Make the minimal code change needed.
|
||||
5
nodes/solve/provider_used.json
Normal file
5
nodes/solve/provider_used.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"mode": "agent",
|
||||
"provider": "anthropic",
|
||||
"model": "claude-haiku-4-5"
|
||||
}
|
||||
50
nodes/solve/response.md
Normal file
50
nodes/solve/response.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
Perfect! Let me review the complete flow of the fix:
|
||||
|
||||
1. A setup command like `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .` is executed
|
||||
2. If it fails with an exit code != 0 AND the stderr contains "not an empty directory" or "already exists and is not an empty" AND the command contains "git clone"
|
||||
3. We call `construct_git_clone_fallback()` to create a modified command
|
||||
4. The modified command `git init && git remote add origin https://github.com/django/django.git && git fetch origin && git checkout 466920f && python -m pip install -e .` is executed
|
||||
5. If this succeeds, the setup continues; if not, we report the error
|
||||
|
||||
This is exactly what we need! The fix handles the "directory not empty" error gracefully by using an alternative git initialization approach.
|
||||
|
||||
Now let me write a summary of the changes made:
|
||||
|
||||
## Summary of Changes
|
||||
|
||||
I've implemented a fix for the issue where setup commands that include `git clone` into the current directory (`.`) fail when the directory already contains files (e.g., workflow configuration files, initialization files, etc.).
|
||||
|
||||
### Changes Made:
|
||||
|
||||
1. **Added `construct_git_clone_fallback()` function** in `/home/daytona/workspace/lib/crates/fabro-workflows/src/cli/run.rs`:
|
||||
- Parses git clone commands to extract the repository URL and destination directory
|
||||
- Converts `git clone <url> .` into `git init && git remote add origin <url> && git fetch origin`
|
||||
- Preserves any additional commands in compound commands (e.g., `&& git checkout <commit>`)
|
||||
- Only applies the fallback when cloning into the current directory
|
||||
|
||||
2. **Added `quote_shell_arg()` helper function** to properly quote shell arguments using the existing `shell_quote` utility
|
||||
|
||||
3. **Enhanced setup command execution** in `run_command()`:
|
||||
- When a setup command fails with the "directory not empty" error from git clone
|
||||
- Automatically retries using the fallback approach instead of reporting failure
|
||||
- Logs the retry attempt for debugging
|
||||
|
||||
4. **Added comprehensive tests** to verify:
|
||||
- Simple git clone commands are converted correctly
|
||||
- Compound commands with additional git/python operations are preserved
|
||||
- Commands cloning to non-current directories are not affected
|
||||
- Non-git-clone commands are not affected
|
||||
|
||||
### How it works:
|
||||
|
||||
When a workflow setup command tries to clone a repository into a non-empty directory:
|
||||
1. **Original command fails**: `git clone https://github.com/django/django.git . && git checkout 466920f && python -m pip install -e .`
|
||||
- Error: "fatal: destination path '.' already exists and is not an empty directory."
|
||||
|
||||
2. **Fallback command executes**: `git init && git remote add origin https://github.com/django/django.git && git fetch origin && git checkout 466920f && python -m pip install -e .`
|
||||
- Initializes a new git repository in the current directory
|
||||
- Adds the remote origin
|
||||
- Fetches all branches and commits
|
||||
- Continues with the original checkout and setup commands
|
||||
|
||||
This approach matches the pattern already used in the SSH and exe.dev sandboxes, ensuring consistency across all sandbox providers.
|
||||
6
nodes/solve/status.json
Normal file
6
nodes/solve/status.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"status": "success",
|
||||
"notes": "Stage completed: solve",
|
||||
"failure_reason": null,
|
||||
"timestamp": "2026-03-16T05:39:23.800245+00:00"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue