fix: throttle desktop monitoring dispatch
Desktop Client Build / Resolve Build Metadata (push) Successful in 27s
Backend CI / Backend (push) Successful in 15m57s
Desktop Client Build / Build Desktop Client (push) Successful in 22m57s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 27s
Desktop Client Build / Resolve Build Metadata (push) Successful in 27s
Backend CI / Backend (push) Successful in 15m57s
Desktop Client Build / Build Desktop Client (push) Successful in 22m57s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 27s
This commit is contained in:
@@ -69,6 +69,12 @@ describe('deepseek adapter helpers', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('does not use task title as monitoring question text', () => {
|
||||
expect(() => extractQuestionText({ title: '监控任务 · DeepSeek' })).toThrow(
|
||||
'deepseek_question_text_missing',
|
||||
)
|
||||
})
|
||||
|
||||
it('dedupes sources by normalized url without hash fragments', () => {
|
||||
const items = dedupeSourceItems([
|
||||
{
|
||||
|
||||
@@ -499,7 +499,6 @@ function extractQuestionText(payload: Record<string, unknown>): string {
|
||||
payload.question,
|
||||
payload.prompt,
|
||||
payload.content,
|
||||
payload.title,
|
||||
]
|
||||
|
||||
for (const candidate of candidates) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { __doubaoTestUtils } from './doubao'
|
||||
const {
|
||||
buildSourceItem,
|
||||
dedupeSourceItems,
|
||||
extractQuestionText,
|
||||
isNonCitationAssetDomain,
|
||||
isNonCitationAssetUrl,
|
||||
parseDoubaoStreamBody,
|
||||
@@ -12,6 +13,13 @@ const {
|
||||
} = __doubaoTestUtils
|
||||
|
||||
describe('doubao adapter helpers', () => {
|
||||
it('does not use task title as monitoring question text', () => {
|
||||
expect(extractQuestionText({ question_text: '幽灵门轨道长度定制' })).toBe('幽灵门轨道长度定制')
|
||||
expect(() => extractQuestionText({ title: '监控任务 · 豆包' })).toThrow(
|
||||
'doubao_question_text_missing',
|
||||
)
|
||||
})
|
||||
|
||||
it('filters byteimg and bytednsdoc asset CDN links from source items', () => {
|
||||
expect(isNonCitationAssetDomain('p3-spider-image-sign.byteimg.com')).toBe(true)
|
||||
expect(isNonCitationAssetDomain('lf3-static.bytednsdoc.com')).toBe(true)
|
||||
|
||||
@@ -1221,7 +1221,6 @@ function extractQuestionText(payload: Record<string, unknown>): string {
|
||||
payload.question,
|
||||
payload.prompt,
|
||||
payload.content,
|
||||
payload.title,
|
||||
]
|
||||
|
||||
for (const candidate of candidates) {
|
||||
@@ -3256,6 +3255,7 @@ export const doubaoAdapter: MonitorAdapter = {
|
||||
export const __doubaoTestUtils = {
|
||||
buildSourceItem,
|
||||
dedupeSourceItems,
|
||||
extractQuestionText,
|
||||
isNonCitationAssetDomain,
|
||||
isNonCitationAssetUrl,
|
||||
parseDoubaoStreamBody,
|
||||
|
||||
@@ -5,6 +5,7 @@ import { __kimiTestUtils } from './kimi'
|
||||
const {
|
||||
buildSourceItem,
|
||||
classifyKimiSources,
|
||||
extractQuestionText,
|
||||
isKimiAnswerComplete,
|
||||
isKimiPromotionalAnswerNoise,
|
||||
mergeKimiSourceLinksIntoContentSnapshot,
|
||||
@@ -41,6 +42,13 @@ function buildSnapshot(
|
||||
}
|
||||
|
||||
describe('kimi adapter helpers', () => {
|
||||
it('does not use task title as monitoring question text', () => {
|
||||
expect(extractQuestionText({ question_text: '幽灵门轨道长度定制' })).toBe('幽灵门轨道长度定制')
|
||||
expect(() => extractQuestionText({ title: '监控任务 · Kimi' })).toThrow(
|
||||
'kimi_question_text_missing',
|
||||
)
|
||||
})
|
||||
|
||||
it('unwraps Kimi redirect URLs before storing source items', () => {
|
||||
expect(
|
||||
normalizeUrl('https://www.kimi.com/redirect?url=https%3A%2F%2Fexample.com%2Fsource%23ref'),
|
||||
|
||||
@@ -427,7 +427,6 @@ function extractQuestionText(payload: Record<string, unknown>): string {
|
||||
payload.question,
|
||||
payload.prompt,
|
||||
payload.content,
|
||||
payload.title,
|
||||
]
|
||||
|
||||
for (const candidate of candidates) {
|
||||
@@ -3288,6 +3287,7 @@ export const __kimiTestUtils = {
|
||||
buildSourceItem,
|
||||
classifyKimiSources,
|
||||
dedupeSourceItems,
|
||||
extractQuestionText,
|
||||
isKimiAnswerComplete,
|
||||
isKimiPromotionalAnswerNoise,
|
||||
mergeKimiSourceLinksIntoContentSnapshot,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { __qwenTestUtils } from './qwen'
|
||||
|
||||
const { extractQuestionText } = __qwenTestUtils
|
||||
|
||||
describe('qwen adapter helpers', () => {
|
||||
it('extracts question text from monitoring payload', () => {
|
||||
expect(extractQuestionText({ question_text: '幽灵门轨道长度定制' })).toBe('幽灵门轨道长度定制')
|
||||
})
|
||||
|
||||
it('does not use task title as monitoring question text', () => {
|
||||
expect(() => extractQuestionText({ title: '监控任务 · 通义千问' })).toThrow(
|
||||
'qwen_question_text_missing',
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -188,7 +188,6 @@ function extractQuestionText(payload: Record<string, unknown>): string {
|
||||
payload.question,
|
||||
payload.prompt,
|
||||
payload.content,
|
||||
payload.title,
|
||||
]
|
||||
|
||||
for (const candidate of candidates) {
|
||||
@@ -687,3 +686,7 @@ export const qwenAdapter: MonitorAdapter = {
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export const __qwenTestUtils = {
|
||||
extractQuestionText,
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { __wenxinTestUtils } from './wenxin'
|
||||
|
||||
const {
|
||||
buildSourceItem,
|
||||
extractQuestionText,
|
||||
htmlTableToMarkdown,
|
||||
isObservationComplete,
|
||||
normalizeUrl,
|
||||
@@ -12,6 +13,13 @@ const {
|
||||
} = __wenxinTestUtils
|
||||
|
||||
describe('wenxin adapter helpers', () => {
|
||||
it('does not use task title as monitoring question text', () => {
|
||||
expect(extractQuestionText({ question_text: '幽灵门轨道长度定制' })).toBe('幽灵门轨道长度定制')
|
||||
expect(() => extractQuestionText({ title: '监控任务 · 文心一言' })).toThrow(
|
||||
'wenxin_question_text_missing',
|
||||
)
|
||||
})
|
||||
|
||||
it('parses conversation stream major and message events', () => {
|
||||
const sseBody = [
|
||||
'event:major',
|
||||
|
||||
@@ -736,7 +736,6 @@ function extractQuestionText(payload: Record<string, unknown>): string {
|
||||
payload.question,
|
||||
payload.prompt,
|
||||
payload.content,
|
||||
payload.title,
|
||||
]
|
||||
|
||||
for (const candidate of candidates) {
|
||||
@@ -2555,6 +2554,7 @@ export const wenxinAdapter: MonitorAdapter = {
|
||||
|
||||
export const __wenxinTestUtils = {
|
||||
buildSourceItem,
|
||||
extractQuestionText,
|
||||
htmlTableToMarkdown,
|
||||
isObservationComplete,
|
||||
normalizeUrl,
|
||||
|
||||
@@ -41,6 +41,9 @@ describe('yuanbao adapter helpers', () => {
|
||||
|
||||
it('rejects browser and build diagnostics as monitoring questions', () => {
|
||||
expect(extractQuestionText({ question_text: '合肥全屋定制推荐' })).toBe('合肥全屋定制推荐')
|
||||
expect(() => extractQuestionText({ title: '监控任务 · 混元 / 元宝' })).toThrow(
|
||||
'yuanbao_question_text_missing',
|
||||
)
|
||||
expect(() =>
|
||||
extractQuestionText({
|
||||
question_text:
|
||||
|
||||
@@ -769,7 +769,6 @@ function extractQuestionText(payload: Record<string, unknown>): string {
|
||||
payload.question,
|
||||
payload.prompt,
|
||||
payload.content,
|
||||
payload.title,
|
||||
]
|
||||
|
||||
let rejectedDiagnostic = false
|
||||
|
||||
Reference in New Issue
Block a user