Skip to content

Commit d583161

Browse files
authored
Fuck off
Refactor: Remove Local Acknowledge Issue Logic from Dashboard
2 parents 53792c6 + df52773 commit d583161

3 files changed

Lines changed: 20 additions & 42 deletions

File tree

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/pyob/dashboard_html.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,6 @@
140140
141141
// The acknowledgeIssue function is now defined globally below updateStats.
142142
// No local definition needed here.
143-
method: 'POST',
144-
headers: { 'Content-Type': 'application/json' },
145-
body: JSON.stringify({ status: 'acknowledged' })
146-
});
147-
if (response.ok) {
148-
await updateStats(); // Refresh dashboard to show updated status
149-
} else {
150-
console.error(`Failed to acknowledge issue ${issueId}:`, await response.text());
151-
alert('Error acknowledging issue.');
152-
}
153-
} catch (e) {
154-
console.error(`Failed to acknowledge issue ${issueId}:`, e);
155-
alert('Network error acknowledging issue.');
156-
}
157-
}
158143
159144
if (Array.isArray(data.analysis) && data.analysis.length > 0) {
160145
data.analysis.forEach(issue => {

src/pyob/entrance.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,29 @@ def run_master_loop(self):
353353
time.sleep(120)
354354

355355
def _extract_path_from_llm_response(self, text: str) -> str:
356-
"""Extracts a clean relative file path from a LLM response."""
357-
cleaned_text = re.sub(r"[`\"*]", "", text).strip()
356+
"""Extracts a clean relative file path from a conversational LLM response."""
357+
cleaned_text = str(re.sub(r"[`\"*]", "", text).strip())
358+
359+
matches = re.findall(r"[\w\.\-/]+\.(?:py|js|ts|html|css|json|md)", cleaned_text)
360+
361+
base_dir = str(getattr(self, "target_dir", "."))
362+
363+
for match in matches:
364+
clean_match = str(match).rstrip(".,;:'\")")
365+
if os.path.exists(os.path.join(base_dir, clean_match)):
366+
return str(clean_match)
367+
358368
if " " in cleaned_text:
359369
parts = cleaned_text.split()
360370
for part in parts:
361-
if "/" in part or part.endswith((".py", ".js", ".ts", ".html", ".css")):
362-
return part
363-
return parts[0]
364-
return cleaned_text
371+
clean_part = str(part).rstrip(".,;:'\")")
372+
if "/" in clean_part or clean_part.endswith(
373+
(".py", ".js", ".ts", ".html", ".css")
374+
):
375+
return str(clean_part)
376+
return str(parts[0].rstrip(".,;:'\")"))
377+
378+
return str(cleaned_text)
365379

366380
def _run_git_command(self, cmd: list[str]) -> bool:
367381
"""Helper to run git commands safely."""

0 commit comments

Comments
 (0)