fix(ai_client): add patch_callback param to _send_gemini_cli signature

This commit is contained in:
2026-03-07 01:28:07 -05:00
parent fa29c53b1e
commit 0fae341d2f
4 changed files with 10 additions and 9 deletions

View File

@@ -26,7 +26,7 @@ This file tracks all major tracks for the project. Each track has its own detail
3. [x] **Track: Visual DAG & Interactive Ticket Editing**
*Link: [./tracks/visual_dag_ticket_editing_20260306/](./tracks/visual_dag_ticket_editing_20260306/)*
4. [~] **Track: Advanced Tier 4 QA Auto-Patching**
4. [x] **Track: Advanced Tier 4 QA Auto-Patching**
*Link: [./tracks/tier4_auto_patching_20260306/](./tracks/tier4_auto_patching_20260306/)*
5. [ ] **Track: Transitioning to Native Orchestrator**

View File

@@ -37,7 +37,7 @@ Focus: Generate unified diff on test failure
## Phase 2: Diff Viewer UI
Focus: Display side-by-side diff
- [ ] Task 2.1: Parse unified diff
- [x] Task 2.1: Parse unified diff
- WHERE: `src/gui_2.py` or new `src/diff_viewer.py`
- WHAT: Parse diff into hunks
- HOW:
@@ -55,7 +55,7 @@ Focus: Display side-by-side diff
return hunks
```
- [ ] Task 2.2: Render diff viewer
- [x] Task 2.2: Render diff viewer
- WHERE: `src/gui_2.py`
- WHAT: Color-coded diff display
- HOW:
@@ -73,7 +73,7 @@ Focus: Display side-by-side diff
## Phase 3: Patch Application
Focus: Apply patch with backup
- [ ] Task 3.1: Create backup before apply
- [x] Task 3.1: Create backup before apply
- WHERE: `src/gui_2.py` or `src/mcp_client.py`
- WHAT: Backup file to .backup
- HOW:
@@ -83,7 +83,7 @@ Focus: Apply patch with backup
shutil.copy(file_path, backup_path)
```
- [ ] Task 3.2: Apply patch
- [x] Task 3.2: Apply patch
- WHERE: `src/gui_2.py`
- WHAT: Use patch command or difflib
- HOW:
@@ -92,7 +92,7 @@ Focus: Apply patch with backup
result = subprocess.run(["patch", "-p1"], input=diff_text, capture_output=True, text=True)
```
- [ ] Task 3.3: Restore on failure
- [x] Task 3.3: Restore on failure
- WHERE: `src/gui_2.py`
- WHAT: Restore from backup if patch fails
- HOW: `shutil.copy(backup_path, file_path)`
@@ -100,7 +100,7 @@ Focus: Apply patch with backup
## Phase 4: Modal UI
Focus: Approval modal for patches
- [ ] Task 4.1: Create patch approval modal
- [x] Task 4.1: Create patch approval modal
- WHERE: `src/gui_2.py`
- WHAT: Modal with diff preview and Apply/Reject buttons
- HOW:

View File

@@ -8,5 +8,5 @@ active = "main"
[discussions.main]
git_commit = ""
last_updated = "2026-03-06T23:54:22"
last_updated = "2026-03-07T01:19:03"
history = []

View File

@@ -1019,7 +1019,8 @@ def _send_gemini_cli(md_content: str, user_message: str, base_dir: str,
discussion_history: str = "",
pre_tool_callback: Optional[Callable[[str, str, Optional[Callable[[str], str]]], Optional[str]]] = None,
qa_callback: Optional[Callable[[str], str]] = None,
stream_callback: Optional[Callable[[str], None]] = None) -> str:
stream_callback: Optional[Callable[[str], None]] = None,
patch_callback: Optional[Callable[[str, str], Optional[str]]] = None) -> str:
global _gemini_cli_adapter
sys.stderr.write(f"[DEBUG] _send_gemini_cli running in module {__name__}, adapter is {_gemini_cli_adapter}\n")
sys.stderr.flush()