Skip to content

sessions_send from visible webchat leaks internal replies via announce path and rebinds target sessions to webchat #64917

Description

@samgamgee-star

Version

Summary

When sessions_send is called from a visible webchat-backed session to an internal session, it does not behave like a strict internal-only handoff. The target reply can surface into visible webchat, and the target session can inherit webchat delivery context.

What seems to be happening

Current behavior appears to be:

  • the target run starts with deliver: false
  • then a follow-up agent-to-agent announce flow still runs
  • the tool result reports delivery.mode: announce
  • the inter-session path uses internal webchat, which can cause fresh internal targets to pick up webchat delivery context

Expected behavior

  • sessions_send to an internal session should keep execution internal
  • the reply should remain internal
  • the caller should be the only session deciding what becomes user-visible
  • the target session should not inherit visible webchat binding just because the source was visible

Actual behavior

  • raw internal replies can appear in visible webchat
  • target sessions can become associated with webchat delivery context, for example:
    • channel: webchat
    • deliveryContext.channel: webchat
  • tool results consistently show delivery.mode: announce

Steps to reproduce

  1. Start from a visible webchat-backed session.
  2. Call sessions_send to an internal session with a message such as:
    Reply with exactly: TEST_OK
  3. Observe the result.

Observed result

  • TEST_OK appears in visible webchat
  • the target session becomes webchat-associated
  • the tool result reports delivery.mode: announce

Expected result

  • the reply stays internal
  • no raw internal text reaches the visible user thread
  • the destination session remains internal

Why this matters

This makes sessions_send unsafe as a strict internal delegation primitive from visible user-facing sessions.

Temporary workaround

  • avoid sessions_send from visible webchat when strict internal boundaries are required

Additional note

If this behavior is intended, the docs should explicitly describe sessions_send as an announce-capable handoff rather than an internal-only RPC-style primitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions