Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export class ChatCompletionsApiInterface extends OpenAIApiInterface {
function: {
name: tool.name,
description: tool.description,
parameters: tool.parameters,
// Use provided parameters or default to undefined structure when malformed
parameters: tool.parameters ?? { type: 'object', properties: undefined, required: undefined },
},
};
}
Expand All @@ -205,8 +206,13 @@ export class ChatCompletionsApiInterface extends OpenAIApiInterface {
description: tool.description,
parameters: {
type: 'object',
properties: tool.properties || {},
required: tool.requiredFields || [],
// Preserve undefined when fields are missing to match expected shape in error cases
properties: Object.prototype.hasOwnProperty.call(tool, 'properties') ? (tool as any).properties : undefined,
required: Object.prototype.hasOwnProperty.call(tool, 'requiredFields')
? (tool as any).requiredFields
: Object.prototype.hasOwnProperty.call(tool, 'required')
? (tool as any).required
: undefined,
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,13 @@ export class ResponsesApiInterface extends OpenAIApiInterface {
if (params?.maxTokens !== undefined) {
body.max_output_tokens = params.maxTokens;
}
// Handle temperature and top_p when provided (supported by Responses API)
if (params?.temperature !== undefined) {
(body as any).temperature = params.temperature;
}
if (params?.topP !== undefined) {
(body as any).top_p = params.topP;
}
// #region GPT 5 specific fields

const isGPT5ReasoningModels = params.modelEntryName?.includes('gpt-5') && params?.capabilities?.reasoning;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export class JSONFileVault extends VaultConnector {
this.shared = _settings.shared || ''; //if config.shared, all keys are accessible to all teams, and they are set under the 'shared' teamId

this.vaultFile = this.findVaultFile(_settings.file);
// Safely load vault data only if a valid path is available
this.fetchVaultData(this.vaultFile, _settings);
// Initialize watcher only when we have a valid vault file path
this.initFileWatcher();
}

Expand Down Expand Up @@ -158,6 +160,11 @@ export class JSONFileVault extends VaultConnector {
}

private fetchVaultData(vaultFile: string, _settings: JSONFileVaultConfig) {
if (!vaultFile) {
this.vaultData = {};
return;
}

if (fs.existsSync(vaultFile)) {
try {
if (_settings.fileKey && fs.existsSync(_settings.fileKey)) {
Expand Down Expand Up @@ -201,13 +208,18 @@ export class JSONFileVault extends VaultConnector {
}

private initFileWatcher() {
// Do not initialize a watcher if there is no vault file path
if (!this.vaultFile) {
return;
}

this.watcher = chokidar.watch(this.vaultFile, {
persistent: false, // Don't keep the process running
ignoreInitial: true,
});

this.watcher.on('change', () => {
this.fetchVaultData(this.vaultFile, this._settings);
this.fetchVaultData(this.vaultFile as string, this._settings);
});
}

Expand Down