Files
pipelines/docs/notes/chat-automation-discovery.md

2.2 KiB

Manager native scheduling findings

Official Anthropic SDK types downloaded read-only from the official npm package @anthropic-ai/claude-agent-sdk 0.3.319 into /tmp/claude-schedules-sdk-types. Installed Claude is2.1.318. sdk.d.ts StopHookInput (line10147) has optional session_crons: SessionCronSummary[]; each id/schedule/recurring/prompt. Empty is known none, absent unknown. Hook callback initialization SDKControlInitializeRequest line4722 includes hooks and SDKHookCallbackMatcher hookCallbackIds; callback subtype hook_callback has callback_id and input. Existing server translate.go177 rejects all hook_callback, so a small explicit observer callback could be handled without model turns. Detachable claudehost must own callback ACK/metadata even when server disconnected to preserve real scheduled sessions; never make the new observer block or auto-answer operator permission callbacks. No global hook config changes.

There is NO SDK get_session_info/get_session_state/get_cron_tasks control request. background_tasks control is mutating Ctrl+B, NOT a read; do not call it. Stop snapshot is native current session state, whereas parsing CronCreate history as if it were current would be misleading. Old retained hosts lack observer hooks; never restart them to enable metadata, report unknown until native support exists.

Official OpenCode API current docs GET /api/experimental/schedule?sessionID=...: Schedule.Info status active/paused/done, id, sessionID, nextDueAt. Installed2.0.32 binary does not contain experimental/schedule, ScheduleCreate or schedule.list symbols. No provider upgrades authorized just to make a count work. Codex CLI0.164 has no Scheduled management interface per official OpenAI docs; app/global automation jobs must not be assigned to chats by shared cwd.

Manager native probe: isolated scratch CLI initialization accepted the observer configuration. Both direct CLI and official SDK probes failed provider authentication before an ordinary successful turn/Stop callback. This did not verify native Stop delivery or schedule lifecycle. Existing credentials/configurations were unchanged; owned processes exited. Reports: /tmp/claude-native-automation-hook-probe.json and /tmp/claude-native-sdk-automation-hook-probe.json. No real operator chat was prompted.