snowflake credentials adjustment

This commit is contained in:
dal 2025-08-26 10:34:15 -06:00
parent fb1a49f498
commit 5b1c903f78
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
3 changed files with 18 additions and 8 deletions

View File

@ -102,14 +102,12 @@ export function createDoneToolStart(context: DoneToolContext, doneToolState: Don
const doneToolResponseEntry = createDoneToolResponseMessage(doneToolState, options.toolCallId);
const doneToolMessage = createDoneToolRawLlmMessageEntry(doneToolState, options.toolCallId);
// Create the tool result immediately with success: true
// This ensures it's always present even if the stream terminates early
const rawToolResultEntry = createRawToolResultEntry(
options.toolCallId,
DONE_TOOL_NAME,
{ success: true }
);
const rawToolResultEntry = createRawToolResultEntry(options.toolCallId, DONE_TOOL_NAME, {
success: true,
});
const entries: UpdateMessageEntriesParams = {
messageId: context.messageId,
@ -126,7 +124,7 @@ export function createDoneToolStart(context: DoneToolContext, doneToolState: Don
rawLlmMessages.push(doneToolMessage);
}
rawLlmMessages.push(rawToolResultEntry);
if (rawLlmMessages.length > 0) {
entries.rawLlmMessages = rawLlmMessages;
}

View File

@ -93,13 +93,22 @@ export class SnowflakeAdapter extends BaseAdapter {
private async createConnection(credentials: SnowflakeCredentials): Promise<snowflake.Connection> {
const connectionOptions: snowflake.ConnectionOptions = {
account: credentials.account_id,
account: credentials.account_id, // Always required by SDK
username: credentials.username,
password: credentials.password,
warehouse: credentials.warehouse_id,
database: credentials.default_database,
};
// Use custom_host if provided via accessUrl
if (credentials.custom_host) {
// Ensure the URL has proper protocol
const host = credentials.custom_host.startsWith('http')
? credentials.custom_host
: `https://${credentials.custom_host}`;
connectionOptions.accessUrl = host;
}
if (credentials.role) {
connectionOptions.role = credentials.role;
}

View File

@ -38,6 +38,9 @@ export interface SnowflakeCredentials {
/** Default schema to use */
default_schema?: string;
/** Optional custom host for load balancers (e.g., "ridedvp-angel.yukicomputing.com:443") */
custom_host?: string;
}
/**