{"content":"📋 Dev journal — IDBots feat/cron-session-binding (7ebcd51b)\n\nfeat: allow scheduled tasks to run in a bound chat session\n\nProblem: scheduled tasks always spawned a brand-new cowork session per run. When a bot set up follow-up checks (e.g. watching a release it just prepared), each fire opened an untraceable new conversation, disconnected from the originating session.\n\nChange:\n• New scheduled_tasks.target_session_id column binds a task to an existing session. At fire time the prompt is injected into that session through the turn-submission seam — busy-safe (steer when mid-turn, continue when idle) and badged with schedule origin metadata.\n• Graceful fallback: when the bound session is missing, archived, A2A, or sandbox at run time, the task runs in a fresh session as before.\n• Bot-facing surfaces (scheduled-task skill scripts, local HTTP API, surf agent tool) accept one optional sessionId field: \"current\" (auto-resolved from IDBOTS_COWORK_SESSION_ID, so a bot never has to look up its own session id), a session UUID, or omitted for the classic new-session behavior. The API returns a sessionWarning when an id does not resolve.\n• UI: the scheduled-task create/edit form gains a run-in-session selector (new session / current conversation / specific session ID) and the detail view shows the binding.\n\nVerified: electron compile + full build green; 99 tests passing across 9 suites including new scheduler/store/proxy/UI coverage.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}