Skip to content

Commit ad1f127

Browse files
committed
fix some lint
1 parent d13e24e commit ad1f127

File tree

7 files changed

+25
-79
lines changed

7 files changed

+25
-79
lines changed

README.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@
7373
</tr>
7474
</table>
7575

76-
<div align="center" style="margin: 30px 0;">
77-
<img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&size=14&duration=1500&pause=300&color=00D4FF&center=true&vCenter=true&repeat=true&width=800&height=50&lines=🖥️+Choose+Your+Preferred+Interface;⚡+Both+Powered+by+Multi-Agent+AI;🎯+Same+Power%2C+Different+Experience;🚀+Start+Development+Your+Way" alt="Interface Features" />
78-
</div>
76+
7977

8078

8179

@@ -121,9 +119,7 @@
121119
<p align="center">Effortlessly converts complex algorithms from research papers into <strong>high-quality</strong>, <strong>production-ready</strong> code, accelerating algorithm reproduction.</p>
122120
</div>
123121

124-
<div align="center" style="margin-top: 20px;">
125-
<img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&size=9&duration=1500&pause=300&color=FF6B6B&center=true&vCenter=true&repeat=true&width=220&height=20&lines=📄+Papers+→+⚡+Code;🧮+Algorithm+Magic" alt="Paper2Code Stats" />
126-
</div>
122+
127123

128124
</td>
129125
<td width="30%" align="center" style="vertical-align: top; padding: 20px;">
@@ -144,9 +140,7 @@
144140
<p align="center">Translates plain textual descriptions into <strong>fully functional</strong>, <strong>visually appealing</strong> front-end web code for rapid interface creation.</p>
145141
</div>
146142

147-
<div align="center" style="margin-top: 20px;">
148-
<img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&size=9&duration=1500&pause=300&color=4ECDC4&center=true&vCenter=true&repeat=true&width=220&height=20&lines=💬+Text+→+🎨+UI;🌟+Modern+Design" alt="Text2Web Stats" />
149-
</div>
143+
150144

151145
</td>
152146
<td width="30%" align="center" style="vertical-align: top; padding: 20px;">
@@ -167,9 +161,7 @@
167161
<p align="center">Generates <strong>efficient</strong>, <strong>scalable</strong>, and <strong>feature-rich</strong> back-end code from simple text inputs, streamlining server-side development.</p>
168162
</div>
169163

170-
<div align="center" style="margin-top: 20px;">
171-
<img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&size=9&duration=1500&pause=300&color=9B59B6&center=true&vCenter=true&repeat=true&width=220&height=20&lines=🔧+Scalable+Tech;🚀+Production+" alt="Text2Backend Stats" />
172-
</div>
164+
173165

174166
</td>
175167
</tr>
@@ -393,9 +385,7 @@ Implementation Generation • Testing • Documentation
393385

394386
## 🚀 Quick Start
395387

396-
<div align="center">
397-
<img src="https://readme-typing-svg.herokuapp.com?font=Orbitron&size=18&duration=2000&pause=800&color=00FF41&center=true&vCenter=true&multiline=true&width=600&height=60&lines=🚀+GET+STARTED+IN+3+STEPS;📦+Install+→+⚡+Launch+→+🎯+Generate" alt="Quick Start Animation" />
398-
</div>
388+
399389

400390
### 📦 **Step 1: Installation**
401391

@@ -480,15 +470,11 @@ python cli/main_cli.py
480470

481471
## 💡 Examples
482472

483-
<div align="center">
484-
<img src="https://readme-typing-svg.herokuapp.com?font=Orbitron&size=18&duration=2000&pause=800&color=FD79A8&center=true&vCenter=true&multiline=true&width=600&height=60&lines=💡+EXAMPLES;🎬+Live+Demonstrations;📝+Documentation" alt="Examples Header" />
485-
</div>
473+
486474

487475
### 🎬 **Live Demonstrations**
488476

489-
<div align="center">
490-
<img src="https://readme-typing-svg.herokuapp.com?font=Orbitron&size=16&duration=2000&pause=600&color=00D4FF&center=true&vCenter=true&multiline=true&width=600&height=50&lines=🚀+See+DeepCode+in+Action;⚡+Real-World+Use+Cases" alt="Video Demos Header" />
491-
</div>
477+
492478

