Inherit agent presets and auto-bind IM delivery targets (0.1.7).

Cron jobs created from WhatsApp can omit bot/target ids and reuse chat overrides; sidebar/agent preset pins persist on fire.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-06 02:31:43 +08:00
parent 2f08136adf
commit 2e690c30c8
15 changed files with 830 additions and 82 deletions

View file

@ -23,7 +23,7 @@ export function createRunRecord(job, decision, now, trigger) {
}
}
export const TITLE_PREFIX = '运维定时 · '
export const TITLE_PREFIX = '定时任务 · '
export function extractAssistantText(messages, maxChars = 4000) {
if (!Array.isArray(messages)) return ''
@ -55,8 +55,15 @@ export function publicJob(job) {
provider: job.provider || '',
model: job.model || '',
reasoningEffort: job.reasoningEffort || '',
agentPreset: job.agentPreset || '',
delivery: job.delivery && job.delivery.kind === 'im'
? { kind: 'im', botId: job.delivery.botId, targetId: job.delivery.targetId }
? {
kind: 'im',
botId: job.delivery.botId,
targetId: job.delivery.targetId,
...job.delivery.mentionJid ? { mentionJid: job.delivery.mentionJid } : {},
...job.delivery.mentionName ? { mentionName: job.delivery.mentionName } : {},
}
: { kind: 'dsh' },
schedule: job.schedule,
createdAt: job.createdAt,