feat(schedule): add absolute-time reminders

This commit is contained in:
pku-xht
2026-08-06 15:03:48 +08:00
committed by Tianyi Cui
parent 9e61b7d1b1
commit d61059364e
54 changed files with 3169 additions and 374 deletions
+13 -3
View File
@@ -27,6 +27,7 @@ import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest'
import { REPO_ROOT, connectFreshWorkspace, newEnglishPage, probeFreePort, requireDist, saveFailureShot } from './support.ts'
const DEVELOPMENT_PROMPT = fileURLToPath(new URL('./snapshots/web-runtime-context/development-prompt.expected.md', import.meta.url))
const WEB_TIME_ZONE = 'UTC'
function waitForReadyLine(child: ChildProcess): Promise<string> {
return new Promise((resolveReady, reject) => {
@@ -241,11 +242,14 @@ describe('dsh web keyless CLI smoke', () => {
)
try {
const baseUrl = await waitForReadyLine(child)
const created = await rpc<{ sessionId: string }>(baseUrl, 'session.create', {})
const created = await rpc<{ sessionId: string }>(baseUrl, 'session.create', {
timeZone: WEB_TIME_ZONE,
})
await rpc<{ accepted: true }>(baseUrl, 'session.prompt', {
sessionId: created.sessionId,
mode: 'queue',
content: [{ type: 'text', text: 'go' }],
clientTimeZone: WEB_TIME_ZONE,
})
const capturedRequests = await Promise.race([
providerRequests,
@@ -353,11 +357,14 @@ describe('dsh web keyless CLI smoke', () => {
)
try {
const baseUrl = await waitForReadyLine(child)
const created = await rpc<{ sessionId: string }>(baseUrl, 'session.create', {})
const created = await rpc<{ sessionId: string }>(baseUrl, 'session.create', {
timeZone: WEB_TIME_ZONE,
})
await rpc<{ accepted: true }>(baseUrl, 'session.prompt', {
sessionId: created.sessionId,
mode: 'queue',
content: [{ type: 'text', text: promptMarker }],
clientTimeZone: WEB_TIME_ZONE,
})
let page: HistoryPage | undefined
await expect.poll(async () => {
@@ -437,11 +444,14 @@ describe('dsh web keyless CLI smoke', () => {
)
try {
const baseUrl = await waitForReadyLine(child)
const created = await rpc<{ sessionId: string }>(baseUrl, 'session.create', {})
const created = await rpc<{ sessionId: string }>(baseUrl, 'session.create', {
timeZone: WEB_TIME_ZONE,
})
await rpc<{ accepted: true }>(baseUrl, 'session.prompt', {
sessionId: created.sessionId,
mode: 'queue',
content: [{ type: 'text', text: 'go' }],
clientTimeZone: WEB_TIME_ZONE,
})
const captured = await Promise.race([
providerRequest,