493479
<table align="center">
494480
<tr>
@@ -543,9 +529,7 @@ python cli/main_cli.py
543529
</tr>
544530
</table>
545531

546-
<div align="center">
547-
<img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&size=14&duration=1500&pause=300&color=FD79A8&center=true&vCenter=true&repeat=true&width=800&height=50&lines=🎥+Click+to+Watch+Live+Demos;⚡+Real-time+Code+Generation;🎯+Production-Ready+Results;🧬+AI-Powered+Development" alt="Demo Features" />
548-
</div>
532+
549533

550534
### 🚀 **Coming Soon**
551535

@@ -590,8 +574,6 @@ We're continuously enhancing DeepCode with exciting new features:
590574

591575
<div align="center">
592576

593-
<img src="https://readme-typing-svg.herokuapp.com?font=Orbitron&size=20&duration=2000&pause=1000&color=00D4FF&center=true&vCenter=true&multiline=true&width=700&height=80&lines=🚀+Ready+to+Transform+Development%3F;🧬+Join+the+AI+Revolution" alt="Call to Action" />
594-
595577
<p>
596578
<a href="#-quick-start"><img src="https://img.shields.io/badge/🚀_Get_Started-00d4ff?style=for-the-badge&logo=rocket&logoColor=white" alt="Get Started"></a>
597579
<a href="https://github.com/HKUDS"><img src="https://img.shields.io/badge/🏛️_View_on_GitHub-00d4ff?style=for-the-badge&logo=github&logoColor=white" alt="View on GitHub"></a>
@@ -608,7 +590,7 @@ We're continuously enhancing DeepCode with exciting new features:
608590

609591
---
610592

611-
<img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&size=14&duration=1200&pause=300&color=00D4FF&center=true&vCenter=true&repeat=true&width=800&height=60&lines=🧬+Built+with+❤️+by+Data+Intelligence+Lab+%40+HKU;⚡+Revolutionizing+Software+Development;🚀+Through+Collaborative+AI+Intelligence;🌟+The+Future+of+Agentic+Programming" alt="Footer Animation" />
593+
612594

613595
<img src="https://visitor-badge.laobi.icu/badge?page_id=deepcode.readme&style=for-the-badge&color=00d4ff" alt="Visitors">
614596

deepcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
def check_dependencies():
1616
"""Check if necessary dependencies are installed"""
1717
import importlib.util
18-
18+
1919
print("🔍 Checking dependencies...")
2020

2121
missing_deps = []

tools/pdf_converter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ def check_dependencies(self) -> dict:
557557

558558
# Check ReportLab
559559
import importlib.util
560+
560561
if importlib.util.find_spec("reportlab") is not None:
561562
results["reportlab"] = True
562563

workflows/agents/code_implementation_agent.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -512,16 +512,15 @@ def _track_file_implementation(self, tool_call: Dict, result: Any):
512512
except Exception as e:
513513
self.logger.warning(f"Failed to track file implementation: {e}")
514514
# Even if tracking fails, try to count based on tool input (but check for duplicates) / 即使跟踪失败,也尝试根据工具输入计数(但检查重复)
515-
try:
516-
file_path = tool_call["input"].get("file_path")
517-
if file_path and file_path not in self.implemented_files_set:
518-
self.implemented_files_set.add(file_path)
519-
self.files_implemented_count += 1
520-
self.logger.info(
521-
f"File implementation counted (emergency fallback): count={self.files_implemented_count}, file={file_path}"
522-
)
523-
except:
524-
pass
515+
516+
file_path = tool_call["input"].get("file_path")
517+
if file_path and file_path not in self.implemented_files_set:
518+
self.implemented_files_set.add(file_path)
519+
self.files_implemented_count += 1
520+
self.logger.info(
521+
f"File implementation counted (emergency fallback): count={self.files_implemented_count}, file={file_path}"
522+
)
523+
525524

