Skip to content

docs: document channel turn guardrails#82199

Merged
steipete merged 1 commit into
mainfrom
refactor/message-sdk-guardrails
May 15, 2026
Merged

docs: document channel turn guardrails#82199
steipete merged 1 commit into
mainfrom
refactor/message-sdk-guardrails

Conversation

@steipete
Copy link
Copy Markdown
Contributor

Summary

  • add a core guardrail test so migrated Discord, Slack, and Zalo message-turn paths keep using the channel history window instead of low-level reply-history map helpers
  • document toInboundMediaFacts, recent/skipped-message media handoff, and createChannelHistoryWindow in the channel turn SDK guide
  • mark low-level reply-history exports as compatibility helpers and refresh the Plugin SDK API hash after source-link line drift

Verification

  • 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.ts
  • node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental false
  • pnpm plugin-sdk:api:check
  • node scripts/run-oxlint.mjs src/channels/turn/message-turn-guardrails.test.ts src/plugin-sdk/reply-history.ts
  • git diff --check
  • /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode auto

Real 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-guardrails at 577f0e06ad.
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 --check exited 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-history map helpers again without a failing test.
What was not tested: no live channel runtime; this PR is docs plus guardrail coverage only.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S maintainer Maintainer-authored PR labels May 15, 2026
@steipete steipete merged commit 9ee93e8 into main May 15, 2026
86 of 94 checks passed
@steipete steipete deleted the refactor/message-sdk-guardrails branch May 15, 2026 15:27
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +21 to +27
const lowLevelHistoryHelpers = [
"buildInboundHistoryFromMap",
"buildPendingHistoryContextFromMap",
"clearHistoryEntriesIfEnabled",
"recordPendingHistoryEntry",
"recordPendingHistoryEntryIfEnabled",
"recordPendingHistoryEntryWithMedia",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant