perf(session-controller): exclude the shared image limits from session summaries

`imageLimits` is a boot constant every Session shares: the unit stores no
per-Session state (`stateSchema: z.null()`, `apply: state => state`) and its
view returns `ctx.attachments.imageLimits`. A list row therefore repeated one
host-wide capability fact on every row. It now carries the summary mark like
the three log-derived units, so a summary read skips it while an opened Session
still receives it through `session/follow`, the control baseline, and
`session.projections`.

No other logic changes: the registration, its schema, its constant view, and
the host-side prompt validation keep reading `ctx.attachments` directly.
This commit is contained in:
imccyu committed 2026-10-18 23:04:29 +08:00
1 parent ef446fc85f
commit 8e2dd67de8
13 files changed
+44 -37

No files matched your search

@@ -98,6 +98,7 @@ export class ApiSessionList {
wire: {
viewSchema: imageLimitsSchema,
view: () => attachmentCtx.attachments.imageLimits,
summary: false,
},
stateVersion: 1,
})
+7 -3
View File
@@ -8,7 +8,7 @@ import type { Branded } from '@deepseek-ai/dsh-brand'
import type { LlmAttemptId, MessageId } from '@deepseek-ai/dsh-llm/brand'
import type { TextBlock } from '@deepseek-ai/dsh-llm'
import type { SessionId, SessionSeqCursor } from '@deepseek-ai/dsh-session/types'
import type { SessionProjectionMap } from '@deepseek-ai/dsh-session-projection/types'
import type { SessionProjectionMap, SessionProjectionSummaryExcluded } from '@deepseek-ai/dsh-session-projection/types'
import type { Principal } from '@deepseek-ai/dsh-typert-protocol'
import type { JsonValue } from '@deepseek-ai/dsh-util-values'
import type { WorkspaceId } from '@deepseek-ai/dsh-workspace/types'
@@ -25,8 +25,12 @@ declare module '@deepseek-ai/dsh-session-projection/types' {
interface SessionProjectionMap {
/** Persisted facts used to summarize a Session without activating it. */
sessionListMetadata: SessionListMetadata
/** Image-intake limits enforced by the Session prompt endpoint. */
imageLimits: ImageAttachmentLimits
/**
* Image-intake limits enforced by the Session prompt endpoint. Boot
* constant, excluded from Session summary payloads: every Session shares
* it, so a list row would repeat one host-wide fact.
*/
imageLimits: SessionProjectionSummaryExcluded<ImageAttachmentLimits>
/** Durable model selection already used and selected for the next request. */
modelSelection: ModelSelectionProjection
}