Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/lib/server/session-tools/credential-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function buildCredentialEnv(credentialIds: string[]): CredentialEnv {
const env: Record<string, string> = {}
const secrets: string[] = []

const allCredentials = loadCredentials() as Record<string, Credential & { encrypted?: string }>
const allCredentials = loadCredentials() as Record<string, Credential & { encryptedKey?: string }>

for (const credId of credentialIds) {
const cred = allCredentials[credId]
Expand All @@ -45,8 +45,12 @@ export function buildCredentialEnv(credentialIds: string[]): CredentialEnv {
continue
}

// Decrypt the stored key
const encrypted = cred.encrypted
// Decrypt the stored key — credentials persist the ciphertext under
// `encryptedKey` (see createCredentialRecord in storage.ts; matching
// reads in connector-lifecycle, chatroom-helpers, daemon-state, etc.).
// Previously this file read `cred.encrypted`, which is never set, so
// credential injection silently no-op'd for every execute tool call.
const encrypted = cred.encryptedKey
if (!encrypted || typeof encrypted !== 'string') {
log.warn(TAG, `Credential has no encrypted value: ${credId}`)
continue
Expand Down
Loading