mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
refactor(mcp): simplify unscoped client selection
This commit is contained in:
parent
ffe24daaf7
commit
b58fb0a14c
1 changed files with 5 additions and 3 deletions
|
|
@ -35,11 +35,13 @@ export function register(deps: ToolDeps) {
|
|||
let effectiveTag = await deps.resolveSelectedContainerTag(
|
||||
args.containerTag,
|
||||
)
|
||||
let unscopedClient: ReturnType<ToolDeps["getClient"]> | undefined
|
||||
if (args.containerTag === undefined && effectiveTag) {
|
||||
const unscopedClient =
|
||||
args.containerTag === undefined && effectiveTag
|
||||
? deps.getClient()
|
||||
: undefined
|
||||
if (unscopedClient) {
|
||||
// Active state is account-wide and can outlive an OAuth grant.
|
||||
// Revalidate inherited state before sending it as an explicit scope.
|
||||
unscopedClient = deps.getClient()
|
||||
const visibleTags = await unscopedClient.listContainerTags()
|
||||
if (!visibleTags.some((tag) => tag.containerTag === effectiveTag)) {
|
||||
effectiveTag = undefined
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue