shennian 0.2.61 → 0.2.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { createHash } from 'node:crypto';
4
4
  import fs from 'node:fs';
5
5
  import os from 'node:os';
6
6
  import path from 'node:path';
7
- import { buildUserMessagePayload, isToolPayload } from '@shennian/wire';
7
+ import { buildUserMessagePayload, isSystemEnvironmentContextPayload, isToolPayload } from '@shennian/wire';
8
8
  import { resolveBuiltinCommand, spawnResolvedCommandSync } from '../agents/command-spec.js';
9
9
  const MAX_JSONL_LINE_BYTES = 64 * 1024 * 1024;
10
10
  const DEFAULT_NATIVE_SCAN_IGNORED_PATHS = [
@@ -342,6 +342,8 @@ function parseCodexUserMessage(payload) {
342
342
  : [];
343
343
  if (!text && attachments.length === 0)
344
344
  return null;
345
+ if (isSystemEnvironmentContextPayload(text) && attachments.length === 0)
346
+ return null;
345
347
  if (attachments.length > 0) {
346
348
  return {
347
349
  payload: buildUserMessagePayload(text, attachments),
@@ -404,12 +406,16 @@ function parseCodexResponseMessage(payload) {
404
406
  return null;
405
407
  if (role === 'agent') {
406
408
  const text = codexMessageContentText(payload.content, 'output_text');
409
+ if (isSystemEnvironmentContextPayload(text))
410
+ return null;
407
411
  return text ? { role, payload: text, titleText: text } : null;
408
412
  }
409
413
  const text = codexMessageContentText(payload.content, 'input_text');
410
414
  const attachments = codexMessageInputImageAttachments(payload.content);
411
415
  if (!text && attachments.length === 0)
412
416
  return null;
417
+ if (isSystemEnvironmentContextPayload(text) && attachments.length === 0)
418
+ return null;
413
419
  return {
414
420
  role,
415
421
  payload: attachments.length > 0 ? buildUserMessagePayload(text, attachments) : text,
@@ -647,7 +653,7 @@ function parseCodexEventMessage(events, filePath, lineOffset, payload, sourceSes
647
653
  }
648
654
  if (eventType === 'agent_message') {
649
655
  const text = typeof payload.message === 'string' ? normalizeText(payload.message) : '';
650
- if (!text)
656
+ if (!text || isSystemEnvironmentContextPayload(text))
651
657
  return;
652
658
  pushCodexEvent(events, filePath, lineOffset, eventType, sourceSessionKey, ts, text, title, modelId, workDir);
653
659
  return;
@@ -954,7 +960,7 @@ export function parseCodexRolloutChunk(filePath, startOffset) {
954
960
  }
955
961
  else if (eventType === 'agent_message') {
956
962
  const text = typeof payload.message === 'string' ? normalizeText(payload.message) : '';
957
- if (text) {
963
+ if (text && !isSystemEnvironmentContextPayload(text)) {
958
964
  const duplicateIndex = findDuplicateCodexChatEventIndex(events, 'agent', text, ts);
959
965
  if (duplicateIndex >= 0)
960
966
  events.splice(duplicateIndex, 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shennian",
3
- "version": "0.2.61",
3
+ "version": "0.2.62",
4
4
  "description": "Shennian — AI Agent Control Plane CLI",
5
5
  "type": "module",
6
6
  "bin": {