-
Notifications
You must be signed in to change notification settings - Fork 62
feat: Add Bounded Concurrent BYOM Workspace Leases #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danny-avila
merged 8 commits into
main
from
danny-avila/byom-concurrent-workspace-leases
Sep 9, 2026
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
322d780
feat: Add Bounded Concurrent Native Workspace Leases
danny-avila e7abf6d
fix: Bound Workspace Cleanup Waits and Preserve Legacy Heartbeats
danny-avila e3348dc
fix: Enforce Replica Slot Ceilings at Dispatch
danny-avila 4882def
fix: Fence BYOM Workspaces Independently of Settlement
danny-avila 760ab7f
fix: Retain Workspace Ownership Through Cleanup
danny-avila 382b165
fix: Preserve Slot Liveness and Retry Finalization
danny-avila 51540fe
Merge remote-tracking branch 'librechat/main' into danny-avila/byom-c…
danny-avila 6ebad00
fix: Close Startup and Executor Recovery Gaps
danny-avila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,63 @@ | ||
| import test from 'node:test'; | ||
| import assert from 'node:assert/strict'; | ||
| import { spawnSync } from 'node:child_process'; | ||
| import { mkdtemp, mkdir, rm } from 'node:fs/promises'; | ||
| import { tmpdir } from 'node:os'; | ||
| import { join } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| test('CLI rejects aliased and overlapping workspace roots before connecting', async (t) => { | ||
| const root = await mkdtemp(join(tmpdir(), 'byom-cli-roots-')); | ||
| t.after(() => rm(root, { recursive: true, force: true })); | ||
| await mkdir(join(root, '..nested')); | ||
| for (const extra of [root, join(root, '..nested')]) { | ||
| const result = spawnSync( | ||
| process.execPath, | ||
| [ | ||
| fileURLToPath(new URL('./cli.js', import.meta.url)), | ||
| 'run', | ||
| '--worker-dir', | ||
| root, | ||
| '--workspace', | ||
| `second=${extra}`, | ||
| ], | ||
| { | ||
| encoding: 'utf8', | ||
| timeout: 3000, | ||
| env: { | ||
| ...process.env, | ||
| LIBRECHAT_CODE_URL: 'http://127.0.0.1:1', | ||
| LIBRECHAT_CODE_WORKER_TOKEN: 'fixture', | ||
| LIBRECHAT_CODE_WORKER_ID: 'fixture-worker', | ||
| LIBRECHAT_CODE_COMMAND_SANDBOX: 'native-srt', | ||
| }, | ||
| }, | ||
| ); | ||
| assert.notEqual(result.status, 0); | ||
| assert.match(result.stderr, /must not overlap or alias/); | ||
| } | ||
| }); | ||
|
|
||
| test('CLI bounds requested workspace slots before connecting', () => { | ||
| const result = spawnSync( | ||
| process.execPath, | ||
| [ | ||
| fileURLToPath(new URL('./cli.js', import.meta.url)), | ||
| 'run', | ||
| '--workspace-lease-slots', | ||
| '9', | ||
| ], | ||
| { | ||
| encoding: 'utf8', | ||
| timeout: 3000, | ||
| env: { | ||
| ...process.env, | ||
| LIBRECHAT_CODE_URL: 'http://127.0.0.1:1', | ||
| LIBRECHAT_CODE_WORKER_TOKEN: 'fixture', | ||
| LIBRECHAT_CODE_WORKER_ID: 'fixture-worker', | ||
| }, | ||
| }, | ||
| ); | ||
| assert.notEqual(result.status, 0); | ||
| assert.match(result.stderr, /cannot exceed 8/); | ||
| }); |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.