Move Codex soul context to developer instructions#84331
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. by source inspection. The merge result shows raw workspace profile files appended to Codex developer instructions and message_tool_only turns falling back away from the forced message tool path. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Keep raw workspace files as turn reference context and solve SOUL priority with a narrow Codex bridge/config design, with explicit maintainer approval and redacted runtime request-shape proof. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection. The merge result shows raw workspace profile files appended to Codex developer instructions and message_tool_only turns falling back away from the forced message tool path. Is this the best way to solve the issue? No. The safer maintainable path is a narrow developer-level bridge/config decision that interprets lower-priority workspace context without promoting raw workspace files to developer policy. Label justifications:
Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a00e7d3898cf. |
6951dbe to
e6c6a56
Compare
e6c6a56 to
bd44cb9
Compare
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
* Move Codex soul context to developer instructions * Route Codex workspace context by lifetime * Refresh Codex prompt snapshots * Update prompt snapshot expectations * Fix Codex workspace context diagnostics
Summary
Verification
Token impact analysis
This is a meaningful win for long-running Codex-backed OpenClaw agents. Before this change, stable workspace identity context like
SOUL.mdandIDENTITY.mdwas appended to the Codex turn input every time the user sent a message. That meant a chat with an agent did not just carry one copy of the agent's soul; it accumulated another copy on every turn.After this change, the agent still receives that identity context, but it receives it through Codex developer instructions instead of repeated per-turn user input. That is the right shape for this data: it is stable, agent-shaping context that should be present for the session, not copied into the native conversation history over and over.
I measured the before and after behavior with real OpenClaw Codex-runtime prompt assembly at the OpenClaw -> Codex app-server boundary. The test setup used a synthetic
SOUL.mdof 1,000 tokens and a syntheticIDENTITY.mdof 500 tokens, counted withtiktokenusingo200k_base.turn/start.inputsaved per turnThe first turn is intentionally not much smaller from the model's perspective: the agent still needs to see its soul once. The win compounds after that. In the old behavior, every subsequent turn added another full copy of the stable profile files to the conversation. In the new behavior, those files stay in the instruction surface and do not keep accumulating in turn history.
For the measured
SOUL.md+IDENTITY.mdsetup, the stable identity block contributed about 1,548 repeated tokens each time it was appended to full turn context. That means the active duplicate-context savings scale linearly by turn:This also cleans up heartbeat behavior.
HEARTBEAT.mdis no longer inlined into ordinary turns, and heartbeat turns get a lightweight pointer telling the agent to read the file when it matters. So ordinary chat is no longer paying for heartbeat-specific context, and lightweight heartbeat mode avoids stuffing the heartbeat body directly into model input.The practical result is that Codex-backed OpenClaw sessions keep the same agent identity and behavior while dramatically reducing prompt bloat in long conversations. This should improve effective context-window headroom, reduce repeated input cost, and make long-running Telegram, Discord, cron, and heartbeat sessions age much more gracefully.