Repository navigation
fix(agents): observe native provider prompt egress - #119219
Conversation
|
Codex review: found issues before merge. Reviewed August 4, 2026, 10:32 AM ET / 14:32 UTC. ClawSweeper reviewWhat this changesAdds bounded, run-scoped observations that compare assembled agent instructions with the final OpenAI Responses SDK, native WebSocket, or native SSE request without recording prompt text. Merge readinessKeep this maintainer-owned PR open: its transport-edge observer is sound on the inspected SDK and native paths, but the PR description still overstates its no-retention guarantee and the required direct Codex-source contract check is unavailable. Priority: P2 Review scores
Verification
How this fits togetherThe embedded agent runner assembles system instructions and invokes a provider stream function. OpenAI Responses transports turn that context into SDK, WebSocket, or SSE requests, while the runner records bounded egress metadata in trajectory evidence for QA. flowchart LR
A[Embedded agent context] --> B[Provider stream wrapper]
B --> C[OpenAI Responses transport]
C --> D{SDK or native egress}
D --> E[Bounded prompt observation]
E --> F[Trajectory event evidence]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The implementation records bounded metadata, but the PR’s public privacy claim omits existing diagnostic prompt retention. PR surfaceSource +109, Tests +776, Other +44. Total +929 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the transport-egress observer, but describe its guarantee as applying only to bounded provider.prompt.observed records and explicitly exclude diagnostic trajectory exports that retain compiled prompts. Do we have a high-confidence way to reproduce the issue? Not applicable as a user bug reproduction: this PR adds internal verification. Source inspection does directly show that diagnostic trajectory context retains the prompt text excluded by the scenario. Is this the best way to solve the issue? Unclear: transport-edge observation is the correct owner boundary on inspected paths, but the PR body is too broad and direct Codex protocol-source verification is unavailable. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 52954a1fa8f4. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
* origin/main: chore(tui): add Gateway boundary PTY coverage (#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121)
|
ClawSweeper before-merge items are resolved at
No implementation change was required for the retained diagnostic trajectory path; that path is intentionally outside this bounded QA privacy contract. |
|
Merged via squash.
|
* origin/main: fix(agents): protect private memory in shared chats (#119198) perf(cli): skip absent gateway workspace dotenv (#119227) fix(agents): observe native provider prompt egress (#119219) fix(feishu): report bot identity retry failures (#102185) fix(memory): load configured providers for CLI search (#119186) fix(discord): count retained speech bytes test(discord): isolate exact speech overflow test(discord): cover exact speech overflow fix(discord): bound realtime exact speech
* origin/main: fix(agents): protect private memory in shared chats (#119198) perf(cli): skip absent gateway workspace dotenv (#119227) fix(agents): observe native provider prompt egress (#119219) fix(feishu): report bot identity retry failures (#102185) fix(memory): load configured providers for CLI search (#119186) fix(discord): count retained speech bytes test(discord): isolate exact speech overflow test(discord): cover exact speech overflow fix(discord): bound realtime exact speech
* fix(agents): observe final provider prompt egress * fix(agents): observe native provider prompt egress * test(agents): type native prompt observer models
* origin/main: fix(agents): protect private memory in shared chats (openclaw#119198) perf(cli): skip absent gateway workspace dotenv (openclaw#119227) fix(agents): observe native provider prompt egress (openclaw#119219) fix(feishu): report bot identity retry failures (openclaw#102185) fix(memory): load configured providers for CLI search (openclaw#119186) fix(discord): count retained speech bytes test(discord): isolate exact speech overflow test(discord): cover exact speech overflow fix(discord): bound realtime exact speech
What Problem This Solves
OpenClaw could verify the assembled instruction profile before provider dispatch, but the original observation seam covered only the OpenAI Responses SDK path. Native Codex WebSocket and SSE transports could bypass that evidence boundary, and the PR description overstated which persisted artifacts were prompt-free.
Root Cause And Fix
The OpenAI Responses transport now owns one private, Symbol-based prompt observer that is carried through the existing request options and invoked immediately before each application-level dispatch:
createsendfetchEach observation records only the egress kind, payload variant, prompt source, expected and observed character counts, and an exact-match boolean. It never records prompt text, hashes, or snippets.
The QA scenario reads only current-run
provider.prompt.observedrecords and proves the final provider-bound prompt matches the assembled instructions. Diagnostic trajectory support bundles still retaincontext.compiledprompt material by design; they are explicitly excluded from this no-retention assertion.User Impact
There is no user-facing behavior or public contract change. Maintainers gain exact provider-egress evidence across SDK and native Codex routes without adding prompt content to the bounded observation records.
Evidence
a17e66d0021b6c762b1ba2900a681c8b800eeb1d.105/105passed.11/11passed.https://github.com/openclaw/openclaw/actions/runs/30918797644.openai/gpt-5.4 --fastproof:1/1passed.3responses-sdk/initialobservations,3exact matches,0mismatches, and28,103expected/observed characters each. Native WebSocket and SSE routes remain covered by focused transport regressions.34-byte artifact;diagnosticTrajectoryPromptRetentionExcludedwastrue..artifacts/qa-e2e/no-meta-live-a17e66d-final/qa-suite-summary.json.artifacts/qa-e2e/no-meta-live-a17e66d-final/qa-evidence.json.artifacts/qa-e2e/no-meta-live-a17e66d-final/qa-suite-report.mdDirect dependency contract check:
bb1af235ea2822d7a40f75ef52e4d6a2cde84da2.codex-rs/codex-api/src/common.rs:251-329.codex-rs/core/src/client.rs:837-924.codex-rs/core/src/client.rs:1437-1459.codex-rs/core/src/client.rs:1640-1668.Production delta is
+151/-42(net+109). Tests and QA add+837/-17(net+820). The positive production delta is the private cross-transport observation boundary and removal of duplicate SDK-only observation logic.No changelog entry is needed because this changes internal verification only.