feat(osa) send request channel with payload#12
Merged
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by gpt-5.4-2026-03-05 · 1,393,735 tokens |
jeanduplessis
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Forwards the active chat surface to the server as a new
source.channelfield on every security checkup request. The server can use this hint to pick a channel appropriate format (for example, collapsible<details>blocks on capable UIs and flat markdown on Telegram or Slack). This PR only adds the client side signal. The server does not yet read the field and silently drops it at zod parse time, so this change ships safely ahead of any server work.Also removes the plugin side
maybeAppendUpdateReminder()footer that was introduced in 0.1.3. That footer was presentation logic in the wrong layer. The equivalent reminder belongs on the server, where it can key off the reportedsource.pluginVersionand where admins can edit copy or cadence through the content catalog without cutting a plugin release.What changed
index.tsregisterToolconverted to factory form soOpenClawPluginToolContext.messageChannelis reachable. The factory captures the ctx once and closes over it inexecute().PluginCommandContextshape soctx.channelis read.normalizeChannel()helper trims and coerces empty values toundefinedso the server never seessource.channel: "".runFlowSafetorunSecurityAdvisorFlowtodoCheckuptosubmitAudit.maybeAppendUpdateReminder()and its constant deleted.src/client.ts: addedchannel?: stringtoSubmitAuditPayload.sourcewith a comment explaining the backward compatible rollout.CHANGELOG.md: Added, Removed entries under Unreleased.Backward compatibility
The server today uses a plain
z.object({...})forSecurityAdvisorRequestSchemaatcloud/apps/web/src/lib/security-advisor/schemas.ts, with no.strict(). Zod's default on an unknown key is to strip it at parse time (no error, no passthrough). Confirmed by reading the schema source, not just behavior. A plugin sendingsource.channelagainst the current server receives an identical response to a plugin that omits it.Test plan
Verified on a real OpenClaw gateway docker container, installed from
npm packtarball, pointed at prod (https://api.kilo.ai).Local checks:
bun run typecheckbun run format:checkbun test(49 pass, 0 fail)End to end on a live gateway, with a temporary debug log line at the top of
doCheckup()that printed the resolved channel value. The debug log was removed before the final repack; both the clean and instrumented builds were exercised on the same container./security-checkupin the native control UI. Gateway loggedsecurity-advisor: doCheckup start channel=webchat. Report returned normally.use the kilocode_security_advisor tool to run a security checkup. Gateway loggedsecurity-advisor: doCheckup start channel=webchat. Report returned normally.source.channeland returned a valid report on both paths.Notes from the test:
webchat, notcontrol-ui. When the server side rendering PR lands, its channel format lookup should key onwebchat(plus whatever Telegram, Slack, Discord, and Kilo Chat actually report, which should be confirmed by the same method when each is wired up).can you run the security checkup for mesometimes routes to the wrong tool (a cron or job runner that requires gateway pairing). Forcing the tool by name routes correctly. This is an LLM behavior pattern, not a plugin issue, and did not surface any real breakage.Ship order