@shuind/dsh-codex-harness 0.1.37 → 0.1.39

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.
package/README.md CHANGED
@@ -15,13 +15,13 @@
15
15
  - **远程搜索与压缩**:OpenAI Responses 请求默认优先使用 hosted `web_search` 和 `/responses/compact`;失败时回退到 DSH 的本地实现。
16
16
  - **远程压缩用量**:`/responses/compact` 返回标准 `usage` 时,插件会把 `input_tokens`、缓存读写和 `output_tokens` 原样拆分为 DSH 的用量字段;不再把远程压缩伪造成 `0`。中转站缺失或返回不一致的 usage 时,插件不会编造数字。
17
17
  - **上下文容量**:在 Web 中设置 `1K`–`1000K` tokens,设置值作用于下一次请求。
18
- - **自动压缩阈值**:Codex preset 的自动压缩会读取最新请求持久化的有效上下文容量;例如设置 `400K` 时,默认 `80%` pressure threshold 是 `320K`,不会错误地按适配器默认 `262,144` 在约 `210K` 提前触发。
18
+ - **自动压缩阈值**:Codex preset 的自动压缩会读取最新请求持久化的有效上下文容量,并在 `95%` pressure threshold 触发;例如设置 `400K` 时阈值是 `380K`,不会错误地按适配器默认 `262,144` 在约 `210K` 提前触发。
19
19
  - **活动状态**:Codex 请求模型、接收模型回复或进行上下文压缩时,在 `Deep diving...` 右侧显示对应阶段和耗时,让长时间 Deep Diving 不再像卡住。
20
20
 
21
21
  ## 安装
22
22
 
23
23
  ```sh
24
- dsh plugin --profile web add @shuind/dsh-codex-harness@0.1.37
24
+ dsh plugin --profile web add @shuind/dsh-codex-harness@0.1.39
25
25
  ```
26
26
 
27
27
  重启 Web,创建新会话,在模式菜单中选择 **Codex 模式**。
@@ -124,9 +124,10 @@ order: 10
124
124
  开启后,Codex preset 会在系统提示词中注入以下协作要求:
125
125
 
126
126
  ```text
127
+ ## Working principles
128
+
127
129
  Ask, align, and clarify first. Gather enough context from the user, then align the approach to achieve the user's goal through the clearest, most effective path.
128
- Keep only the essential logic and core actions. There's no need to explain or test what was removed or why something wasn't done.
129
- Convey enough valuable information with as few words as possible. Stay focused on the end goal.
130
+ Keep only the essential logic and core actions. There's no need to explain or test what was removed or why something wasn't done, especially when writing documentation or communicating. Convey enough valuable information with as few words as possible.
130
131
  Solve problems by thinking from first principles and at a higher level.
131
132
  ```
132
133
 
package/lib/index.js CHANGED
@@ -1288,11 +1288,10 @@ const CODEX_BASE_PROMPT = String.raw`## General
1288
1288
  - Do not dump large files into the conversation; refer to their paths.
1289
1289
  - Use plain text with short sections only when they improve scanability.
1290
1290
  `;
1291
- const CODEX_COLLABORATION_PROMPT = String.raw`## Collaboration
1291
+ const CODEX_COLLABORATION_PROMPT = String.raw`## Working principles
1292
1292
 
1293
1293
  - Ask, align, and clarify first. Gather enough context from the user, then align the approach to achieve the user's goal through the clearest, most effective path.
1294
- - Keep only the essential logic and core actions. There's no need to explain or test what was removed or why something wasn't done.
1295
- - Convey enough valuable information with as few words as possible. Stay focused on the end goal.
1294
+ - Keep only the essential logic and core actions. There's no need to explain or test what was removed or why something wasn't done, especially when writing documentation or communicating. Convey enough valuable information with as few words as possible.
1296
1295
  - Solve problems by thinking from first principles and at a higher level.
