v5.2.0: Add mail service for remote AI access#74
Merged
Conversation
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
lib/mail/): Complete email system with adapters for Gmail, Outlook, QQ, 163bin/maild): Background service for continuous email monitoringlib/web/): FastAPI-based web UI for service managementlib/format_guardrails.py): Code fence detection and repairDocumentation
Install Scripts
maildto install scriptsTesting
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com