feat(tenancy): implement workspace isolation

This commit is contained in:
Junyan Qin
2026-07-19 09:58:59 +08:00
parent 37099ddf7e
commit 8b7ce77cec
271 changed files with 31166 additions and 6513 deletions
+8
View File
@@ -2,6 +2,12 @@ api:
port: 5300
webhook_prefix: 'http://127.0.0.1:5300'
extra_webhook_prefix: ''
# Canonical browser origin when WebUI and API use different origins in
# development (for example http://localhost:3000). Production bundled UI
# may leave this empty when webhook_prefix already has the browser origin.
# OAuth redirects trust only these server-side values, never request Host
# or Origin headers.
webui_url: ''
# Global API key for the HTTP service API and the MCP server. When set to a
# non-empty string, this key is accepted anywhere a web-UI-created API key is
# accepted (X-API-Key header or "Authorization: Bearer <key>"), WITHOUT any
@@ -142,6 +148,8 @@ box:
enabled: true
backend: 'local' # 'local' (Docker/nsjail), 'docker', 'nsjail', or 'e2b'. Can be written via BOX__BACKEND.
runtime:
# External WebSocket runtimes also require LANGBOT_BOX_CONTROL_TOKEN in
# both LangBot and Box. Keep the shared secret out of this config file.
endpoint: '' # External Box Runtime base URL, e.g. 'ws://127.0.0.1:5410'. Leave empty for local auto-managed runtime.
limits:
max_sessions: 64 # Includes persistent sessions. New sessions fail explicitly when this cap is reached.
+8 -1
View File
@@ -356,6 +356,7 @@
isConnected: false,
ws: null,
connectionId: null,
sessionToken: null,
sessionId: getOrCreateSessionId(),
reconnectAttempts: 0,
heartbeatTimer: null,
@@ -538,7 +539,12 @@
state.ws.onopen = function () {
state.reconnectAttempts = 0;
startHeartbeat();
state.ws.send(
JSON.stringify({
type: "authenticate",
token: state.sessionToken || "",
}),
);
};
state.ws.onmessage = function (event) {
@@ -576,6 +582,7 @@
state.connectionId = data.connection_id;
if (state.hasConnected) loadHistory(true);
state.hasConnected = true;
startHeartbeat();
updateStatusDot();
updateSendBtn();
break;