Skip to content

fix(capture): use hwnd instead of window title in screenshot filename#44

Merged
gtt116 merged 7 commits into
mainfrom
fix/screenshot-filename-encoding
Jul 9, 2026
Merged

fix(capture): use hwnd instead of window title in screenshot filename#44
gtt116 merged 7 commits into
mainfrom
fix/screenshot-filename-encoding

Conversation

@gtt116

@gtt116 gtt116 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Problem

Screenshot filenames included the window title (via win32gui.GetWindowText). When the title contains Chinese characters, str.isalnum() returns True for them, allowing non-ASCII characters into the filename. cv2.imwrite on Windows cannot handle non-ASCII paths and fails.

Changes

  • Replace window title with hwnd + timestamp in filename, ensuring pure ASCII
  • Switch cv2.imwrite to cv2.imencode + open().write() for both screenshot and bbox overlay, as a defensive fix for non-ASCII characters in the user profile path

- New enikk/cron module: store.py (JSON persistence, schedule parsing),
  runner.py (background thread), tools.py (8 agent tools)
- Schedule types: duration (30m), interval (every 2h), cron expr, timestamp
- Per-job max_run_time with fallback to global config
- Cron sessions marked with ⏰ prefix and cron_ session ID
- Toolset 'enikk_cron' (8 tools: create/list/get/update/delete/pause/resume/trigger)
- REST API: CRUD + pause/resume/trigger endpoints
- Default enabled, 60s tick interval, serial execution
- 53 new tests (store, runner, tools)
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

✅ Build succeeded! Artifact: enikk-dev-45e3215

📥 Download artifact

gtt116 added 6 commits July 9, 2026 20:27
- /api/status now returns cron {enabled, job_count, message}
- Status bar moved from sidebar to full-width bottom of page
- Cron indicator shows ⏰ + active job count with tooltip
- Layout restructured: body flex-col, main area flex-1, status bar at bottom
- 3 new unit tests for status endpoint cron section
- Session list redesigned with Chat/Cron tabs
- Cron tab shows cron sessions with search and filter
- Clicking cron job history button switches to Cron tab with filter
- Filter indicator shows active filter with clear button
- Cron sessions marked with is_cron flag instead of filtering
- Added /api/cron/{job_id}/sessions endpoint
- UI improvements: emoji icons, session title in header, breadcrumb
- Bug fixes: null checks, pause visibility, custom confirm dialog
- i18n: tab labels, filter text, search placeholder
Add background cleanup_loop that resets stale chat_id → session_id
bindings at 04:00 daily (if inactive > 1h) to prevent unbounded
state growth.

- Track _chat_last_active timestamps per chat_id in state file
- 7 tests in TestSessionCleanup
- New autostart.py module wrapping schtasks.exe (ONLOGON, HIGHEST privilege)
- --start-minimized CLI flag to launch hidden in system tray
- GET/PUT /api/autostart endpoints to query and toggle status
- UI toggle in Basic config tab with i18n support (zh-CN, en)
- Syncs config.yaml with actual Task Scheduler state
Chinese characters in window titles caused cv2.imwrite to fail on
Windows due to non-ASCII path encoding. Also switched to
cv2.imencode + open().write() to handle any remaining non-ASCII
path components (e.g. user profile directory).
@gtt116 gtt116 force-pushed the fix/screenshot-filename-encoding branch from 64e531a to 9c0b1b1 Compare July 9, 2026 12:29
@gtt116 gtt116 merged commit f8b2dfd into main Jul 9, 2026
3 checks passed
@gtt116 gtt116 deleted the fix/screenshot-filename-encoding branch July 9, 2026 12:50
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.

1 participant