MemberJunction / MemberJunction/MJ

Realtime: no session-level client tool route — cross-surface tools must wear one channel's prefix

Open
#3,536 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TSQL
Stars
29
Forks
6
Avg merge
2d 1h
Merged PRs (30d)
323

Description

### Summary

Client tools are routed to a channel by the declaring channel's `ToolNamePrefix`. There is no route for a tool that belongs to the **session** rather than to any one channel, so session-level tools have to be declared by whichever channel happens to be present — and then they ship wearing that channel's badge.

### What it looks like in practice

We have tools that operate across surfaces: report every open surface and its state, group two surfaces into one workspace, hand a multi-step job to a delegate that drives several of them. None of these belong to the whiteboard or to a browser. But to be reachable at all they must be declared by one, so the model sees:

```
browser_WorkspaceStatus ← reports ALL surfaces, not just the browser
browser_CombineSurfaces ← groups the whiteboard with something
browser_SetUpSurfaces ← drives every surface
```

Every description then has to open by contradicting its own name ("Reports ALL open surfaces at once — not only the one this tool is named after"). That is prompt budget spent undoing a routing decision, and it degrades tool selection: a model reasonably infers scope from a name.

It also creates a real ordering hazard — the owning channel must be present, so we have a claim/ownership dance to pick whichever surface exists, and the tool names change depending on which channel won.

### A second, related limit

A synchronous channel's `ApplyAgentTool` returns `string`. A session-level tool that must *await* something (our delegate returns a consolidated result after several steps) can only be declared by a channel whose entry point is async — so the same tool is available or not depending on which surface claimed it. We gate the declaration on that today, which works but is not something a host should have to reason about.

### Ask

A session-level tool route: register tools against the session with a neutral prefix (or none), dispatched by the session service rather than by channel prefix, and allowed to be async.

Found on 5.51.0.

Contributor guide

Open the contributing guide

Research direction

Start by tracing ToolNamePrefix, ApplyAgentTool, and the session service to understand how channel-owned tools are registered and dispatched. Define a session-level route with a neutral prefix or no prefix, including asynchronous execution. Done means cross-surface tools no longer depend on a channel being present or on a synchronous channel entry point.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.