Skip to content

sessions: align remote message orchestration limits - #350284

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/fix-sendmessage-consistency
Nov 25, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/fix-sendmessage-consistency

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #349953

  • Give remote messages the same per-session sliding-hour limit and orchestration setting as send_message; local and remote budgets remain separate.
  • Separate retry deduplication from the limit, expire settled entries after one hour, and reserve capacity for in-flight sends. Rejected and pre-dispatch failures do not consume the budget.

Apply per-session sliding limits to remote sends and keep retry deduplication separate from the message budget.

Co-authored-by: Copilot <[email protected]>
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added bug Issue identified by VS Code Team member as probable bug agents-window agent-host Issues for the agent-host implementation (not the protocol) labels Nov 24, 2026
Copilot AI balanced review requested due to automatic review settings November 24, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues require changes to the per-session remote-message rate limiting.

No open issues 🎉

What changed in this PR

Fixes #349953 by replacing the Agents window’s lifetime remote-message cap with a per-session sliding-hour limit, aligned with send_message while keeping local and remote budgets separate.

Changes:

  • Shares rate-limiting logic and applies the existing orchestration setting to remote messages.
  • Separates retry deduplication from budget accounting, reserves in-flight capacity, and excludes rejected or pre-dispatch failures.
  • Adds cleanup ownership and tests for limits, recovery, retries, and uncertain delivery.

No actionable findings. Reported targeted tests passed; full client validation and live multi-host testing remain incomplete.

File Description
src/​vs/​sessions/​contrib/​remoteSessions/​test/​browser/​remoteSessionMessageRouter.test.ts Tests sliding limits, settings, failure accounting, reservations, and retry expiry.
src/​vs/​sessions/​contrib/​remoteSessions/​browser/​sendRemoteMessageTool.ts Owns and disposes the message router.
src/​vs/​sessions/​contrib/​remoteSessions/​browser/​remoteSessions.contribution.ts Registers the message tool for disposal.
src/​vs/​sessions/​contrib/​remoteSessions/​browser/​remoteSessionMessageRouter.ts Implements per-session budgets, retry expiry, and delivery accounting.
src/​vs/​platform/​agentHost/​node/​shared/​sessionServerTools.ts Reuses the extracted shared limiter.
src/​vs/​platform/​agentHost/​common/​sessionActionLimiter.ts Provides sliding-window limits and in-flight reservations.
src/​vs/​platform/​agentHost/​common/​agentHostStarter.config.contribution.ts Documents separately counted remote-message limits.

Review effort: Balanced

@dmitrivMS Dmitriy Vasyura (dmitrivMS) removed the bug Issue identified by VS Code Team member as probable bug label Nov 25, 2026
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added this to the 1.149.0 milestone Nov 25, 2026
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as ready for review November 25, 2026 12:30
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit c5f38fb Nov 25, 2026
38 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the agents/fix-sendmessage-consistency branch November 25, 2026 14:13
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added the remote-session-tools Issues related to Agents Window tools for managing sessions on remote Agent Hosts label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-host Issues for the agent-host implementation (not the protocol) agents-window remote-session-tools Issues related to Agents Window tools for managing sessions on remote Agent Hosts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agents window: send_remote_message stops for good after 50 sends per window lifetime; only a window reload resets it

4 participants