526525
def _track_dependency_analysis(self, tool_call: Dict, result: Any):
527526
"""

workflows/agents/memory_agent_concise.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ def _create_fallback_code_summary(
340340
Returns:
341341
Fallback summary
342342
"""
343-
current_round = self.current_round
344343
# Create formatted list of implemented files
345344
implemented_files_list = (
346345
"\n".join([f"- {file}" for file in self.implemented_files])
@@ -484,7 +483,7 @@ def record_tool_result(
484483
if tool_name == "write_file":
485484
self.last_write_file_detected = True
486485
self.should_clear_memory_next = True
487-
file_path = tool_input.get("file_path", "unknown")
486+
488487
# self.logger.info(f"🔄 WRITE_FILE DETECTED: {file_path} - Memory will be cleared in next round")
489488

490489
# Only record specific tools that provide essential information

workflows/agents/memory_agent_concise_index.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ def _create_fallback_code_summary(
340340
Returns:
341341
Fallback summary
342342
"""
343-
current_round = self.current_round
344343
# Create formatted list of implemented files
345344
implemented_files_list = (
346345
"\n".join([f"- {file}" for file in self.implemented_files])
@@ -484,7 +483,6 @@ def record_tool_result(
484483
if tool_name == "write_file":
485484
self.last_write_file_detected = True
486485
self.should_clear_memory_next = True
487-
file_path = tool_input.get("file_path", "unknown")
488486
# self.logger.info(f"🔄 WRITE_FILE DETECTED: {file_path} - Memory will be cleared in next round")
489487

490488
# Only record specific tools that provide essential information

workflows/code_implementation_workflow.py

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,6 @@ async def _pure_code_implementation_loop(
363363
start_time = time.time()
364364
max_time = 2400 # 40 minutes
365365

366-
# Sliding window configuration
367-
WINDOW_SIZE = 1
368-
SUMMARY_TRIGGER = 8
369366

370367
# Initialize specialized agents
371368
code_agent = CodeImplementationAgent(
@@ -390,10 +387,6 @@ async def _pure_code_implementation_loop(
390387
# Initialize memory agent with iteration 0
391388
memory_agent.start_new_round(iteration=0)
392389

393-
# Preserve initial plan (never compressed)
394-
initial_plan_message = messages[0] if messages else None
395-
396-
# Initial setup logging removed
397390

398391
while iteration < max_iterations:
399392
iteration += 1
@@ -442,14 +435,6 @@ async def _pure_code_implementation_loop(
442435
)
443436

444437
# NEW LOGIC: Check if write_file was called and trigger memory optimization immediately
445-
write_file_detected = any(
446-
tool_call["name"] == "write_file"
447-
for tool_call in response["tool_calls"]
448-
)
449-
# if write_file_detected:
450-
# self.logger.info(f"🔄 write_file detected - preparing memory optimization for next round")
451-
452-
# Tool results logged via standard logger only
453438

454439
# Determine guidance based on results
455440
has_error = self._check_tool_results_for_errors(tool_results)
@@ -467,9 +452,7 @@ async def _pure_code_implementation_loop(
467452
if memory_agent.should_trigger_memory_optimization(
468453
messages, code_agent.get_files_implemented_count()
469454
):
470-
# Capture messages before optimization
471-
messages_before_optimization = messages.copy()
472-
messages_before_count = len(messages)
455+
473456

474457
# Memory optimization triggered
475458

@@ -479,15 +462,9 @@ async def _pure_code_implementation_loop(
479462
messages = memory_agent.apply_memory_optimization(
480463
current_system_message, messages, files_implemented_count
481464
)
482-
messages_after_count = len(messages)
483-
484-
compression_ratio = (
485-
(messages_before_count - messages_after_count)
486-
/ messages_before_count
487-
* 100
488-
if messages_before_count > 0
489-
else 0
490-
)
465+
466+
467+
491468

492469
# Memory optimization completed
493470

@@ -548,21 +525,11 @@ async def _pure_code_implementation_loop(
548525
"Emergency message trim - applying concise memory optimization"
549526
)
550527

551-
# Capture messages before emergency optimization
552-
messages_before_emergency = messages.copy()
553-
messages_before_count = len(messages)
554-
555-
# Emergency memory optimization triggered
556-
557-
# Apply emergency memory optimization
558528
current_system_message = code_agent.get_system_prompt()
559529
files_implemented_count = code_agent.get_files_implemented_count()
560530
messages = memory_agent.apply_memory_optimization(
561531
current_system_message, messages, files_implemented_count
562532
)
563-
messages_after_count = len(messages)
564-
565-
# Emergency optimization completed
566533

567534
return await self._generate_pure_code_final_report_with_concise_agents(
568535
iteration, time.time() - start_time, code_agent, memory_agent

0 commit comments

Comments
 (0)