Repository navigation
Conversation
OCE set no session.dmScope, so OpenClaw's "main" applied: every approved Slack or Teams direct-message sender shared one model context with the others and with the main session that browser chat opens, and recall across conversations was on. Deployment admission now fills session.dmScope = "per-account-channel-peer" when unset; explicit values are kept. OCE channels accept named accounts, so the scope includes the account. Finding 3191.
…l reference The configuration reference hit the 2500-word limit. Keep a one-line pointer beside the other defaults, and describe the per-sender sessions, the recall default and the effect on existing Agents in the channel configuration reference. Drop the channels lifecycle sentence, which the Configuration lifecycle text above already covers.
Contributor
|
🦞👀 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. |
…abled A browser-only Agent has no direct-message senders to isolate, and OpenClaw's "main" scope keeps its recall across conversations. The session.dmScope default now applies only when the Configuration enables a channel, by the rule enabledChannelEntries uses for the channel runtime and Secret bindings. Defaults now see the document root, not only the object that would hold the setting. The test helper adds no empty objects for a fill it does not admit, as admission does. Finding 3191.
…rift check The first-Agent Configuration enables no channel, so admission fills no session.dmScope there and a revision without it is not drift. Format the touched files.
gateway-security-defaults.ts repeats the enabled-channel rule so it can stay import-free. A table test now fails if the two copies disagree (shared keys, enabled "false", non-object entries). Docs: new browser chat sessions on a channel Agent are no longer grouped under main after the next deployment; design.md keeps only the architectural clause.
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(gateway): isolate channel direct messages per sender by default This is item 1/1 in the current shard. Shard 0/1. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
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.
Problem
OCE sets no
session.dmScope, so OpenClaw's default"main"applies. An Agent can run Slack or Microsoft Teams (a dedicated workload with an Installation channel runtime) and browser chat at the same time, and nothing refuses that combination. With"main":agent:main:main, the session that members' browser chat opens by default;dmScoperesolves to"main".So external channel users, who are not OCE principals, can get the Agent to repeat members' chat content and tool output.
Not changed: members can still read channel conversations. That is the documented native admin pilot sharing (
docs/design.md, "Native admin pilot exception").Change
packages/occ/src/gateway-security-defaults.ts: when the Configuration enables a channel and leavessession.dmScopeunset, deployment admission fills"per-account-channel-peer". An explicit value, including"main", is kept. A route binding'sbindings[].session.dmScopestill wins for its route (and, like any non-mainscope, turns cross-conversation recall off). After the next deployment, new browser chat sessions on such an Agent are no longer grouped under main. A conformance test pins the duplicated enabled-channel rule toenabledChannelEntries.enabledChannelEntries(packages/occ/src/channel-secret-bindings.ts), which decides the channel runtime and the channel Secret bindings: anychannelskey exceptdefaultsandmodelByChannelwhoseenabledis notfalse. The module must stay import-free (the Console serves it andscripts/first-agent-model.mjsloads it without packages), so it repeats that rule, with a comment in both places. A browser-only Agent gets nosessionsettings, so OpenClaw's"main"and its recall across conversations stay. If a channel is added later, the next deployment fills the default.per-account-channel-peerand notper-channel-peer: OCE channels accept named accounts.slackAccountTargets(packages/occ/src/channel-secret-bindings.ts) starts eachchannels.slack.accountsentry, anddocs/reference/configuration/secrets.mddocuments binding named Slack accounts. The account-scoped key keeps one sender's sessions separate across two accounts. For a single-account channel it is the same isolation asper-channel-peer, withdefaultin the session key.docs/reference/configuration.mdlists the default beside the others and links to a new "Direct-message sessions" subsection indocs/reference/configuration/secrets.md. That subsection gives the channel rule, the reason, the recall default, how to keep"main", and what existing Agents see. The page was at the 2500-word limit, so the detail lives in the channel reference. One sentence was removed: thevalues.channelslifecycle sentence, which the Configuration lifecycle text above it already covers.docs/design.mdsays that channel conversations are among the shared conversations, and that each channel direct-message sender gets a separate session by default.corporatepreset users to setdmScopethemselves when a channel is enabled.Where it applies
The fill runs in
agentRuntimeConfiguration(packages/occ/src/index.ts) for every deployment, for every Compute Driver and execution mode. Console create, the API and provisioning all deploy through that path. The stored Configuration and existing AgentRevisions do not change. An existing Agent gets the new default on its next deployment.What existing Agents see after their next deployment
Agents without an enabled channel: no change.
For an Agent with an enabled channel that did not set
session.dmScope:agent:main:<channel>:<account>:direct:<sender>). Earlier direct-message turns stay in the main session's history; the new per-sender session does not include them.memory.search.rememberAcrossConversations) is off unless the Configuration sets it.To keep the old behavior, set
session.dmScope: "main"in the Configuration.Verification
tests/conformance/configuration-occ.test.mjsdeploys throughdeployAgent. The new block checks each case with a dedicated Agent:sessionis filled, so recall is unchanged;sessionis filled;per-account-channel-peer;per-account-channel-peer;"main"with a channel: kept.The existing case matrix keeps an explicit
session.dmScope: "main"without channels.tests/helpers/admitted-configuration.mjshas a newGATEWAY_SECURITY_DEFAULTSrow whose predicate sees the root. It is kept separate from the product module, so a dropped or widened default fails the tests. Like admission, the helper no longer adds empty objects for a fill it does not admit.tests/integration/first-agent-startup.test.mjs: the first-Agent Configuration enables no channel, so the subset loop now runs over the defaults that apply to it (nosession.dmScope). The explicit-drift loop still covers every row, so an explicit"main"there is drift.Runner VM, at head
f6e199335c:bun fmt --checkandeslint --max-warnings 0on touched files are clean, andpnpm typecheckpasses.node --test tests/conformance/configuration-occ.test.mjs tests/integration/first-agent-startup.test.mjs tests/conformance/console-gateway-safety.test.ts: 83 pass, 0 fail.pnpm docs:checkpasses;docs/reference/configuration.mdis 2491 words.No runtime dogfood. The OpenClaw session-key behavior comes from the pinned commit (
src/routing/session-key.ts,per-account-channel-peerbranch).Risks
session.dmScope: channel direct-message senders lose the shared main context, and recall across conversations turns off by default. This is intended.session.dmScope: "main"restores the old behavior. Browser-only Agents do not change.gateway-security-defaults.tsrepeats the enabled-channel rule instead of importing it. IfenabledChannelEntrieschanges, this rule must change too; both places say so.