docs: document channel turn guardrails#82199
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 577f0e06ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const lowLevelHistoryHelpers = [ | ||
| "buildInboundHistoryFromMap", | ||
| "buildPendingHistoryContextFromMap", | ||
| "clearHistoryEntriesIfEnabled", | ||
| "recordPendingHistoryEntry", | ||
| "recordPendingHistoryEntryIfEnabled", | ||
| "recordPendingHistoryEntryWithMedia", |
There was a problem hiding this comment.
Include omitted map helper in migration guardrail
The new guardrail is intended to prevent migrated message-turn paths from falling back to low-level reply-history map APIs, but lowLevelHistoryHelpers omits buildHistoryContextFromMap (which is still exported from plugin-sdk/reply-history). As a result, a regression that reintroduces that helper in one of the guarded files will pass this test suite, so the stated protection is incomplete.
Useful? React with 👍 / 👎.
Summary
toInboundMediaFacts, recent/skipped-message media handoff, andcreateChannelHistoryWindowin the channel turn SDK guidereply-historyexports as compatibility helpers and refresh the Plugin SDK API hash after source-link line driftVerification
node scripts/run-vitest.mjs src/channels/turn/message-turn-guardrails.test.ts src/channels/turn/history-window.test.ts src/channels/turn/media.test.tsnode scripts/run-tsgo.mjs -p tsconfig.core.json --incremental falsepnpm plugin-sdk:api:checknode scripts/run-oxlint.mjs src/channels/turn/message-turn-guardrails.test.ts src/plugin-sdk/reply-history.tsgit diff --check/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode autoReal behavior proof
Behavior addressed: migrated message-turn paths are guarded against reintroducing adapter-local low-level history handling, and SDK docs now describe the core-owned media/history handoff.
Real environment tested: local OpenClaw checkout on branch
refactor/message-sdk-guardrailsat577f0e06ad.Exact steps or command run after this patch: focused Vitest for guardrails/history/media; core tsgo; Plugin SDK API check; targeted oxlint; diff whitespace check; Codex review.
Evidence after fix: focused Vitest passed 3 files / 7 tests; core tsgo exited 0; Plugin SDK API check exited 0; targeted oxlint found 0 warnings and 0 errors;
git diff --checkexited 0; Codex review reported no accepted/actionable findings.Observed result after fix: Discord, Slack, and Zalo migrated message-turn files cannot silently call raw
reply-historymap helpers again without a failing test.What was not tested: no live channel runtime; this PR is docs plus guardrail coverage only.