refactor(client): trust narrowed surface event markers

The in-operator narrows SessionEvent to events whose surfaceOp is required. Remove redundant undefined checks from both target Definitions; retain append-versus-replacement discrimination and shared prompt interpretation. This deletes dead conditions reported by the full type-aware CI lint gate without adding fallback behavior.

Validation: both Chat and Trajectory definition regression suites pass with the simplified predicates.
This commit is contained in:
Tianyi Cui committed 2026-09-07 11:09:40 +08:00
1 parent 044777fc2b
commit 6861ac7459
2 files changed
+2 -2

No files matched your search

@@ -66,7 +66,7 @@ export function systemMessageDefinition(inspect: SystemPromptInspector): Convers
kind: 'system-message',
target: 'chat',
match: event => event.type === 'system/message'
|| ('surfaceOp' in event && event.surfaceOp !== undefined && event.surfaceOp !== 'append')
|| ('surfaceOp' in event && event.surfaceOp !== 'append')
? { id: String(event.seq), role: 'start' }
: null,
start: (_context, match, reader) => {
@@ -34,7 +34,7 @@ function trajectorySystemMessageDefinition(inspect: SystemPromptInspector): Conv
kind: 'trajectory-system-message',
target: 'trajectory',
match: event => event.type === 'system/message'
|| ('surfaceOp' in event && event.surfaceOp !== undefined && event.surfaceOp !== 'append')
|| ('surfaceOp' in event && event.surfaceOp !== 'append')
? { id: String(event.seq), role: 'start' }
: null,
start: (_context, match, reader) => {