Repository navigation
feat(control-ui): show plugin steering notes in chat - #173456
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
6c6861d to
5335b00
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR shows recorded plugin steering as expandable, timestamped guidance notices in Control UI chat. Example: Advisor records “Check the error handling before continuing.” during a run.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for landing: it provides useful, distinct Control UI functionality, and review found no actionable introduced defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe plugin host records hidden steering input; Gateway display projections selectively expose guidance to authorized Control UI recipients, whose chat renderer presents a native notice. flowchart LR
A[Plugin guidance] --> B[Existing steering owner]
B --> C[Hidden transcript row]
C --> D[Gateway display projection]
D --> E[Current session authorization]
E --> F[Control UI notice]
Technical reviewBest possible solution: Land the existing display projection while preserving hidden canonical input, current session authorization, and neutral guidance wording. Do we have a high-confidence way to reproduce the issue? This is a feature addition; inspected before/after captures demonstrate the formerly invisible guidance and its new notice presentation. Is this the best way to solve the issue? The implementation extends existing steering, transcript projection, authorization, and notice owners without adding another delivery or persistence owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 20c52468c295. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +159, Tests +950, Docs +13. Total +1122 across 33 files. Added test files: 3. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 15, 2026, 6:29 PM ET / 22:29 UTC (Revision 5). |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
…tput (#173460) ## What Problem This Solves When a plugin's next-turn injection is consumed into a prompt (for example Advisor's fallback when the run already ended), the exact model-facing prompt is recorded on the next user message as private `__openclaw.modelPromptProjection` metadata. The shared display sanitizer did not remove that field, so `chat.history`, live `session.message` events and transcript deltas sent the full hidden injection text to every display client. That includes guidance that is deliberately `display: false`. Found by a raw-evidence proof of Advisor steering: the fallback note's complete text appeared in `__openclaw.modelPromptProjection.text` in both history and live display output. ## Fix The shared display sanitizer (`src/gateway/chat-display-projection.sanitize.ts`) now drops `__openclaw.modelPromptProjection` from display copies for every client. The field is private model-replay state (see `docs/reference/database-schemas/layout.md`), not display data. Canonical persistence and runtime replay are unchanged. ## User Impact Hidden plugin or system prompt context no longer appears in the metadata of chat history or live events. A search found no client that reads this field (Control UI, Android, iOS/macOS codecs, TUI, MCP relay, public sharing), so nothing visible changes. ## Evidence - Three regressions (history, live `session.message`, transcript delta) fail on `main` with the full injected text present, and pass with the fix. - Focused privacy sweep: 119 tests passed. - Split out of #173456 as a standalone repair; the commit is identical. Co-authored-by: Ayaan Zaidi <[email protected]>
…n-steer-notice # Conflicts: # src/plugins/host-hook-steering.ts
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Landed as aaed6bf. Plugin steering guidance (Advisor first) now shows in the Control UI as a collapsed, timestamped "{plugin} guidance" notice that does not start a turn; the stored row stays hidden for every other client and channel, and viewers who lose session access receive nothing. Proof: projection, authority-revocation and UI tests; production-bundle E2E in light/dark desktop/mobile; screenshots in the body; exact-head CI green. |
…tput (openclaw#173460) ## What Problem This Solves When a plugin's next-turn injection is consumed into a prompt (for example Advisor's fallback when the run already ended), the exact model-facing prompt is recorded on the next user message as private `__openclaw.modelPromptProjection` metadata. The shared display sanitizer did not remove that field, so `chat.history`, live `session.message` events and transcript deltas sent the full hidden injection text to every display client. That includes guidance that is deliberately `display: false`. Found by a raw-evidence proof of Advisor steering: the fallback note's complete text appeared in `__openclaw.modelPromptProjection.text` in both history and live display output. ## Fix The shared display sanitizer (`src/gateway/chat-display-projection.sanitize.ts`) now drops `__openclaw.modelPromptProjection` from display copies for every client. The field is private model-replay state (see `docs/reference/database-schemas/layout.md`), not display data. Canonical persistence and runtime replay are unchanged. ## User Impact Hidden plugin or system prompt context no longer appears in the metadata of chat history or live events. A search found no client that reads this field (Control UI, Android, iOS/macOS codecs, TUI, MCP relay, public sharing), so nothing visible changes. ## Evidence - Three regressions (history, live `session.message`, transcript delta) fail on `main` with the full injected text present, and pass with the fix. - Focused privacy sweep: 119 tests passed. - Split out of openclaw#173456 as a standalone repair; the commit is identical. Co-authored-by: Ayaan Zaidi <[email protected]>
Stacked on openclaw#173460 (private model-prompt display isolation). ## What Problem This Solves Plugin steering was invisible in Control UI chat, while next-turn fallback guidance could leak to display clients inside private prompt metadata. ## User Impact Control UI users can expand a timestamped **Advisor guidance** notice to inspect guidance without creating another user turn. Other plugins use the same presentation with their own display name. Channels, native apps, and the TUI do not receive these notices. Private `modelPromptProjection` metadata is now omitted from all display reads and message events; the user's visible message and the model's recorded input remain unchanged. No protocol schema, migration, or channel-delivery change is required. ## Why This Change Was Made The notice says **Plugin name guidance**, not that steering succeeded. Canonical persistence can precede native submission, and no durable row field proves acceptance: `extensions/codex/src/app-server/run-attempt-active-turn.ts:443-452` persists before `attempt-steering.ts:292-378` can reject dispatch. Attribution remains useful without making an unsupported delivery claim. No new persistence field was added. - Keep persisted steering rows `display: false`. Only the exact authenticated Control UI client ID enables an internal display projection in history/startup, incremental reads, exact-message hydration, and live delivery. Live recipient filtering precedes shared serialization caches. - Reuse the native collapsed, non-turn-starting notice. The host records plugin attribution; optional SDK `displayText` separates operator-facing guidance from model-only instructions. Advisor supplies the finding without its delivery prefix. Existing notes without display text retain their original text rather than guessing at plugin-specific prose. - Strip `modelPromptProjection` at the shared display sanitizer. It is private replay state, and the consumer audit found no UI, native-app, TUI, SDK, or extension reader of that field. Canonical persistence and runtime replay are untouched. - Next-turn guidance is intentionally not rendered as another notice in this change; only its accidental metadata exposure is fixed. - Expanded notices switch from **Show content** to **Hide content** and center their body with the native notice header. Steering notices preserve the existing mid-run notice grouping contract: like injected CLI context and background-task notices, they separate visible tool groups without starting another semantic turn. ## Evidence Current-session authority is exercised through the real `chat.history` handler and live transcript broadcaster: revoking a shared-session viewer after asynchronous history/transcript preparation prevents the response or event from exposing guidance, while the authorized owner still receives the live event. | Real Gateway path | Before revocation | Revoked after awaited preparation | | --- | --- | --- | | [`chat.history`](https://github.com/openclaw/openclaw/blob/6402a9d8627c75d6075f759d89bf663db01c8880/src/gateway/server-methods/chat-plugin-steering-authority.test.ts#L17) | Non-admin Control UI viewer receives the guidance. | Response is `INVALID_REQUEST` with no message payload or guidance text. | | [`session.message`](https://github.com/openclaw/openclaw/blob/6402a9d8627c75d6075f759d89bf663db01c8880/src/gateway/server-broadcast.serialization.test.ts#L169) | Owner and non-admin Control UI viewer receive guidance. | Viewer socket receives nothing; the still-authorized owner receives the guidance. | - Focused Gateway/plugin/Advisor/UI suites: **223 passed** across 11 files. - Final display/privacy regression sweep: **119 passed** across 5 files (overlaps the focused suites). - Native notice browser component: **4 passed**; production-bundle mock-Gateway E2E: **4 passed** across light/dark and desktop/mobile. - UI polish regression suite: **18 unit tests**, **4 browser component cases**, and **4 production-bundle E2E cases** cover disclosure labels, body alignment, and all three mid-run notice kinds. - Latest review-focused run: **16 Gateway tests passed**, including both real-path post-await revocation cases; **18 UI unit tests**, **4 browser component cases**, and **4 production-bundle E2E cases passed** with neutral guidance wording. - The three next-turn privacy regressions **fail on origin/main `4bf119f2359e2cf00b73e4d6de66d5ef98e01980`** because history, live events, and deltas expose the captured prompt; they pass with this change. - Changed-file Oxfmt/Oxlint, scoped core/UI/Advisor tsgo, i18n verification, and Madge import-cycle check exercised. One existing Solid reactivity warning remains in the unchanged run-failure branch of `chat-divider.tsx`. - Consumer audit covered Android chat/voice/wear, shared iOS/macOS chat history/event codecs, the TUI, MCP relay/plugin readers, and public session sharing. Non-Control-UI history and live notice exclusion are also tested with equally authorized recipients. - [Exact-head CI passed](https://github.com/openclaw/openclaw/actions/runs/38811342123) for `6402a9d8627c75d6075f759d89bf663db01c8880`: all 92 jobs completed, no failures. The affected Gateway server test-type project and 15 live/broadcast tests also passed locally after completing the fixture’s profile type. Visual proof uses real production Control UI builds and the mock Gateway with a canonical plugin-steer fixture surrounded by tool calls. Before is built from the exact origin/main commit above; after is the feature branch. All captures were inspected for secrets, hostnames, and private paths. This is deterministic display-boundary proof, not a claim of live-provider coverage. ### Before: steering is invisible  ### After: collapsed native notice  ### After: expanded guidance without the delivery prefix  ### Dark theme on mobile  Co-authored-by: Ayaan Zaidi <[email protected]>
Stacked on #173460 (private model-prompt display isolation).
What Problem This Solves
Plugin steering was invisible in Control UI chat, while next-turn fallback guidance could leak to display clients inside private prompt metadata.
User Impact
Control UI users can expand a timestamped Advisor guidance notice to inspect guidance without creating another user turn. Other plugins use the same presentation with their own display name. Channels, native apps, and the TUI do not receive these notices.
Private
modelPromptProjectionmetadata is now omitted from all display reads and message events; the user's visible message and the model's recorded input remain unchanged. No protocol schema, migration, or channel-delivery change is required.Why This Change Was Made
The notice says Plugin name guidance, not that steering succeeded. Canonical persistence can precede native submission, and no durable row field proves acceptance:
extensions/codex/src/app-server/run-attempt-active-turn.ts:443-452persists beforeattempt-steering.ts:292-378can reject dispatch. Attribution remains useful without making an unsupported delivery claim. No new persistence field was added.display: false. Only the exact authenticated Control UI client ID enables an internal display projection in history/startup, incremental reads, exact-message hydration, and live delivery. Live recipient filtering precedes shared serialization caches.displayTextseparates operator-facing guidance from model-only instructions. Advisor supplies the finding without its delivery prefix. Existing notes without display text retain their original text rather than guessing at plugin-specific prose.modelPromptProjectionat the shared display sanitizer. It is private replay state, and the consumer audit found no UI, native-app, TUI, SDK, or extension reader of that field. Canonical persistence and runtime replay are untouched.Evidence
Current-session authority is exercised through the real
chat.historyhandler and live transcript broadcaster: revoking a shared-session viewer after asynchronous history/transcript preparation prevents the response or event from exposing guidance, while the authorized owner still receives the live event.chat.historyINVALID_REQUESTwith no message payload or guidance text.session.message5678421c7571bf76502a6a645cb6d60e39ed85abbecause history, live events, and deltas expose the captured prompt; they pass with this change.chat-divider.tsx.6402a9d8627c75d6075f759d89bf663db01c8880: all 92 jobs completed, no failures. The affected Gateway server test-type project and 15 live/broadcast tests also passed locally after completing the fixture’s profile type.Visual proof uses real production Control UI builds and the mock Gateway with a canonical plugin-steer fixture surrounded by tool calls. Before is built from the exact origin/main commit above; after is the feature branch. All captures were inspected for secrets, hostnames, and private paths. This is deterministic display-boundary proof, not a claim of live-provider coverage.
Before: steering is invisible
After: collapsed native notice
After: expanded guidance without the delivery prefix
Dark theme on mobile