Skip to content

v5.2.0: Add mail service for remote AI access#74

Merged
bfly123 merged 11 commits intomainfrom
rollback-test
Feb 2, 2026
Merged

v5.2.0: Add mail service for remote AI access#74
bfly123 merged 11 commits intomainfrom
rollback-test

Conversation

@bfly123
Copy link
Owner

@bfly123 bfly123 commented Feb 2, 2026

Summary

Add email integration for remote AI access, allowing users to interact with AI providers via email when away from the terminal.

Changes

New Features

  • Mail Service (lib/mail/): Complete email system with adapters for Gmail, Outlook, QQ, 163
  • Mail Daemon (bin/maild): Background service for continuous email monitoring
  • Web Interface (lib/web/): FastAPI-based web UI for service management
  • Format Guardrails (lib/format_guardrails.py): Code fence detection and repair

Documentation

  • Bump version to v5.2.0
  • Add "What's New" entry for mail service
  • Add Mail System Configuration section (EN/ZH)

Install Scripts

  • Add maild to install scripts
  • Exclude web UI from CLI-only installs

Testing

  • Added tests for format guardrails
  • Added tests for Claude session fallback

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

bfly123 and others added 11 commits January 31, 2026 15:38
When CCB_CALLER=email, the completion hook now sends replies via email
instead of terminal notification. This enables the mail daemon to receive
AI responses through the standard ask flow.

Changes:
- completion_hook.py: Pass email context (req_id, msg_id, from_addr) to hook
- ccb-completion-hook: Add send_email_reply() function for email caller
- ask: Forward email env vars when caller=email
- daemon.py: Accept email_* fields in request
- adapters: Pass email context through to notify_completion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pass work_dir through notify_completion to ensure the completion hook
finds the correct session file when running from askd daemon. Without
this, the hook would use the daemon's working directory instead of the
request's working directory, causing notifications to be sent to the
wrong pane.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Search multiple locations in priority order (request work_dir first)
- Validate session's work_dir matches request's work_dir
- Skip session files that belong to different projects
- Better cross-platform support with explicit path handling

This prevents notifications from being sent to wrong panes when
multiple projects have session files in different locations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When maild calls ask command with CCB_CALLER=email, the ask command
uses nohup to run in background. The background script was missing
CCB_RUN_DIR environment variable, causing the ask command to look
for askd state file in wrong location (~/.cache/ccb/askd.json instead
of ~/.cache/ccb/projects/{hash}/askd.json).

This fix ensures CCB_RUN_DIR is passed to background scripts so email
requests to Claude are correctly routed to the askd daemon.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add debug logging before notify_completion call to track:
- caller type (email/claude/etc)
- done_seen status
- email_req_id for email requests

This helps diagnose email reply issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ccb mail subcommand (setup/start/stop/status/test/config)
- Implement CCB_BEGIN/CCB_DONE protocol for reliable reply extraction
- Add postprocessing for box tables, code fences, release notes formats
- Add subagent log reading support in ClaudeLogReader
- Improve completion hook timeout and error logging for email
- Remove deprecated caskd daemon

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add mail daemon (maild) with adapters for Gmail, Outlook, QQ
- Add mail TUI wizard for configuration
- Add FastAPI-based web interface for service management
- Update install scripts to include maild and exclude web UI from CLI-only installs
- Add backward-compatible alias for mail config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add format_guardrails module for code fence detection and repair
- Add tests for format guardrails functionality
- Add tests for Claude session fallback logic
- Add mail config template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Bump version to v5.2.0
- Add What's New entry for mail service feature
- Add Mail System Configuration section (EN/ZH)
- Fix maild command format (subcommands, not flags)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test file imported _extract_reply_from_session which doesn't exist
in askd.adapters.claude, causing CI to fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add counter to make_req_id to ensure uniqueness when called rapidly
- Update regex patterns to match new format with counter
- Update test to match actual req_id format (YYYYMMDD-HHMMSS-mmm-PID-counter)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bfly123 bfly123 merged commit 627b533 into main Feb 2, 2026
23 checks passed
@bfly123 bfly123 deleted the rollback-test branch February 2, 2026 04:40
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