-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🖼️ refactor: Enhance Env Extraction & Agent Image Handling (#6131)
* refactor: use new image output format for agents using DALL-E tools * refactor: Enhance image fetching with proxy support and adjust logging placement in DALL-E 3 integration * refactor: Enhance StableDiffusionAPI to support agent-specific return values and display message for generated images * refactor: Add unit test execution for librechat-mcp in backend review workflow * refactor: Update environment variable extraction logic, export from serpate module to avoid circular refs, and remove deprecated tests * refactor: Add unit tests for environment variable extraction and enhance StdioOptionsSchema to process env variables
- Loading branch information
1 parent
2293cd6
commit 7f6b32f
Showing
14 changed files
with
321 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { StdioOptionsSchema } from '../src/mcp'; | ||
|
||
describe('Environment Variable Extraction (MCP)', () => { | ||
const originalEnv = process.env; | ||
|
||
beforeEach(() => { | ||
process.env = { | ||
...originalEnv, | ||
TEST_API_KEY: 'test-api-key-value', | ||
ANOTHER_SECRET: 'another-secret-value', | ||
}; | ||
}); | ||
|
||
afterEach(() => { | ||
process.env = originalEnv; | ||
}); | ||
|
||
describe('StdioOptionsSchema', () => { | ||
it('should transform environment variables in the env field', () => { | ||
const options = { | ||
command: 'node', | ||
args: ['server.js'], | ||
env: { | ||
API_KEY: '${TEST_API_KEY}', | ||
ANOTHER_KEY: '${ANOTHER_SECRET}', | ||
PLAIN_VALUE: 'plain-value', | ||
NON_EXISTENT: '${NON_EXISTENT_VAR}', | ||
}, | ||
}; | ||
|
||
const result = StdioOptionsSchema.parse(options); | ||
|
||
expect(result.env).toEqual({ | ||
API_KEY: 'test-api-key-value', | ||
ANOTHER_KEY: 'another-secret-value', | ||
PLAIN_VALUE: 'plain-value', | ||
NON_EXISTENT: '${NON_EXISTENT_VAR}', | ||
}); | ||
}); | ||
|
||
it('should handle undefined env field', () => { | ||
const options = { | ||
command: 'node', | ||
args: ['server.js'], | ||
}; | ||
|
||
const result = StdioOptionsSchema.parse(options); | ||
|
||
expect(result.env).toBeUndefined(); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.