LibreChat/api/server/services
Danny Avila 1526b429c9
🧵 feat: Implement Request Executor Pattern for Actions (#4566)
* chore: actions typing

* fix(actions): implement request executor pattern to prevent concurrent execution issues

BREAKING CHANGE: ActionRequest now uses a RequestExecutor pattern for isolated request state

- Introduce RequestConfig class to store immutable configuration
- Add RequestExecutor class to handle isolated request state for each execution
- Modify ActionRequest to act as a facade creating new executors for each operation
- Maintain backward compatibility through delegation and getters
- Add TypeScript types for better type safety
- Fix race conditions in concurrent executions with auth and params

This change prevents state mutation issues when the same action is called
multiple times concurrently, particularly when using authentication. Each
request now gets its own isolated state through a new executor instance,
solving race conditions while maintaining the existing API interface.

* ci: test isolation/immutatability

* chore: Update version to 0.7.51 in data-provider package

* refactor(actions): refactor createActionTool to use request executor pattern
2024-10-28 13:42:38 -04:00
..
Config 🚧 chore: merge latest dev build (#4288) 2024-09-30 17:17:57 -04:00
Endpoints 🤖 fix: Address Minor Agent Issues (#4483) 2024-10-21 09:41:04 -04:00
Files 🖼️ fix: Avatar Handling for Agents and Assistants (#4507) 2024-10-22 14:53:45 -04:00
Runs 🤖 fix: Minor Assistants Issues (#4436) 2024-10-16 15:04:10 -04:00
start 🔒 refactor: Apply interface settings to all Roles (#3967) 2024-09-09 20:15:08 -04:00
Threads 🛡️ fix: Minor Vulnerabilities (#4543) 2024-10-24 15:50:48 -04:00
ActionService.js 🧵 feat: Implement Request Executor Pattern for Actions (#4566) 2024-10-28 13:42:38 -04:00
ActionService.spec.js 🤖 feat: OpenAI Assistants v2 (initial support) (#2781) 2024-05-19 12:56:55 -04:00
AppService.interface.spec.js 🧠 feat: Prompt caching switch, prompt query params; refactor: static cache, prompt/markdown styling, trim copied code, switch new chat to convo URL (#3784) 2024-08-26 15:34:46 -04:00
AppService.js 🧹 fix: Resolve Unarchive Conversation Bug, Archive Pagination (#4189) 2024-09-22 17:21:50 -04:00
AppService.spec.js 🧠 feat: Prompt caching switch, prompt query params; refactor: static cache, prompt/markdown styling, trim copied code, switch new chat to convo URL (#3784) 2024-08-26 15:34:46 -04:00
AssistantService.js 🤖 feat: OpenAI Assistants v2 (initial support) (#2781) 2024-05-19 12:56:55 -04:00
AuthService.js 🔐 refactor: Unverified User Verification Logic (#4482) 2024-10-21 07:51:45 -04:00
cleanup.js 🧹 fix: Resolve Unarchive Conversation Bug, Archive Pagination (#4189) 2024-09-22 17:21:50 -04:00
isDomainAllowed.js 🧪 refactor(isDomainAllowed): change directory, add tests (#2539) 2024-04-25 13:14:07 -04:00
isDomainAllowed.spec.js 🧪 refactor(isDomainAllowed): change directory, add tests (#2539) 2024-04-25 13:14:07 -04:00
ModelService.js 🕒 feat: Add 5-second timeout for Fetching Model Lists (#4423) 2024-10-15 19:37:41 -04:00
ModelService.spec.js 🕒 feat: Add 5-second timeout for Fetching Model Lists (#4423) 2024-10-15 19:37:41 -04:00
PluginService.js 🕸️ refactor: Migrate from crypto to Web Crypto API (#3357) 2024-08-04 23:59:45 -04:00
signPayload.js chore: remove jose as Bun now supports JWT 🍞 (#1167) 2023-11-12 00:44:46 -05:00
Tokenizer.js 🚧 chore: merge latest dev build to main repo (#3844) 2024-08-31 16:33:51 -04:00
ToolService.js 👓 fix: Assistants Vision Prompt Error Handling (legacy) (#4529) 2024-10-23 15:21:22 -04:00
UserService.js 🛠️ fix: Remove expiresAt field when setting expiry to "never" (#4294) 2024-10-03 07:17:21 -04:00