Skip to content

Commit 8b9e8b9

Browse files
committed
feat(box): add global sandbox scope option
Add a 'Global (shared by all)' option to the sandbox scope selector. Uses a constant '{global}' template variable that always resolves to 'global', so all users and chats share one sandbox container.
1 parent ff64207 commit 8b9e8b9

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/langbot/pkg/box/service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ def resolve_box_session_id(self, query: pipeline_query.Query) -> str:
176176
.get('local-agent', {})
177177
.get('box-session-id-template', '{launcher_type}_{launcher_id}')
178178
)
179-
variables = query.variables or {}
179+
variables = dict(query.variables or {})
180+
variables.setdefault('global', 'global')
180181
return template.format_map(collections.defaultdict(lambda: 'unknown', variables))
181182

182183
def build_skill_extra_mounts(self, query: pipeline_query.Query) -> list[dict]:

src/langbot/templates/metadata/pipeline/ai.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ stages:
127127
required: false
128128
default: "{launcher_type}_{launcher_id}"
129129
options:
130+
- name: "{global}"
131+
label:
132+
en_US: Global (shared by all)
133+
zh_Hans: 全局(所有人共享)
134+
zh_Hant: 全域(所有人共用)
135+
ja_JP: グローバル(全員共有)
136+
vi_VN: Toàn cục (chia sẻ cho tất cả)
137+
th_TH: ทั่วไป (แชร์ทั้งหมด)
138+
es_ES: Global (compartido por todos)
139+
ru_RU: Глобальный (общий для всех)
130140
- name: "{launcher_type}_{launcher_id}"
131141
label:
132142
en_US: Per chat (Recommended)

0 commit comments

Comments
 (0)