Skip to content

fix(discord): bind transcript capture to source account [AI] - #118579

Merged
joshavant merged 66 commits into
openclaw:mainfrom
pgondhi987:fix/fix-905
Aug 15, 2026
Merged

joshavant merged 66 commits into
openclaw:mainfrom
pgondhi987:fix/fix-905

Conversation

@pgondhi987

@pgondhi987 pgondhi987 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Discord voice transcript capture could honor a model-provided bot account instead of the account that received the active turn. In multi-account setups, that let one bot route a capture through another bot's voice manager.

Why This Change Was Made

  • Carries the Discord voice manager's account into the agent-run context.
  • Adds the narrow optional transcript-provider contract accountOwnership: { channelId, resolveAccountId }.
  • Binds same-channel capture to the trusted inbound account, ignoring a model-selected accountId for that path.
  • Resolves channel-less and configured capture through the provider before persistence: an explicit capable account wins; otherwise Discord uses the sole capable account, a capable configured default, or the canonical default account. Remaining multi-account ambiguity is rejected.
  • Excludes Discord accounts whose configured credentials are unavailable in the active runtime.
  • Persists the validated owner channel and account at session creation so later lifecycle actions can enforce the same ownership boundary.
  • Returns actionable provider-resolution failures while bounding account identifiers in model-visible errors.
  • Keeps historical sessions with incomplete ownership metadata on a local recovery path instead of inferring provenance.
  • Qualifies auto-start shutdown by the exact process-owned capture, so a reused session id cannot stop a replacement capture.

User Impact

Discord-originated capture stays on the bot account that received the turn. Channel-less local capture and configured auto-start may use an explicit capable account, the sole capable account, or a capable configured default; otherwise multiple capable accounts require accountId. Historical rows without complete ownership metadata remain recoverable only through the documented local path.

Maintainer Decision

Accept the public openclaw/plugin-sdk/transcripts ownership contract added by this PR. Its complete surface is accountOwnership: { channelId, resolveAccountId }. Core owns generic trusted-account binding and lifecycle enforcement; Discord owns capability and canonical-account resolution.

Current starts and imports record authoritative ownership when the session is created. No historical ownership inference or Doctor-based ownership repair is included; incomplete ownership is not guessed or rewritten. The change uses the existing transcript metadata JSON and does not change the SQLite schema version.

Current-Head Verification

  • Merged current main and resolved the 22 generated Plugin SDK baseline conflicts in favor of main's deletion; no deleted baseline is reintroduced by the PR.
  • git diff --check origin/main...HEAD passes.
  • git merge-tree --write-tree origin/main HEAD reports no conflicts.
  • Exact-head GitHub CI will run on the updated PR head; no result from an older head is presented as exact-head evidence here.

AI-assisted implementation and validation.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 2:43 PM ET / 18:43 UTC.

ClawSweeper review

What this changes

The PR carries the trusted Discord account into transcript operations, binds capture and lifecycle control to it, and adds provider-level ownership authorization plus recovery handling for historical sessions.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

This PR remains necessary: current main lets a model-provided account select the Discord voice manager. Its core approach is appropriate, but the new public provider authorization and persisted ownership contract needs explicit SDK/security-owner acceptance before merge.

