Skip to content

Commit ad0e1a0

Browse files
authored
test: show bootstrap context in prompt snapshots (#76302)
1 parent a1054fb commit ad0e1a0

6 files changed

Lines changed: 215 additions & 25 deletions

File tree

test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ These fixtures capture the default OpenAI/Codex happy path for prompt review:
88
- `messages.visibleReplies: "message_tool"`, which is the Codex-harness default for visible source replies.
99
- Telegram direct chat, Discord group chat, and a heartbeat turn with `heartbeat_respond` available.
1010

11-
The Markdown files show selected app-server thread/turn params plus a reconstructed model-bound prompt layer stack: Codex `gpt-5.5` model instructions from a pinned Codex model catalog fixture, Codex permission developer instructions for the happy-path yolo profile, OpenClaw developer instructions, user turn input, and references to the complete dynamic tool catalog.
11+
The Markdown files show selected app-server thread/turn params plus a reconstructed model-bound prompt layer stack: Codex `gpt-5.5` model instructions from a pinned Codex model catalog fixture, Codex permission developer instructions for the happy-path yolo profile, simulated OpenClaw workspace bootstrap config instructions, OpenClaw developer instructions, user turn input, and references to the complete dynamic tool catalog.
12+
13+
The workspace bootstrap simulation includes dummy `SOUL.md`, `TOOLS.md`, and `HEARTBEAT.md` contents so prompt reviewers can see how those OpenClaw project/user context files are forwarded to Codex. `AGENTS.md` is intentionally not repeated here because Codex loads it natively.
1214

1315
The tool catalog is pinned to the canonical happy-path OpenClaw tools so optional locally installed plugin tools do not create fixture churn.
1416

@@ -18,7 +20,7 @@ The Codex model prompt fixture is generated from the same Codex model catalog/ca
1820
pnpm prompt:snapshots:sync-codex-model
1921
```
2022

21-
These snapshots are still not a byte-for-byte raw OpenAI request capture. Codex-owned workspace context such as `AGENTS.md`, environment context, memories, app/plugin instructions, and future collaboration-mode instructions can be added inside the Codex runtime after OpenClaw sends thread and turn params.
23+
These snapshots are still not a byte-for-byte raw OpenAI request capture. Codex-owned native `AGENTS.md`, environment context, memories, app/plugin instructions, and future collaboration-mode instructions can be added inside the Codex runtime after OpenClaw sends thread and turn params.
2224

2325
Regenerate with:
2426

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

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Default happy path: the same Codex agent is mentioned in a Discord group/channel while Telegram can remain the user's primary direct interface.
88
- Group-visible output must be explicit through the message tool; the model is also told to mostly lurk unless directly addressed or clearly useful.
99
- This captures the OpenClaw-owned Codex app-server inputs and reconstructs the stable Codex model/permission layers from committed Codex prompt fixtures.
10+
- This also simulates workspace bootstrap files forwarded through Codex `config.instructions`: `SOUL.md`, `TOOLS.md`, and `HEARTBEAT.md`.
1011

1112
## Scenario Metadata
1213

@@ -19,6 +20,11 @@
1920
"model": "gpt-5.5",
2021
"modelProvider": "openai",
2122
"runtime": "codex_app_server",
23+
"simulatedWorkspaceBootstrapFiles": [
24+
"/tmp/openclaw-happy-path/workspace/SOUL.md",
25+
"/tmp/openclaw-happy-path/workspace/TOOLS.md",
26+
"/tmp/openclaw-happy-path/workspace/HEARTBEAT.md"
27+
],
2228
"sourceReplyDeliveryMode": "message_tool_only",
2329
"toolSnapshot": "codex-dynamic-tools.discord-group.json",
2430
"trigger": "user"
@@ -69,6 +75,9 @@
6975
{
7076
"approvalPolicy": "never",
7177
"approvalsReviewer": "user",
78+
"config": {
79+
"instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nIf SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>"
80+
},
7281
"cwd": "/tmp/openclaw-happy-path/workspace",
7382
"developerInstructions": "<see Reconstructed Model-Bound Prompt Layers>",
7483
"dynamicTools": [
@@ -103,6 +112,9 @@
103112
{
104113
"approvalPolicy": "never",
105114
"approvalsReviewer": "user",
115+
"config": {
116+
"instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nIf SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>"
117+
},
106118
"developerInstructions": "<see Reconstructed Model-Bound Prompt Layers>",
107119
"model": "gpt-5.5",
108120
"persistExtendedHistory": true,
@@ -136,7 +148,7 @@
136148

137149
## Reconstructed Model-Bound Prompt Layers
138150

139-
This is the deterministic model-bound layer stack OpenClaw can snapshot for the Codex happy path. It uses a pinned Codex `gpt-5.5` prompt fixture generated from Codex's model catalog/cache shape, then adds the Codex permission developer text, OpenClaw developer instructions, turn input, and the OpenClaw dynamic tool catalog. Codex can still add runtime-owned context such as workspace `AGENTS.md`, environment context, memories, app/plugin instructions, and future collaboration-mode instructions inside the Codex runtime.
151+
This is the deterministic model-bound layer stack OpenClaw can snapshot for the Codex happy path. It uses a pinned Codex `gpt-5.5` prompt fixture generated from Codex's model catalog/cache shape, then adds the Codex permission developer text, simulated OpenClaw workspace bootstrap config instructions, OpenClaw developer instructions, turn input, and the OpenClaw dynamic tool catalog. Codex can still add runtime-owned context such as native workspace `AGENTS.md`, environment context, memories, app/plugin instructions, and future collaboration-mode instructions inside the Codex runtime.
140152

141153
### Layer Metadata
142154

@@ -161,9 +173,10 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
161173
},
162174
"limitations": [
163175
"This is a reconstructed prompt-layer snapshot, not a byte-for-byte raw OpenAI request captured from Codex core.",
164-
"Codex-owned workspace and app context is listed as a runtime-owned gap until Codex exposes a rendered-prompt inspection API."
176+
"Codex-owned workspace AGENTS.md, environment context, memories, app/plugin instructions, and provider tool serialization are still runtime-owned gaps until Codex exposes a rendered-prompt inspection API."
165177
],
166178
"openClawRuntime": {
179+
"configInstructionsFrom": "extensions/codex app-server thread/start config.instructions",
167180
"developerInstructionsFrom": "extensions/codex app-server thread/start developerInstructions",
168181
"dynamicToolsFrom": "codex-dynamic-tools.discord-group.json",
169182
"userInputFrom": "extensions/codex app-server turn/start input"
@@ -183,6 +196,10 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
183196
"chars": 307,
184197
"roughTokens": 77
185198
},
199+
"codexWorkspaceBootstrapConfigInstructions": {
200+
"chars": 632,
201+
"roughTokens": 158
202+
},
186203
"dynamicToolsJson": {
187204
"chars": 50058,
188205
"roughTokens": 12515
@@ -192,12 +209,12 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
192209
"roughTokens": 2151
193210
},
194211
"totalTextOnly": {
195-
"chars": 31122,
196-
"roughTokens": 7781
212+
"chars": 31756,
213+
"roughTokens": 7939
197214
},
198215
"totalWithDynamicToolsJson": {
199-
"chars": 81182,
200-
"roughTokens": 20296
216+
"chars": 81816,
217+
"roughTokens": 20454
201218
},
202219
"userInputText": {
203220
"chars": 870,
@@ -373,6 +390,29 @@ Filesystem sandboxing defines which files can be read or written. `sandbox_mode`
373390
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
374391
```
375392

393+
### User: Codex Config Instructions (OpenClaw Workspace Bootstrap Context)
394+
395+
```text
396+
OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.
397+
398+
# Project Context
399+
400+
The following project context files have been loaded:
401+
If SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.
402+
403+
## /tmp/openclaw-happy-path/workspace/SOUL.md
404+
405+
<SOUL.md contents will be here>
406+
407+
## /tmp/openclaw-happy-path/workspace/TOOLS.md
408+
409+
<TOOLS.md contents will be here>
410+
411+
## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md
412+
413+
<HEARTBEAT.md contents will be here>
414+
```
415+
376416
### Developer: OpenClaw Runtime Instructions
377417

378418
````text

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

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Default happy path: OpenAI model through the Codex harness/runtime, Telegram direct conversation, and message-tool-only visible replies.
88
- A quiet turn is represented by not calling `message(action=send)`; the normal final assistant text is private to OpenClaw/Codex.
99
- This captures the OpenClaw-owned Codex app-server inputs and reconstructs the stable Codex model/permission layers from committed Codex prompt fixtures.
10+
- This also simulates workspace bootstrap files forwarded through Codex `config.instructions`: `SOUL.md`, `TOOLS.md`, and `HEARTBEAT.md`.
1011

1112
## Scenario Metadata
1213

@@ -19,6 +20,11 @@
1920
"model": "gpt-5.5",
2021
"modelProvider": "openai",
2122
"runtime": "codex_app_server",
23+
"simulatedWorkspaceBootstrapFiles": [
24+
"/tmp/openclaw-happy-path/workspace/SOUL.md",
25+
"/tmp/openclaw-happy-path/workspace/TOOLS.md",
26+
"/tmp/openclaw-happy-path/workspace/HEARTBEAT.md"
27+
],
2228
"sourceReplyDeliveryMode": "message_tool_only",
2329
"toolSnapshot": "codex-dynamic-tools.telegram-direct.json",
2430
"trigger": "user"
@@ -69,6 +75,9 @@
6975
{
7076
"approvalPolicy": "never",
7177
"approvalsReviewer": "user",
78+
"config": {
79+
"instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nIf SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>"
80+
},
7281
"cwd": "/tmp/openclaw-happy-path/workspace",
7382
"developerInstructions": "<see Reconstructed Model-Bound Prompt Layers>",
7483
"dynamicTools": [
@@ -103,6 +112,9 @@
103112
{
104113
"approvalPolicy": "never",
105114
"approvalsReviewer": "user",
115+
"config": {
116+
"instructions": "OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.\n\n# Project Context\n\nThe following project context files have been loaded:\nIf SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.\n\n## /tmp/openclaw-happy-path/workspace/SOUL.md\n\n<SOUL.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/TOOLS.md\n\n<TOOLS.md contents will be here>\n\n## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md\n\n<HEARTBEAT.md contents will be here>"
117+
},
106118
"developerInstructions": "<see Reconstructed Model-Bound Prompt Layers>",
107119
"model": "gpt-5.5",
108120
"persistExtendedHistory": true,
@@ -136,7 +148,7 @@
136148

137149
## Reconstructed Model-Bound Prompt Layers
138150

139-
This is the deterministic model-bound layer stack OpenClaw can snapshot for the Codex happy path. It uses a pinned Codex `gpt-5.5` prompt fixture generated from Codex's model catalog/cache shape, then adds the Codex permission developer text, OpenClaw developer instructions, turn input, and the OpenClaw dynamic tool catalog. Codex can still add runtime-owned context such as workspace `AGENTS.md`, environment context, memories, app/plugin instructions, and future collaboration-mode instructions inside the Codex runtime.
151+
This is the deterministic model-bound layer stack OpenClaw can snapshot for the Codex happy path. It uses a pinned Codex `gpt-5.5` prompt fixture generated from Codex's model catalog/cache shape, then adds the Codex permission developer text, simulated OpenClaw workspace bootstrap config instructions, OpenClaw developer instructions, turn input, and the OpenClaw dynamic tool catalog. Codex can still add runtime-owned context such as native workspace `AGENTS.md`, environment context, memories, app/plugin instructions, and future collaboration-mode instructions inside the Codex runtime.
140152

141153
### Layer Metadata
142154

@@ -161,9 +173,10 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
161173
},
162174
"limitations": [
163175
"This is a reconstructed prompt-layer snapshot, not a byte-for-byte raw OpenAI request captured from Codex core.",
164-
"Codex-owned workspace and app context is listed as a runtime-owned gap until Codex exposes a rendered-prompt inspection API."
176+
"Codex-owned workspace AGENTS.md, environment context, memories, app/plugin instructions, and provider tool serialization are still runtime-owned gaps until Codex exposes a rendered-prompt inspection API."
165177
],
166178
"openClawRuntime": {
179+
"configInstructionsFrom": "extensions/codex app-server thread/start config.instructions",
167180
"developerInstructionsFrom": "extensions/codex app-server thread/start developerInstructions",
168181
"dynamicToolsFrom": "codex-dynamic-tools.telegram-direct.json",
169182
"userInputFrom": "extensions/codex app-server turn/start input"
@@ -183,6 +196,10 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
183196
"chars": 307,
184197
"roughTokens": 77
185198
},
199+
"codexWorkspaceBootstrapConfigInstructions": {
200+
"chars": 632,
201+
"roughTokens": 158
202+
},
186203
"dynamicToolsJson": {
187204
"chars": 49749,
188205
"roughTokens": 12438
@@ -192,12 +209,12 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
192209
"roughTokens": 1934
193210
},
194211
"totalTextOnly": {
195-
"chars": 29751,
196-
"roughTokens": 7438
212+
"chars": 30385,
213+
"roughTokens": 7597
197214
},
198215
"totalWithDynamicToolsJson": {
199-
"chars": 79502,
200-
"roughTokens": 19876
216+
"chars": 80136,
217+
"roughTokens": 20034
201218
},
202219
"userInputText": {
203220
"chars": 370,
@@ -373,6 +390,29 @@ Filesystem sandboxing defines which files can be read or written. `sandbox_mode`
373390
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
374391
```
375392

393+
### User: Codex Config Instructions (OpenClaw Workspace Bootstrap Context)
394+
395+
```text
396+
OpenClaw loaded these user-editable workspace files. Treat them as project/user context. Codex loads AGENTS.md natively, so AGENTS.md is not repeated here.
397+
398+
# Project Context
399+
400+
The following project context files have been loaded:
401+
If SOUL.md is present, embody its persona and tone. Avoid stiff, generic replies; follow its guidance unless higher-priority instructions override it.
402+
403+
## /tmp/openclaw-happy-path/workspace/SOUL.md
404+
405+
<SOUL.md contents will be here>
406+
407+
## /tmp/openclaw-happy-path/workspace/TOOLS.md
408+
409+
<TOOLS.md contents will be here>
410+
411+
## /tmp/openclaw-happy-path/workspace/HEARTBEAT.md
412+
413+
<HEARTBEAT.md contents will be here>
414+
```
415+
376416
### Developer: OpenClaw Runtime Instructions
377417

378418
````text

0 commit comments

Comments
 (0)