-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Bug Fixes and Workflow Improvements #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jany-M
wants to merge
8
commits into
HKUDS:main
Choose a base branch
from
Jany-M:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
be8feaf
up to date
Jany-M afa43f7
Update .gitignore
Jany-M b25429a
Merge branch 'HKUDS:main' into main
Jany-M 45a5889
Fixed issue on Win with LibreOffice and PDF to markdown conversion
Jany-M c5d1ab8
Improvements and error fixes (PDF, dynamic token limits)
Jany-M f72497b
Added CHANGELOG.md
Jany-M 721e7d2
Fixed issue on Win: project code not writing to file
Jany-M 40e4630
v.1.0.6-jm - 2025-10-19
Jany-M File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to DeepCode will be documented in this file. | ||
|
|
||
| ## [1.0.6-jm] - 2025-10-19 | ||
|
|
||
| ### Added | ||
| - **Dynamic Model Limit Detection**: New `utils/model_limits.py` module that automatically detects and adapts to any LLM model's token limits and pricing | ||
| - **Loop Detection System**: `utils/loop_detector.py` prevents infinite loops by detecting repeated tool calls, timeouts, and progress stalls | ||
| - **Progress Tracking**: 8-phase progress tracking (5% → 100%) with file-level progress indicators in both UI and terminal | ||
| - **Abort Mechanism**: "Stop Processing" button in UI with global abort flag for clean process termination | ||
| - **Cache Cleanup Scripts**: `start_clean.bat` and `start_clean.ps1` to clear Python cache before starting | ||
| - **Enhanced Error Display**: Real-time error messages in both UI and terminal with timestamps | ||
| - **File Progress Tracking**: Shows files completed/total with estimated time remaining | ||
|
|
||
| ### Fixed | ||
| - **Critical: False Error Detection**: Fixed overly aggressive error detection that was marking successful operations as failures, causing premature abort and empty file generation | ||
| - **Critical: Empty File Generation**: Files now contain actual code instead of being empty (2-byte files) | ||
| - **Unique Folder Naming**: Each project run now creates `paper_{timestamp}` folders instead of reusing `pdf_output` | ||
| - **PDF Save Location**: PDFs now save to `deepcode_lab/papers/` instead of system temp directory | ||
| - **Duplicate Folder Prevention**: Added session state caching to prevent duplicate folder creation on UI reruns | ||
| - **Token Limit Compliance**: Fixed `max_tokens` to respect model limits dynamically (e.g., gpt-4o-mini's 16,384 token limit) | ||
| - **Empty Plan Detection**: System now fails early with clear error messages when initial plan is empty or invalid | ||
| - **Process Hanging**: Fixed infinite loops and hanging on errors - process now exits cleanly | ||
| - **Token Cost Tracking**: Restored accurate token usage and cost display (was showing $0.0000) | ||
| - **PDF to Markdown Conversion**: Fixed automatic conversion and file location handling | ||
| - **Document Segmentation**: Properly uses configured 50K character threshold from `mcp_agent.config.yaml` | ||
| - **Error Propagation**: Abort mechanism now properly stops process after 10 consecutive real errors | ||
|
|
||
| ### Changed | ||
| - **Model-Aware Token Management**: Token limits now adapt automatically based on configured model instead of hardcoded values | ||
| - **Cost Calculation**: Dynamic pricing based on actual model rates (OpenAI, Anthropic) | ||
| - **Retry Logic**: Token limits for retries now respect model maximum (87.5% → 95% → 98% of max) | ||
| - **Segmentation Workflow**: Better integration with code implementation phase | ||
| - **Error Handling**: Enhanced error propagation - errors no longer reported as "success" | ||
| - **UI Display**: Shows project folder name after PDF conversion for better visibility | ||
| - **Terminal Logging**: Added timestamps to all progress messages | ||
|
|
||
| ### Technical Improvements | ||
| - Added document-segmentation server to code implementation workflow for better token management | ||
| - Improved error handling in agent orchestration engine with proper cleanup | ||
| - Enhanced subprocess handling on Windows (hide console windows, prevent hanging) | ||
| - Better LibreOffice detection on Windows using direct path checking | ||
| - Fixed input data format consistency (JSON with `paper_path` key) | ||
| - Added comprehensive logging throughout the pipeline | ||
| - Improved resource cleanup on errors and process termination | ||
|
|
||
| ### Documentation | ||
| - Translated Chinese comments to English in core workflow files | ||
| - Added inline documentation for new utility modules | ||
| - Created startup scripts with clear usage instructions | ||
|
|
||
| ### Breaking Changes | ||
| - None - all changes are backward compatible | ||
|
|
||
| ### Known Issues | ||
| - Terminal may show trailing "Calling Tool..." line after completion (cosmetic display artifact - process completes successfully) | ||
| - Some Chinese comments remain in non-critical files (cli, tools) - translation in progress | ||
| - tiktoken package optional warning (doesn't affect functionality) | ||
|
|
||
| ### Success Metrics | ||
| - ✅ Complete end-to-end workflow: DOCX upload → PDF conversion → Markdown → Segmentation → Planning → Code generation | ||
| - ✅ Files generated with actual code content (15+ files with proper implementation) | ||
| - ✅ Single folder per project run (no duplicates) | ||
| - ✅ Dynamic token management working across different models | ||
| - ✅ Accurate cost tracking per model | ||
| - ✅ Clean process termination with proper error handling | ||
|
|
||
| --- | ||
|
|
||
| ## [1.0.5] - Previous Release | ||
|
|
||
| See previous releases for earlier changes. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.