Skip to content

feat(cron): enhance cron job handler with recent chat history context#770

Open
ba0f3 wants to merge 1 commit intonextlevelbuilder:devfrom
ba0f3:fix/using-group-contenxt-for-cron
Open

feat(cron): enhance cron job handler with recent chat history context#770
ba0f3 wants to merge 1 commit intonextlevelbuilder:devfrom
ba0f3:fix/using-group-contenxt-for-cron

Conversation

@ba0f3
Copy link
Copy Markdown
Contributor

@ba0f3 ba0f3 commented Apr 8, 2026

Summary

  • Introduced linkedDeliveryChatContextBlock function to append recent messages from the delivery chat's session to the cron job's prompt.
  • Updated makeCronJobHandler to include chat history when delivering messages to group chats.
  • Improved peer kind resolution to treat Telegram supergroups/channels as group types based on chat ID format.
  • Added constants for message and character limits to manage chat history output.

This enhancement allows the cron job to provide more context-aware responses by including relevant chat history, improving user experience in group interactions.

Type

  • Feature
  • Bug fix
  • Hotfix (targeting main)
  • Refactor
  • Docs
  • CI/CD

Target Branch

Checklist

  • go build ./... passes
  • go build -tags sqliteonly ./... passes (if Go changes)
  • go vet ./... passes
  • Tests pass: go test -race ./...
  • Web UI builds: cd ui/web && pnpm build (if UI changes)
  • No hardcoded secrets or credentials
  • SQL queries use parameterized $1, $2 (no string concat)
  • New user-facing strings added to all 3 locales (en/vi/zh)
  • Migration version bumped in internal/upgrade/version.go (if new migration)

Test Plan

- Introduced linkedDeliveryChatContextBlock function to append recent messages from the delivery chat's session to the cron job's prompt.
- Updated makeCronJobHandler to include chat history when delivering messages to group chats.
- Improved peer kind resolution to treat Telegram supergroups/channels as group types based on chat ID format.
- Added constants for message and character limits to manage chat history output.

This enhancement allows the cron job to provide more context-aware responses by including relevant chat history, improving user experience in group interactions.
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.

1 participant