Commit Graph

7 Commits

Author SHA1 Message Date
ishenwei
c517a0bbde sync_sessions.py: add --sync-ssh for remote session sync via SSH
- Add --sync-ssh HOST --sync-source-path PATH to sync sessions from
  a remote host without needing to install the script there.
- Key changes:
  * ssh_list_dir(): enumerate subdirs only (fixes 'sessions' file in agents/)
  * ssh_list_files(): use ls -p to filter directories; strip remote_dir prefix
  * ssh_stat_mtime_batch(): single SSH call via Python stdin, works on
    both Linux and macOS, avoids xargs command-line length limits
  * sync_sessions_via_ssh(): parallel mtime fetch per agent dir, then
    SSH-read & parse only new/modified files
  * parse_jsonl_content(): shared parser for both local files and SSH content
- Session sync now unified: run from macmini, targets macmini/ubuntu1/ubuntu2.
- Cron sync also updated to use ssh_stat_mtime_batch for efficiency.
2026-04-16 10:06:24 +08:00
ishenwei
6f0b3e231a Add: test scripts (sync_sessions, test_all_pages, test_e2e_agent_browser) 2026-04-14 11:04:37 +08:00
ishenwei
74458b4fab feat: add CronJob and CronJobRun models with bulk upsert API and admin
- CronJob: maps jobs.json (schedule, payload, delivery, state fields)
- CronJobRun: stores runs/*.jsonl per-job execution history with usage/tokens
- cron_bulk_upsert service: atomic upsert with GET_OR_CREATE for idempotency
- POST /api/cron/bulk_upsert/ endpoint
- Django Admin: CronJobAdmin with CronJobRunInline, CronJobRunAdmin
- sync_sessions.py --cron mode: SSH read jobs.json + runs/*.jsonl, incremental sync
- 0003_cronjob_cronjobrun migration
2026-04-13 13:34:24 +08:00
ishenwei
c474c9404b feat: add agent_name column to Message admin + export_agent_daily script
- Message list now shows agent_name via get_agent_name method
- New scripts/export_agent_daily.py for agent daily message export
  - Accepts --agent and --date (YYYY-MM-DD) arguments
  - Focuses on messages within target date (session may span multiple days)
  - Outputs Markdown with session info, messages, tool calls
2026-04-07 18:22:24 +08:00
ishenwei
f205c42714 fix: resolve startup issues and JSONL parsing bugs
- Add PYTHONPATH/DJANGO_SETTINGS_MODULE for Docker environment
- Fix gunicorn bind port (8000 instead of 8765)
- Add whitenoise for static file serving
- Fix JSONL parser: read role/content from event.message.* (nested structure)
- Fix session counts (message_count/tool_call_count/error_count were all 0)
- Increase DATA_UPLOAD_MAX_MEMORY_SIZE to 50MB for large batch syncs
- Add STATIC_ROOT and WhiteNoise middleware for admin CSS
- Fix index name length (>30 chars issue)
- Replace unique_together with indexes (Django 5.x compatible)
- Add graceful degradation for TimescaleDB hypertable creation
- Add static_volume/ to .gitignore
2026-04-06 20:51:51 +08:00
f754f6a275 update django port 2026-04-06 18:55:48 +08:00
414c30f023 feat: client JSONL parse and push script
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 16:27:27 +08:00