Skip to content

Conversation

@WEIFENG2333
Copy link
Owner

@WEIFENG2333 WEIFENG2333 commented Jan 27, 2026

Commits on Jan 26, 2026
feat: Enhance LLM logging and configuration options

@WEIFENG2333
WEIFENG2333 committed 2 days ago
Commits on Jan 28, 2026
feat: Enhance LLM logging and configuration options

@WEIFENG2333
WEIFENG2333 committed 39 minutes ago
feat: Enhance video information retrieval and subtitle rendering

@WEIFENG2333
WEIFENG2333 committed


Note

Introduces end-to-end LLM request logging with per-task context and a UI to inspect logs, plus stability improvements in subtitle rendering and task handling.

  • Adds task IDs to all task types and propagates a shared task_id across the full flow; new llm.context manages task_id/file/stage for threads
  • Wraps OpenAI client with HTTPX hooks to log chat/completions requests/responses to llm_requests.jsonl; integrates response logging and caching; exposes a new "请求日志" page to view/search/paginate/copy logs
  • Enhances subtitle pipeline: sets/updates/clears task context in SubtitleThread, prefixes custom prompts with file context, minor env/progress cleanups
  • Improves rounded subtitle renderer: reads video duration and forces -t <duration> in ffmpeg overlay batches to prevent truncation; refactors video info parsing and command execution
  • Font utilities cleanup and cache invalidation; default rounded font now LXGW WenKai; translate ThreadNum max reduced to 50
  • TaskFactory wires LLM service configs (base/model/key) into SubtitleConfig and accepts external task_id
  • UI: adds "请求日志" to navigation; subtitle style interface avoids duplicate load via signal blocking
  • Packaging: relaxes PyQt5 pin, adds PyQt5-Qt5 (Windows) and fonttools

Written by Cursor Bugbot for commit 9d66d6a. This will update automatically on new commits. Configure here.

- Updated `pyproject.toml` to modify PyQt5 version constraints and add PyQt5-Qt5 for Windows.
- Introduced a logging mechanism for LLM requests and responses, including a new `request_logger.py` for managing logs.
- Added a user interface for viewing LLM logs, allowing users to inspect request and response details.
- Adjusted configuration settings to improve thread management and font options in the application.

These changes improve the application's logging capabilities and user experience when interacting with LLM functionalities.
- Updated `pyproject.toml` to modify PyQt5 version constraints and add a Windows-specific dependency for PyQt5-Qt5.
- Introduced a new logging mechanism for LLM requests, including a dedicated request logger to capture and store request and response details.
- Added a user interface for viewing LLM logs, allowing users to inspect request details and responses.
- Refined configuration settings, including adjustments to thread number limits and font settings for improved user experience.

These enhancements improve the application's logging capabilities and provide users with better insights into LLM interactions.
- Updated `_get_video_info` function to return video resolution and duration, improving error handling for resolution extraction.
- Refactored calls to `_get_video_info` in `render_rounded_video` to utilize the new duration data.
- Streamlined code formatting for better readability across various functions in `rounded_renderer.py` and `subtitle_thread.py`.
- Improved context handling in `SubtitleThread` for better subtitle optimization based on video file context.

These changes enhance the functionality and maintainability of subtitle rendering and video processing features.
@claude
Copy link

claude bot commented Jan 27, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@WEIFENG2333 WEIFENG2333 merged commit fdab06b into master Jan 27, 2026
1 of 2 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on February 24

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.


# 如果没有已完成的,取第一个
key = completed_key if completed_key else next(iter(_pending_requests))
pending = _pending_requests.pop(key)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Race condition in concurrent LLM request logging

High Severity

The _pending_requests dictionary is accessed from multiple threads without synchronization. With concurrent LLM calls (via ThreadPoolExecutor with up to 50 threads), log_llm_response cannot correctly match responses to their originating requests—it simply picks any "completed" entry or the first one available. This causes incorrect request-response pairing in logs and potential dictionary modification errors during iteration.

Additional Locations (1)

Fix in Cursor Fix in Web

duration = 0.0
if match := re.search(r"Duration:\s*(\d+):(\d+):(\d+(?:\.\d+)?)", result.stderr):
h, m, s = match.groups()
duration = int(h) * 3600 + int(m) * 60 + float(s)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing duration causes zero-length video output

High Severity

The _get_video_info function raises an error when resolution parsing fails but silently defaults duration to 0.0 when duration parsing fails. This value is then used in the ffmpeg command as -t 0.0, which truncates the output video to zero length. Videos without duration metadata or with unusual formats would produce corrupted zero-length output files with no error message.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants