mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-14 04:01:35 +00:00
test(ci): stabilize attachment fixtures
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
import { SessionLogOffset } from '@deepseek-ai/dsh-session'
|
||||
import type { Context } from '@deepseek-ai/cordis'
|
||||
import type { ModelSelection as AgentModelSelection } from '@deepseek-ai/dsh-agent'
|
||||
import type { AdmittedPromptContentPart, AttachmentAdmissionPart } from '@deepseek-ai/dsh-attachment'
|
||||
import type {
|
||||
AdmittedPromptContentPart,
|
||||
AttachmentAdmissionPart,
|
||||
ImageAttachmentLimits,
|
||||
} from '@deepseek-ai/dsh-attachment'
|
||||
import type { SessionEvent, SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
|
||||
import {
|
||||
SessionPersistenceNotFoundError,
|
||||
@@ -94,6 +98,15 @@ export interface TestSessionRemoteDefaults {
|
||||
|
||||
const installed = new WeakMap<Context, SessionController>()
|
||||
|
||||
const TEST_IMAGE_LIMITS: ImageAttachmentLimits = Object.freeze({
|
||||
maxImageBytes: 5 * 1024 * 1024,
|
||||
maxImagesPerMessage: 20,
|
||||
maxMessageImageBytes: 100 * 1024 * 1024,
|
||||
maxImagePixels: 40_000_000,
|
||||
maxImageDimension: 2000,
|
||||
mediaTypes: Object.freeze(['image/png'] as const),
|
||||
})
|
||||
|
||||
/** Compact header-and-events point read a persistence double declares per session. */
|
||||
interface TestSessionInspection {
|
||||
readonly meta: SessionHeader
|
||||
@@ -239,6 +252,7 @@ function installControllers(
|
||||
}
|
||||
if (ctx.get('attachments') === undefined) {
|
||||
ctx.provide('attachments', {
|
||||
imageLimits: TEST_IMAGE_LIMITS,
|
||||
admitPromptContent: async (
|
||||
content: readonly AttachmentAdmissionPart[],
|
||||
): Promise<AdmittedPromptContentPart[]> => {
|
||||
|
||||
Reference in New Issue
Block a user