* feat(cron): add per-job permission mode override
Allow individual cron jobs to specify a permission mode (e.g.
bypassPermissions) that overrides the project default during execution.
The mode is restored after the job completes to prevent leakage into
subsequent user messages.
Changes:
- CronJob.Mode field with validation against known modes
- Message.ModeOverride as runtime carrier to processInteractiveMessageWith
- LiveModeSwitcher.SetLiveMode applied with defer-based restoration
- CronAddRequest.Mode in both Unix socket and management HTTP APIs
- Management API PATCH support for editing existing cron jobs
- Web dashboard: inline mode selector per job + create form dropdown
- i18n translations for all 5 languages (EN/ZH/ZH-TW/JA/ES)
* fix(web): always show permission mode badge on cron job cards
---------
Co-authored-by: ma_k <ma_k@ctrip.com>
Add new CLI command `cc-connect cron info <id>` that displays full JSON
details of a scheduled task. This helps users inspect all configuration
fields of a cron job that aren't visible in the compact `cron list` output.
Changes:
- Add `/cron/info` API endpoint in core/api.go
- Add `runCronInfo` CLI handler in cmd/cc-connect/cron.go
- Update help text to include the new command
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat(cron): add `cron edit` command to modify job fields
Add new CLI command `cc-connect cron edit <id> <field> <value>` that
modifies individual fields of a scheduled task.
Features:
- Supports all editable fields: project, session_key, cron_expr, prompt,
exec, work_dir, description, enabled, silent, mute, session_mode, timeout_mins
- Type validation: bool fields (enabled, mute) and int fields (timeout_mins)
- Read-only fields protected: id, created_at cannot be modified
- Cron expression validation before applying
- Automatic rescheduling when cron_expr or enabled changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(cron): add fallback reflection for string fields + comprehensive help
- Add reflection-based fallback for unknown string fields in updateJobField
- Add printCronEditUsage() with full field list, types, and examples
- Add --help/-h flag support to runCronEdit
- Update error messages to reference --help
The reflection fallback allows editing new string fields without code changes,
while type validation for known fields (bool, int) is preserved.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(cron): protect last_run and last_error from editing
Add last_run and last_error to read-only fields list.
These are system-maintained fields that should not be manually edited.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
The changes add error handling for previously ignored operations and introduce logging for critical errors and warnings. This includes:
- Adding error checks for file operations, JSON unmarshaling, system calls
- Logging warnings/errors for failed operations using slog
- Properly handling return values from functions that were previously ignored
- Adding context to error messages for better debugging
- Cleaning up unused code and variables
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Added max attachment size limit (50MB) with validation. Implemented path sanitization for attachments. Added related tests for size limit and path cleaning. Also added i18n messages for BTW command responses and improved connection cleanup in WeCom websocket.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
When creating a cron job via `cron add`, if no session_key was provided
(neither via --session-key flag nor CC_SESSION_KEY env), the job was
created with an empty session_key. At runtime, ExecuteCronJob would fail
silently because it couldn't determine the target platform from an empty
session key.
Add server-side validation and auto-detection in handleCronAdd:
- If session_key is empty, attempt to auto-detect from the engine's
active interactive sessions (works when exactly one session exists)
- If auto-detection fails, return a clear error to the client
Add Engine.ActiveSessionKeys() helper method to expose active session
keys for the auto-detection logic. Uses platform != nil check (instead
of agent session alive check) so sessions are discoverable even before
an agent process is started.
The changes introduce a new `--exec` flag to run shell commands directly in cron jobs, mutually exclusive with `--prompt`. This includes:
- Adding `exec` and `work_dir` fields to cron job structs
- Implementing shell command execution logic with timeout handling
- Adding new `/cron addexec` command for shell jobs
- Updating API validation and documentation
- Adding i18n support for new shell-related messages
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
1. Unix socket permissions: 0o660 → 0o600 (owner-only access), preventing
other processes in the same group from injecting messages via the API.
2. Telegram bot token redaction: when file downloads fail, the bot token
embedded in the Telegram API URL is now replaced with [REDACTED] in
error messages to prevent token leakage in logs.
3. Startup warning for open allow_from: all platforms now log a WARN-level
message when allow_from is not configured, making it obvious that the
deployment permits all users. This surfaces the fail-open default so
operators can make an informed decision.
Ref #60
This commit introduces a new relay system for bot-to-bot communication, including:
- New `relay` command with send/bind functionality
- RelayManager for coordinating messages between engines
- API endpoints for relay operations
- Interactive `/bind` command for chat group binding
- Session handling and message forwarding
- CLI documentation and help messages
- Internationalization support for relay messages
- Stream preview improvements for relay messages
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
- Store http.Server instance in APIServer struct for better resource management
- Enhance provider listing with current provider marker and remove bold formatting
- Update i18n strings for provider list titles
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
Add multimodal image support to Claude sessions by saving attachments to temp files and sending as base64-encoded content. Implement new CLI `send` command and Unix socket API server for external tools to send messages to active sessions. Image support added across all platforms (Discord, Feishu, Line, Slack, Telegram, WeCom).
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>