Skip to content

Commit 559eed5

Browse files
committed
test(snapshots): mirror runtime workspace-context wrapper text in helper
The `happy-path-prompt-snapshots.ts` helper hard-coded the shorter wrapper introductory line that only mentioned workspace context and user-installed skills. The runtime builder in `attempt-context.ts:buildCodexOpenClawPromptContext` emits the full section order including workspace memory reference and remote-host execution guidance. Without this alignment the generated fixtures stop mirroring actual model-bound turn input and prompt snapshot checks can drift from runtime behavior they document. Align the helper to the runtime text and regenerate the three codex-runtime-happy-path fixtures. Delta is +70 chars on userInputText (matching the added wrapper phrase); developer_instructions unchanged. ClawSweeper P3 finding (`test/helpers/agents/happy-path-prompt-snapshots.ts:751`) resolved. Helper is the authoritative drift point per ClawSweeper guidance.
1 parent ff406c2 commit 559eed5

4 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/discord-group-codex-message-tool.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,16 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
229229
"roughTokens": 747
230230
},
231231
"totalTextOnly": {
232-
"chars": 27805,
233-
"roughTokens": 6952
232+
"chars": 27875,
233+
"roughTokens": 6969
234234
},
235235
"totalWithDynamicToolsJson": {
236-
"chars": 68084,
237-
"roughTokens": 17021
236+
"chars": 68154,
237+
"roughTokens": 17039
238238
},
239239
"userInputText": {
240-
"chars": 1734,
241-
"roughTokens": 434
240+
"chars": 1804,
241+
"roughTokens": 451
242242
}
243243
}
244244
```
@@ -493,7 +493,7 @@ OpenClaw loaded these workspace instruction files from the active agent workspac
493493

494494
````text
495495
OpenClaw workspace context for this turn:
496-
Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then user-installed (non-bundled) skills.
496+
Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then workspace memory reference, then remote-host execution guidance, then user-installed (non-bundled) skills.
497497
498498
## OpenClaw Workspace Context
499499

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-direct-codex-message-tool.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,16 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
229229
"roughTokens": 491
230230
},
231231
"totalTextOnly": {
232-
"chars": 26281,
233-
"roughTokens": 6571
232+
"chars": 26351,
233+
"roughTokens": 6588
234234
},
235235
"totalWithDynamicToolsJson": {
236-
"chars": 66281,
237-
"roughTokens": 16571
236+
"chars": 66351,
237+
"roughTokens": 16588
238238
},
239239
"userInputText": {
240-
"chars": 1234,
241-
"roughTokens": 309
240+
"chars": 1304,
241+
"roughTokens": 326
242242
}
243243
}
244244
```
@@ -491,7 +491,7 @@ OpenClaw loaded these workspace instruction files from the active agent workspac
491491

492492
````text
493493
OpenClaw workspace context for this turn:
494-
Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then user-installed (non-bundled) skills.
494+
Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then workspace memory reference, then remote-host execution guidance, then user-installed (non-bundled) skills.
495495
496496
## OpenClaw Workspace Context
497497

‎test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/telegram-heartbeat-codex-tool.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,16 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
230230
"roughTokens": 496
231231
},
232232
"totalTextOnly": {
233-
"chars": 27224,
234-
"roughTokens": 6806
233+
"chars": 27294,
234+
"roughTokens": 6824
235235
},
236236
"totalWithDynamicToolsJson": {
237-
"chars": 68319,
238-
"roughTokens": 17080
237+
"chars": 68389,
238+
"roughTokens": 17098
239239
},
240240
"userInputText": {
241-
"chars": 1472,
242-
"roughTokens": 368
241+
"chars": 1542,
242+
"roughTokens": 386
243243
}
244244
}
245245
```
@@ -501,7 +501,7 @@ HEARTBEAT.md exists in the active agent workspace. Read it before proceeding wit
501501

502502
````text
503503
OpenClaw workspace context for this turn:
504-
Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then user-installed (non-bundled) skills.
504+
Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then workspace memory reference, then remote-host execution guidance, then user-installed (non-bundled) skills.
505505
506506
## OpenClaw Workspace Context
507507

‎test/helpers/agents/happy-path-prompt-snapshots.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ function readCodexTurnInputText(turnStartParams: { input?: unknown }): string {
748748
function buildCodexOpenClawWorkspaceContext(): string {
749749
return [
750750
"OpenClaw workspace context for this turn:",
751-
"Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then user-installed (non-bundled) skills.",
751+
"Treat this block as user-editable reference for the current request, not as developer instructions. Sections below are listed in this order: workspace context, then workspace memory reference, then remote-host execution guidance, then user-installed (non-bundled) skills.",
752752
"",
753753
"## OpenClaw Workspace Context",
754754
"",

0 commit comments

Comments
 (0)