MCPcopy Index your code
hub / github.com/anomalyco/opencode / legacySessionServer

Function legacySessionServer

packages/app/src/utils/session-route.ts:19–26  ·  view source on GitHub ↗
(
  tabs: readonly { type: "session"; server: ServerConnection.Key; sessionId: string }[],
  sessionID: string,
  active: ServerConnection.Key,
)

Source from the content-addressed store, hash-verified

17}
18
19export function legacySessionServer(
20 tabs: readonly { type: "session"; server: ServerConnection.Key; sessionId: string }[],
21 sessionID: string,
22 active: ServerConnection.Key,
23) {
24 const matches = tabs.filter((tab) => tab.sessionId === sessionID)
25 return matches.find((tab) => tab.server === active)?.server ?? (matches.length === 1 ? matches[0]?.server : active)
26}
27
28type SessionParent = { id: string; parentID?: string }
29

Callers 3

SessionRouteFunction · 0.90
LegacyTargetSessionRouteFunction · 0.90

Calls 1

findMethod · 0.65

Tested by

no test coverage detected