1297
1296
  `;
1298
1297
  /** Put the agent persona first and omit the generic Harness identity opener. */
@@ -207,42 +207,41 @@ export function applyCodexRequestSettings(request, settings) {
207
207
  };
208
208
  }
209
209
  // The shipped persona owns the single Codex identity line, model, and working directory.
210
- const CODEX_BASE_PROMPT = String.raw `## General
211
-
212
- - When searching for text or files, prefer using rg or rg --files respectively because rg is much faster than alternatives like grep. If rg is not available, use the next best alternative.
213
-
214
- ## Editing constraints
215
-
216
- - Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
217
- - Add succinct code comments that explain non-obvious code. Do not add comments that merely narrate assignments or control flow.
218
- - You may be in a dirty git worktree. Never revert existing changes you did not make unless the user explicitly requests it. If unrelated files are changed, leave them alone.
219
-
220
- ## Planning
221
-
222
- - Use update_plan for work with multiple meaningful steps. Keep the plan current as the task progresses.
223
- - Do not use a plan for a trivial one-step request.
224
-
225
- ## dsh session
226
-
227
- - The user and you share one workspace. Inspect the repository and every applicable AGENTS.md before editing.
228
-
229
- ## Task execution
230
-
231
- - Keep the user informed with concise progress updates and lead with the result.
232
-
233
- ## Presenting your work
234
-
235
- - Be concise, direct, friendly, and actionable.
236
- - For substantial work, explain what changed and why, then briefly note how the work was verified and what comes next.
237
- - Do not dump large files into the conversation; refer to their paths.
238
- - Use plain text with short sections only when they improve scanability.
210
+ const CODEX_BASE_PROMPT = String.raw `## General
211
+
212
+ - When searching for text or files, prefer using rg or rg --files respectively because rg is much faster than alternatives like grep. If rg is not available, use the next best alternative.
213
+
214
+ ## Editing constraints
215
+
216
+ - Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
217
+ - Add succinct code comments that explain non-obvious code. Do not add comments that merely narrate assignments or control flow.
218
+ - You may be in a dirty git worktree. Never revert existing changes you did not make unless the user explicitly requests it. If unrelated files are changed, leave them alone.
219
+
220
+ ## Planning
221
+
222
+ - Use update_plan for work with multiple meaningful steps. Keep the plan current as the task progresses.
223
+ - Do not use a plan for a trivial one-step request.
224
+
225
+ ## dsh session
226
+
227
+ - The user and you share one workspace. Inspect the repository and every applicable AGENTS.md before editing.
228
+
229
+ ## Task execution
230
+
231
+ - Keep the user informed with concise progress updates and lead with the result.
232
+
233
+ ## Presenting your work
234
+
235
+ - Be concise, direct, friendly, and actionable.
236
+ - For substantial work, explain what changed and why, then briefly note how the work was verified and what comes next.
237
+ - Do not dump large files into the conversation; refer to their paths.
238
+ - Use plain text with short sections only when they improve scanability.
239
239
  `;
240
- const CODEX_COLLABORATION_PROMPT = String.raw `## Collaboration
241
-
242
- - Ask, align, and clarify first. Gather enough context from the user, then align the approach to achieve the user's goal through the clearest, most effective path.
243
- - Keep only the essential logic and core actions. There's no need to explain or test what was removed or why something wasn't done.
244
- - Convey enough valuable information with as few words as possible. Stay focused on the end goal.
245
- - Solve problems by thinking from first principles and at a higher level.
240
+ const CODEX_COLLABORATION_PROMPT = String.raw `## Working principles
241
+
242
+ - Ask, align, and clarify first. Gather enough context from the user, then align the approach to achieve the user's goal through the clearest, most effective path.
243
+ - Keep only the essential logic and core actions. There's no need to explain or test what was removed or why something wasn't done, especially when writing documentation or communicating. Convey enough valuable information with as few words as possible.
244
+ - Solve problems by thinking from first principles and at a higher level.
246
245
  `;
247
246
  /** Put the agent persona first and omit the generic Harness identity opener. */
248
247
  export function normalizeCodexPromptAssembly(assembly) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuind/dsh-codex-harness",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "A Codex harness with a streamlined system prompt for GPT models that do not fit DSH's native interface, while remaining compatible with the DSH plugin ecosystem.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -71,6 +71,8 @@
71
71
  config:
72
72
  - id: compaction-basic
73
73
  name: '@shuind/dsh-codex-harness/compaction'
74
+ config:
75
+ thresholdRatio: 0.95
74
76
 
75
77
  - id: command-compact
76
78
  name: '@deepseek-ai/dsh-command-compact'
@@ -71,6 +71,8 @@
71
71
  config:
72
72
  - id: compaction-basic
73
73
  name: '@shuind/dsh-codex-harness/compaction'
74
+ config:
75
+ thresholdRatio: 0.95
74
76
 
75
77
  - id: command-compact
76
78
  name: '@deepseek-ai/dsh-command-compact'