Skip to content

Fix cron channel metadata and timezone handling#115

Merged
tsubasakong merged 2 commits intopockebot:mainfrom
stablegenius49:fix-cron-channel-metadata-timezone
Mar 23, 2026
Merged

Fix cron channel metadata and timezone handling#115
tsubasakong merged 2 commits intopockebot:mainfrom
stablegenius49:fix-cron-channel-metadata-timezone

Conversation

@stablegenius49
Copy link
Copy Markdown
Contributor

@stablegenius49 stablegenius49 commented Mar 23, 2026

Summary

  • preserve cron reply metadata by inheriting channel context when scheduled jobs are created from live chats
  • let scheduled jobs run headlessly when no reachable reply target is stored, while still falling back to the source chat when it exists
  • stop inferring schedule timezones from user language, and require explicit confirmation or override when a cron job uses the default timezone

Why

Scheduled jobs created from chat conversations were not consistently carrying enough channel metadata to send later progress or completion replies back to the originating chat. Separately, schedule parsing could drift to a language-implied timezone instead of the user or workspace default, which makes cron timing unreliable. When a schedule falls back to the default timezone, the user should have a chance to confirm or replace it before the cron job is created. Headless scheduled jobs should also keep running even when there is no reply target to notify.

Changes

  • thread channel origin context from GatewayCore and TelegramGateway into AgentRuntime so cron_add and cron_update can inherit delivery metadata, source identifiers, and default timezone handling
  • replace the runtime's task-text timezone heuristics with structured timezoneSource metadata on schedule intents and cron tool calls
  • update schedule intent prompting and normalization so defaulted timezones produce a confirmation message that allows the user to reply with a replacement timezone before creation
  • update GatewayCore pending schedule confirmation handling to accept timezone overrides such as Europe/London and re-render the confirmation prompt before creating the job
  • tighten USER.md timezone parsing so a blank timezone line does not leak into the next profile field
  • add regression coverage for inherited cron metadata, explicit timezone preservation, default-timezone confirmation overrides, blank-timezone fallback parsing, headless scheduled runs, source-chat fallback delivery, and schedule confirmation rendering

Testing

  • npm run check
  • npm run build
  • node --test test/actions.test.mjs test/agent-runtime.test.mjs test/channel-gateway-core.test.mjs test/chat-assistant.test.mjs test/schedule-intent.test.mjs

Checklist

  • I ran relevant tests, or the Testing section explains why I did not.
  • I updated docs, or confirmed no doc changes were needed.
  • I confirmed the PR does not include secrets, credentials, or private data.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 23, 2026

Someone is attempting to deploy a commit to the t54 labs Team on Vercel.

A member of the Team first needs to authorize it.

@tsubasakong
Copy link
Copy Markdown
Collaborator

lgtm

@tsubasakong tsubasakong self-requested a review March 23, 2026 03:11
Copy link
Copy Markdown
Collaborator

@tsubasakong tsubasakong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tsubasakong tsubasakong merged commit 200a979 into pockebot:main Mar 23, 2026
4 of 5 checks passed
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.

2 participants