Priority: P1
Reviewed head: 76db42b5c7a85adababb99db0bfdadd5449d2a3c
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair and behavior evidence are strong; explicit contract acceptance remains the merge gate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied exact-head production-adapter and ephemeral Gateway evidence observes denied cross-account control and a working same-account control; it covers the changed boundary despite stubbed external Discord manager sinks.
Patch quality 🐚 platinum hermit (4/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied exact-head production-adapter and ephemeral Gateway evidence observes denied cross-account control and a working same-account control; it covers the changed boundary despite stubbed external Discord manager sinks.
Evidence reviewed 6 items Current-main defect: Discord selects the voice manager from session.source.accountId, while the transcript runtime builds that source from model tool parameters.
Missing trusted-context propagation: The current tool factory receives agent account information but creates the transcript tool with only agent id and config, leaving it unable to bind a Discord request to its ingress account.
Current implementation provenance: Blame attributes the affected manager-selection lines to this commit, which is contained by current main.
Findings None None.
Security Needs attention Approve the provider authorization surface: The added provider callbacks receive trusted caller facts and decide access to persisted transcript operations, creating a new authority and persistence boundary.

How this fits together

The transcript tool converts agent requests into persisted sessions and provider start/stop calls. Discord supplies the account-specific voice manager, so trusted inbound account context must constrain both manager selection and later lifecycle actions.

flowchart LR
  A[Discord inbound turn] --> B[Trusted account context]
  B --> C[Transcript tool]
  C --> D[Provider ownership policy]
  D --> E[Persisted session owner]
  E --> F[Discord voice manager]
Loading

Decision needed

Question Recommendation
Should OpenClaw accept the public transcript-provider ownership contract, including provider-defined account authorization and local-only recovery for historical incomplete rows? Approve the ownership contract: Accept the narrow generic contract and documented historical recovery semantics before merging this PR.

Why: This determines a durable third-party plugin authority boundary and historical session-access policy that code review cannot choose unilaterally.

Before merge

  • Resolve security concern: Approve the provider authorization surface - The added provider callbacks receive trusted caller facts and decide access to persisted transcript operations, creating a new authority and persistence boundary.
  • Resolve merge risk (P1) - Merging publishes a provider-facing authorization contract and persists owner metadata, so third-party provider compatibility and historical-row access policy need explicit acceptance.
  • Resolve merge risk (P1) - The branch has a broad 89-file surface, including CI and caller-context support changes beyond the immediate Discord manager-selection defect.

Findings

  • [medium] Approve the provider authorization surface — src/transcripts/provider-types.ts:121
Agent review details

Security

Needs attention: The intended behavior is security hardening, but the new public provider authorization surface needs explicit security-owner acceptance before merge.

Review metrics

Metric Value Why it matters
Ownership contract 1 public SDK contract added; 2 persisted ownership facts The change extends provider authority and records ownership for later transcript lifecycle decisions.
Production versus test scope aggregate +4,382/-424; exact production/test split unavailable locally The supplied PR metadata reports a broad patch, while this read-only promisor checkout could not hydrate the PR head for independent per-file classification.

Stored data model

Persistent data-model change detected: database schema: extensions/qa-lab/src/live-transports/discord/discord-transcripts-authorization.runtime.ts, migration/backfill/repair: extensions/discord/src/doctor.test.ts, migration/backfill/repair: extensions/discord/src/doctor.ts, serialized state: extensions/discord/src/voice/transcripts-source.ts, serialized state: src/agents/tools/transcripts-tool-runtime.ts, serialized state: src/agents/tools/transcripts-tool.import.test.ts, and 4 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Approve the SDK boundary (recommended)
    Have SDK and security owners explicitly accept the provider contract and historical-row policy before merge.
  2. Narrow the implementation
    Keep Discord-specific authorization behind a smaller approved seam if maintainers do not want providers to receive trusted caller facts.
  3. Pause the branch
    Hold this PR if neither contract direction is acceptable.

Technical review

Best possible solution:

Explicitly approve the generic provider ownership contract and its documented local recovery policy, then merge only the coherent changes needed to enforce trusted account binding across transcript creation and lifecycle control.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: a Discord-origin turn for account A can request accountId: "account-b"; current main carries that raw field into Discord manager lookup. The supplied PR proof reports the same denied-versus-allowed scenario on its exact head.

Is this the best way to solve the issue?

Unclear: binding trusted ingress identity at the core-to-provider boundary is the correct repair shape, but the public SDK and historical-session policy need explicit owner acceptance before this can be called the best permanent solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1db88feeef05.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: Current main allows a Discord-origin transcript request to select another configured voice account.
  • merge-risk: 🚨 compatibility: The PR adds a public plugin SDK authorization contract and changes multi-account capture resolution.
  • merge-risk: 🚨 session-state: It persists channel and account ownership for later transcript lifecycle actions.
  • merge-risk: 🚨 security-boundary: It defines which trusted account may start or control Discord capture.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied exact-head production-adapter and ephemeral Gateway evidence observes denied cross-account control and a working same-account control; it covers the changed boundary despite stubbed external Discord manager sinks.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied exact-head production-adapter and ephemeral Gateway evidence observes denied cross-account control and a working same-account control; it covers the changed boundary despite stubbed external Discord manager sinks.

Evidence

Security concerns:

  • [medium] Approve the provider authorization surface — src/transcripts/provider-types.ts:121
    The added provider callbacks receive trusted caller facts and decide access to persisted transcript operations, creating a new authority and persistence boundary.
    Confidence: 0.95

What I checked:

  • Current-main defect: Discord selects the voice manager from session.source.accountId, while the transcript runtime builds that source from model tool parameters. (extensions/discord/src/voice/transcripts-source.ts:30, 1db88feeef05)
  • Missing trusted-context propagation: The current tool factory receives agent account information but creates the transcript tool with only agent id and config, leaving it unable to bind a Discord request to its ingress account. (src/agents/openclaw-tools.ts:550, 1db88feeef05)
  • Current implementation provenance: Blame attributes the affected manager-selection lines to this commit, which is contained by current main. (extensions/discord/src/voice/transcripts-source.ts:30, 20e81a724dd4)
  • SDK authority policy: The applicable SDK policy requires SDK and security-owner acceptance before widening a capability trust, authority, or persistence boundary; the proposed access-control contract does all three. (src/plugin-sdk/AGENTS.md:59, 1db88feeef05)
  • Behavior proof: The supplied exact-head PR evidence exercises production transcript routing and an ephemeral Gateway, observing denial for account-b and a working account-a control path. (76db42b5c7a8)
  • Codex dependency gate: The Copilot bridge change only preserves OpenClaw attempt context; no reviewed code imports, executes, or claims compatibility with the sibling Codex runtime or protocol. (extensions/copilot/src/tool-bridge.ts:411, 1db88feeef05)

Likely related people:

  • steipete: Git blame attributes the central current-main manager-selection and tool-wiring lines to Peter Steinberger's commit. (role: current implementation provenance; confidence: high; commits: 20e81a724dd4; files: extensions/discord/src/voice/transcripts-source.ts, src/agents/openclaw-tools.ts, src/agents/tools/transcripts-tool-runtime.ts)
  • joshavant: Recent commits on this branch cover Discord transcript authorization and restored account ownership after rebasing. (role: recent area contributor; confidence: medium; commits: 8d55b369239c, 4d8c591ad3bd, 76db42b5c7a8; files: extensions/discord/src/voice/transcripts-source.ts, src/agents/tools/transcripts-tool.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain explicit SDK and security-owner acceptance for the public ownership contract and historical-session policy.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (63 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-14T01:30:31.109Z sha 889aa9c2c4c54795f81411fac4260f5d40a5fe94 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T08:46:34.619Z sha 519444134c29d36d267270fc40c70e52f3501d7f :: found issues before merge. :: [P1] Get owner approval for the new transcript-provider SDK contract
  • reviewed 2026-08-14T09:26:17.498Z sha 357f9cbc5202fce5add426b31ada44fac9fa5ec4 :: found issues before merge. :: [P1] Obtain approval for the public ownership contract | [P1] Provide an upgrade path for ambiguous auto-starts
  • reviewed 2026-08-15T00:19:50.825Z sha 11ebbab00216f10e05fbe016aa536d15cb13365d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T00:25:46.285Z sha 11ebbab00216f10e05fbe016aa536d15cb13365d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T00:39:49.895Z sha 8686bdfe30f7e9daa8ace17be184fad6bf6562c6 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T01:15:02.317Z sha 435a69813689c64f2358626522aa5c5d041c0dca :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T18:24:14.666Z sha 76db42b :: needs maintainer review before merge. :: none

@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head a009f3b0574d15b2e4334983ba6c4173d5423592

Behavior proved: a Discord-origin agent turn for account-a cannot redirect live transcript capture through configured account-b.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path and the real Discord transcript provider adapter; only the external DiscordVoiceManager.join sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 test file passed, 1 test passed.

Evidence:

  • fixed/denied: requested account-b; persisted account was account-a; trusted manager calls: 1; protected wrong-manager calls: 0.
  • benign control: requested account-a; trusted manager calls increased to 2; protected wrong-manager calls remained 0.
  • the regular exact-head suites also passed: transcript tool 20/20 and Discord voice E2E 192/192; GitHub production/test type checks passed.

Compatibility/operator note: same-channel capture is bound to the inbound account. Explicit account selection for a different provider channel remains unchanged.

Live gaps: no private Discord token or live guild was used. The external manager calls were stubbed, while the account-binding decision, persistence, and Discord provider manager selection were exercised from production modules.

3 similar comments
@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head a009f3b0574d15b2e4334983ba6c4173d5423592

Behavior proved: a Discord-origin agent turn for account-a cannot redirect live transcript capture through configured account-b.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path and the real Discord transcript provider adapter; only the external DiscordVoiceManager.join sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 test file passed, 1 test passed.

Evidence:

  • fixed/denied: requested account-b; persisted account was account-a; trusted manager calls: 1; protected wrong-manager calls: 0.
  • benign control: requested account-a; trusted manager calls increased to 2; protected wrong-manager calls remained 0.
  • the regular exact-head suites also passed: transcript tool 20/20 and Discord voice E2E 192/192; GitHub production/test type checks passed.

Compatibility/operator note: same-channel capture is bound to the inbound account. Explicit account selection for a different provider channel remains unchanged.

Live gaps: no private Discord token or live guild was used. The external manager calls were stubbed, while the account-binding decision, persistence, and Discord provider manager selection were exercised from production modules.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head a009f3b0574d15b2e4334983ba6c4173d5423592

Behavior proved: a Discord-origin agent turn for account-a cannot redirect live transcript capture through configured account-b.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path and the real Discord transcript provider adapter; only the external DiscordVoiceManager.join sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 test file passed, 1 test passed.

Evidence:

  • fixed/denied: requested account-b; persisted account was account-a; trusted manager calls: 1; protected wrong-manager calls: 0.
  • benign control: requested account-a; trusted manager calls increased to 2; protected wrong-manager calls remained 0.
  • the regular exact-head suites also passed: transcript tool 20/20 and Discord voice E2E 192/192; GitHub production/test type checks passed.

Compatibility/operator note: same-channel capture is bound to the inbound account. Explicit account selection for a different provider channel remains unchanged.

Live gaps: no private Discord token or live guild was used. The external manager calls were stubbed, while the account-binding decision, persistence, and Discord provider manager selection were exercised from production modules.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head a009f3b0574d15b2e4334983ba6c4173d5423592

Behavior proved: a Discord-origin agent turn for account-a cannot redirect live transcript capture through configured account-b.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path and the real Discord transcript provider adapter; only the external DiscordVoiceManager.join sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 test file passed, 1 test passed.

Evidence:

  • fixed/denied: requested account-b; persisted account was account-a; trusted manager calls: 1; protected wrong-manager calls: 0.
  • benign control: requested account-a; trusted manager calls increased to 2; protected wrong-manager calls remained 0.
  • the regular exact-head suites also passed: transcript tool 20/20 and Discord voice E2E 192/192; GitHub production/test type checks passed.

Compatibility/operator note: same-channel capture is bound to the inbound account. Explicit account selection for a different provider channel remains unchanged.

Live gaps: no private Discord token or live guild was used. The external manager calls were stubbed, while the account-binding decision, persistence, and Discord provider manager selection were exercised from production modules.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 3, 2026
@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head cbd4b406056d5113ecf0d40725228d56696a4c9b

Behavior proved: a Discord-origin agent turn for account-a cannot redirect live transcript capture through configured account-b.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path and the real Discord transcript provider adapter; only the external DiscordVoiceManager.join sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 test file passed, 1 test passed.

Evidence:

  • fixed/denied: requested account-b; persisted account was account-a; trusted manager calls: 1; protected wrong-manager calls: 0.
  • benign control: requested account-a; trusted manager calls increased to 2; protected wrong-manager calls remained 0.
  • the regular exact-head suites also passed: transcript tool 20/20 and Discord voice E2E 192/192; GitHub production/test type checks passed.

Compatibility/operator note: Discord explicitly declares its inbound account namespace. Same-channel capture is bound to the inbound account, while lookup aliases and explicit account selection for other provider channels remain unchanged. The effective account is returned in the tool result.

Live gaps: no private Discord token or live guild was used. The external manager calls were stubbed, while the account-binding decision, persistence, and Discord provider manager selection were exercised from production modules.

2 similar comments
@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head cbd4b406056d5113ecf0d40725228d56696a4c9b

Behavior proved: a Discord-origin agent turn for account-a cannot redirect live transcript capture through configured account-b.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path and the real Discord transcript provider adapter; only the external DiscordVoiceManager.join sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 test file passed, 1 test passed.

Evidence:

  • fixed/denied: requested account-b; persisted account was account-a; trusted manager calls: 1; protected wrong-manager calls: 0.
  • benign control: requested account-a; trusted manager calls increased to 2; protected wrong-manager calls remained 0.
  • the regular exact-head suites also passed: transcript tool 20/20 and Discord voice E2E 192/192; GitHub production/test type checks passed.

Compatibility/operator note: Discord explicitly declares its inbound account namespace. Same-channel capture is bound to the inbound account, while lookup aliases and explicit account selection for other provider channels remain unchanged. The effective account is returned in the tool result.

Live gaps: no private Discord token or live guild was used. The external manager calls were stubbed, while the account-binding decision, persistence, and Discord provider manager selection were exercised from production modules.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head cbd4b406056d5113ecf0d40725228d56696a4c9b

Behavior proved: a Discord-origin agent turn for account-a cannot redirect live transcript capture through configured account-b.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path and the real Discord transcript provider adapter; only the external DiscordVoiceManager.join sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 test file passed, 1 test passed.

Evidence:

  • fixed/denied: requested account-b; persisted account was account-a; trusted manager calls: 1; protected wrong-manager calls: 0.
  • benign control: requested account-a; trusted manager calls increased to 2; protected wrong-manager calls remained 0.
  • the regular exact-head suites also passed: transcript tool 20/20 and Discord voice E2E 192/192; GitHub production/test type checks passed.

Compatibility/operator note: Discord explicitly declares its inbound account namespace. Same-channel capture is bound to the inbound account, while lookup aliases and explicit account selection for other provider channels remain unchanged. The effective account is returned in the tool result.

Live gaps: no private Discord token or live guild was used. The external manager calls were stubbed, while the account-binding decision, persistence, and Discord provider manager selection were exercised from production modules.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Aug 3, 2026
@pgondhi987

Copy link
Copy Markdown
Contributor Author

Behavior proof for current head 602c8be353321616c466e70d2a7e3b57ee9eca19

Behavior proved: a Discord-origin turn for account-a cannot redirect live transcript capture or later lifecycle actions through configured account-b, including through the Copilot tool bridge.

Environment: local PR checkout on the exact head. The harness invoked the real createTranscriptsTool / startTranscripts path, SQLite-backed transcript store, Discord transcript provider adapter, and createCopilotToolBridge; only external DiscordVoiceManager.join/leave sinks were stubbed.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof-final.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 file passed, 1 test passed in 24.51s.

Evidence:

  • denied capture: requested account-b; persisted account and ownership remained account-a; trusted join calls: 1; protected wrong-account join calls: 0.
  • denied lifecycle: an account-b tool context could neither summarize nor stop the session; trusted and wrong-account leave calls both remained 0.
  • Copilot adapter: preserved accountId=account-a, messageChannel=discord, and messageProvider=discord-voice as separate facts.
  • benign control: requesting account-a increased trusted join calls to 2; wrong-account join calls remained 0.
  • exact-head focused suites passed: transcript tool 21/21 and Copilot bridge 79/79. Exact-head GitHub build, types, lint, tests, CodeQL, OpenGrep, and required CI gate are green.

Compatibility note: same-channel lifecycle actions require the bound account. Same-agent CLI/webchat management, lookup aliases, and explicit accounts for other provider channels remain unchanged. The effective account is model-visible in the tool result.

Live gap: no private Discord token or live guild was available. External manager methods were stubbed; account binding, persistence, lifecycle authorization, Copilot propagation, and Discord manager selection ran through production modules.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Behavior proof for current head 602c8be353321616c466e70d2a7e3b57ee9eca19

Behavior proved: a Discord-origin turn for account-a cannot redirect live transcript capture or later lifecycle actions through configured account-b, including through the Copilot tool bridge.

Environment: local PR checkout on the exact head. Two complementary harnesses were used. The production-adapter harness invoked the real createTranscriptsTool / startTranscripts path, SQLite-backed transcript store, Discord transcript provider adapter, and createCopilotToolBridge; only external DiscordVoiceManager.join/leave sinks were stubbed. A repository QA harness also booted an isolated real Gateway child, two qa-channel accounts, a deterministic OpenAI-compatible provider, and a registered transcript source provider.

Command/artifact:

  • OPENCLAW_BEHAVIOR_PROOF_OUTPUT=/tmp/openclaw-905-behavior-proof-final.json node scripts/run-vitest.mjs src/agents/tools/transcripts-account-boundary.proof.test.ts
  • Result: 1 file passed, 1 test passed in 24.51s.
  • OPENCLAW_ACCOUNT_PROOF_ARTIFACT=/tmp/openclaw-account-gateway-proof.json node scripts/run-vitest.mjs test/e2e/transcripts-account-gateway.proof.e2e.test.ts
  • Gateway result: 1 file passed, 1 test passed in 48.31s. Artifact: /tmp/openclaw-account-gateway-proof.json.

Evidence:

  • denied capture: requested account-b; persisted account and ownership remained account-a; trusted join calls: 1; protected wrong-account join calls: 0.
  • denied lifecycle: an account-b tool context could neither summarize nor stop the session; trusted and wrong-account leave calls both remained 0.
  • Copilot adapter: preserved accountId=account-a, messageChannel=discord, and messageProvider=discord-voice as separate facts.
  • benign control: requesting account-a increased trusted join calls to 2; wrong-account join calls remained 0.
  • ephemeral Gateway denied scenario: account A started the persisted session; account B then requested stop through a real inbound agent turn; protected TranscriptSourceProvider.stop calls remained 0.
  • ephemeral Gateway control: account A requested stop through the same Gateway/channel/model/tool path; protected provider stop calls became exactly 1.
  • persisted Gateway owner metadata: ownerChannel=qa-channel, ownerAccountId=account-a.
  • exact-head focused suites passed: transcript tool 21/21 and Copilot bridge 79/79. Exact-head GitHub build, types, lint, tests, CodeQL, OpenGrep, and required CI gate are green.

Compatibility note: same-channel lifecycle actions require the bound account. Same-agent CLI/webchat management, lookup aliases, and explicit accounts for other provider channels remain unchanged. The effective account is model-visible in the tool result.

Live gap: no private Discord token or live guild was available. AWS runner capacity preflight was ready, but the broker handoff required a new interactive GitHub OAuth login, so no remote lease was created. External Discord manager methods were stubbed; account binding, persistence, lifecycle authorization, Copilot propagation, Discord manager selection, and the denied/allowed agent turns ran through production modules and the repository's ephemeral Gateway QA infrastructure.

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 3, 2026
@clawsweeper clawsweeper Bot removed the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Aug 3, 2026
@joshavant

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

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

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord docs Improvements or additions to documentation extensions: copilot extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants