feat(embed): scope OAuth and sessions per visitor principal

Add embed visitor principals (X-Embed-Visitor), widen sessions.user_id,
embed MCP OAuth/approval routes, OAuth callback context detachment, and
CloneContext principal preservation for async QA streams.
This commit is contained in:
wizardchen
2026-06-30 18:16:44 +08:00
committed by lyingbug
parent 168b1d4cfe
commit 5074344c16
23 changed files with 438 additions and 43 deletions
+1 -2
View File
@@ -69,8 +69,7 @@ func sessionUserIDForLookup(ctx context.Context) string {
// Shared-agent pipelines resolve the session owner tenant first; keep that internal lookup tenant-scoped.
return ""
}
userID, _ := types.UserIDFromContext(ctx)
return userID
return types.SessionOwnerIDFromContext(ctx)
}
// CreateMessage creates a new message within an existing session