From 6ce915d3fce169f1833cb82e28c704b37ed674c5 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Mon, 14 Sep 2026 20:58:49 +0800 Subject: [PATCH] fix(session): keep the recorded-session marker check branch-free The per-file coverage gate measures `packages/*/*/src` at 100% branches; a short-circuiting `||` over the two lane markers leaves the second operand unexecuted under Vitest. Testing the marker list instead keeps the same default without an uncovered branch. --- packages/session/session-log-deepseek/src/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/session/session-log-deepseek/src/index.ts b/packages/session/session-log-deepseek/src/index.ts index 91b5df5c63..4b0aa15e4f 100644 --- a/packages/session/session-log-deepseek/src/index.ts +++ b/packages/session/session-log-deepseek/src/index.ts @@ -34,14 +34,18 @@ export const name = 'session-log-deepseek' /** Services required to resolve sessions and contribute the provider request field. */ export const inject = ['deepseekLlmApiExtensions', 'sessions'] +/** Environment markers that identify a recorded-Session lane. */ +const RECORDED_SESSION_LANE_MARKERS = ['VITEST', 'DSH_SNAPSHOT'] as const + /** * Recorded-Session lanes (`test`, `test:snapshot`, `test:web`, and the ACP, SDK, * and Web snapshot suites) boot shipped profiles and compare persisted request * fields and Session logs against recorded expectations, so they keep this * contribution off unless a composition sets `enabled: true`. A deployed - * process runs without either variable and contributes the field by default. + * process sets neither marker and contributes the field by default. */ -const RECORDED_SESSION_LANE = process.env.VITEST !== undefined || process.env.DSH_SNAPSHOT !== undefined +const RECORDED_SESSION_LANE = RECORDED_SESSION_LANE_MARKERS + .some(marker => process.env[marker] !== undefined) /** Session-log request contribution configuration. */ export interface Config {