Skip to content

fix(chat): follow-up hardening and docs for agent read-tool scoping - #774

Merged
dancer merged 3 commits into
mainfrom
scope-guard-residual-gaps
Aug 3, 2026
Merged

fix(chat): follow-up hardening and docs for agent read-tool scoping#774
dancer merged 3 commits into
mainfrom
scope-guard-residual-gaps

Conversation

@dnukumamras

@dnukumamras dnukumamras commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Follow-up hardening and updated docs for the agent read-tool scoping in createChatTools.

What changed

  • Wrap the remaining dispatch paths (modal submit/close, assistant-thread, assistant-context, app-home, app-context, member-joined) in runInConversation so read tools built inside those handlers inherit the active conversation.
  • Log a warning when a read runs with no resolvable scope, instead of failing open silently.
  • Keep scoping channel-level by default; add opt-in strictScope: true to confine a thread scope to that thread alone (rejects sibling threads on per-thread-ACL platforms like Discord and GitHub).
  • Update the AI SDK tools docs to cover the channel-level default, what scope does and does not do, and the strictScope opt-in.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dnukumamras
dnukumamras requested a review from a team as a code owner August 3, 2026 05:29
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, v0 Aug 3, 2026 12:50pm
chat-sdk-nextjs-chat Ready Ready Preview Aug 3, 2026 12:50pm

@dancer
dancer merged commit 85e3d22 into main Aug 3, 2026
15 of 17 checks passed
@dancer
dancer deleted the scope-guard-residual-gaps branch August 3, 2026 12:50
bensabic pushed a commit that referenced this pull request Aug 4, 2026
Follow-up and hardening for two inbound parsers.

- **Teams** — HTML-to-text conversion now strips tags until the output
is stable, so nested or malformed markup can't leave a partial tag
behind. A shared `stripHtmlTags` helper backs both the format converter
and the Graph message converter (was three inline single-pass regexes).
- **Slack** — the link-unfurl fallback bounds the length of bracketed
URLs parsed from message text, avoiding a quadratic scan on adversarial
input. Valid links are unaffected.

Two changesets (`@chat-adapter/teams`, `@chat-adapter/slack`); no
public-type change. Independent of #774/#775.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants