Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(environment): say what a Running instance is waiting on (#20485)

Rdmclin2ec257a92239c
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 1a16b4c29d7..d9b58323f98 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -1792,6 +1792,8 @@
"sandboxStorage.publicAgentHint_one": "{{count}} private environment is hidden — a public agent can only use workspace environments. Publish it to use it here.",
"sandboxStorage.publicAgentHint_other": "{{count}} private environments are hidden — a public agent can only use workspace environments. Publish one to use it here.",
"sandboxStorage.running": "Running",
+ "sandboxStorage.runningHint": "Something else is still running in this instance, so it cannot be picked here. It is released on its own roughly 15 minutes after that run goes quiet.",
+ "sandboxStorage.runningOwnHint": "This conversation's own run is using this instance.",
"sandboxStorage.setUpEnvironment": "Set up an environment",
"sandboxStorage.setUpEnvironmentDesc": "A persistent directory lives in an environment",
"sandboxStorage.workspaceGroup": "Workspace Environments",
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index 904a76910aa..00c0f639c19 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -626,6 +626,7 @@
"environments.instances.renameFailed": "Could not rename this instance",
"environments.instances.retryStatus": "Check again",
"environments.instances.running": "Running",
+ "environments.instances.runningHint": "A run is still using this instance — a conversation, a build, or the file browser. It is released on its own roughly 15 minutes after that run goes quiet; Run history shows which one is holding it.",
"environments.instances.save": "Save",
"environments.instances.showLog": "Show log",
"environments.instances.title": "Instances",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index c3f426f4cf3..6ac9dd73457 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -1792,6 +1792,8 @@
"sandboxStorage.publicAgentHint_one": "已隐藏 {{count}} 个私人环境 —— 公共 Agent 仅可使用工作区环境,发布后即可在这里使用。",
"sandboxStorage.publicAgentHint_other": "已隐藏 {{count}} 个私人环境 —— 公共 Agent 仅可使用工作区环境,发布后即可在这里使用。",
"sandboxStorage.running": "运行中",
+ "sandboxStorage.runningHint": "这个实例里还有别的东西在跑,所以这里选不了。那个运行安静约 15 分钟后会自动释放。",
+ "sandboxStorage.runningOwnHint": "这个实例正被当前对话自己的运行使用。",
"sandboxStorage.setUpEnvironment": "去创建环境",
"sandboxStorage.setUpEnvironmentDesc": "持久化目录需要先有一个环境",
"sandboxStorage.workspaceGroup": "工作区环境",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index b063c540d90..e5e3fa0809e 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -626,6 +626,7 @@
"environments.instances.renameFailed": "重命名实例失败",
"environments.instances.retryStatus": "重新检查",
"environments.instances.running": "运行中",
+ "environments.instances.runningHint": "这个实例还被一次运行占用着——可能是对话、构建,也可能是文件浏览器。那个运行安静约 15 分钟后会自动释放;运行记录里可以看到是哪一个。",
"environments.instances.save": "保存",
"environments.instances.showLog": "查看日志",
"environments.instances.title": "环境实例",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index bb2754464cb..29adce5e12c 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -1389,6 +1389,9 @@ export default {
// discards the other's work. The tag says which rows that applies to before
// the first message meets the refusal.
'sandboxStorage.running': 'Running',
+ 'sandboxStorage.runningHint':
+ 'Something else is still running in this instance, so it cannot be picked here. It is released on its own roughly 15 minutes after that run goes quiet.',
+ 'sandboxStorage.runningOwnHint': "This conversation's own run is using this instance.",
// A build holds the same single-writer lease a run does, so it is refused
// for the same reason — but it is not a conversation, and saying "running"
// would send someone looking for one.
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index d8ff0495dea..2f2173eb2d3 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -4115,6 +4115,8 @@ When I am ___, I need ___
'Could not read which instances are running right now',
'environments.instances.inUse':
'A conversation is using this instance — try again once that run ends',
+ 'environments.instances.runningHint':
+ 'A run is still using this instance — a conversation, a build, or the file browser. It is released on its own roughly 15 minutes after that run goes quiet; Run history shows which one is holding it.',
'environments.instances.notBuilt': 'Not built yet — nothing has been cloned or installed',
'environments.instances.rebuildConfirmContent':
"This clears the instance's folder, then clones the code again and runs the setup script. Everything in it now — changes made in conversations, installed packages, reports, data — will be lost. This cannot be undone.",
diff --git a/src/features/ChatInput/ControlBar/SandboxInstancePicker.tsx b/src/features/ChatInput/ControlBar/SandboxInstancePicker.tsx
index e106bae7d70..6e0c1ca5fb6 100644
--- a/src/features/ChatInput/ControlBar/SandboxInstancePicker.tsx
+++ b/src/features/ChatInput/ControlBar/SandboxInstancePicker.tsx
@@ -341,13 +341,25 @@ const SandboxInstancePicker = memo<SandboxInstancePickerProps>(
</span>
}
tag={
- preparing
- ? t('sandboxStorage.building')
- : unbuilt
- ? t('sandboxStorage.buildFailed')
- : instance.inUse
- ? t('sandboxStorage.running')
- : undefined
+ preparing ? (
+ t('sandboxStorage.building')
+ ) : unbuilt ? (
+ t('sandboxStorage.buildFailed')
+ ) : instance.inUse ? (
+ // "Running" alone reads as a state of the instance, not as
+ // the reason this row is the one that cannot be picked, and
+ // it says nothing about how long that lasts — there is no
+ // way to end the run from here, so the wait is the answer.
+ // Only when somebody ELSE holds it, though: this conversation's
+ // own run leaves the row selectable, and telling the person to
+ // wait for a lease they already have describes a block that is
+ // not there.
+ <Tooltip
+ title={t(occupied ? 'sandboxStorage.runningHint' : 'sandboxStorage.runningOwnHint')}
+ >
+ <span>{t('sandboxStorage.running')}</span>
+ </Tooltip>
+ ) : undefined
}
onClick={() => void select({ instanceId: instance.id, mode: 'persistent' })}
/>
diff --git a/src/features/EnvironmentManager/InstanceList.tsx b/src/features/EnvironmentManager/InstanceList.tsx
index b4dd10888b5..1717ffd5803 100644
--- a/src/features/EnvironmentManager/InstanceList.tsx
+++ b/src/features/EnvironmentManager/InstanceList.tsx
@@ -288,9 +288,15 @@ const InstanceRow = memo<InstanceRowProps>(
nothing here either: the line under the list reports that, rather than
each row quietly implying it is free. */}
{instance.inUse && (
- <Tag color={'processing'} size={'small'}>
- {t('environments.instances.running')}
- </Tag>
+ // The badge says what is true; the hint says what it means for the
+ // person looking at it. There is no way to end the run from here,
+ // so how long the hold lasts is the actionable part — and Run
+ // history is where the conversation holding it can be found.
+ <Tooltip title={t('environments.instances.runningHint')}>
+ <Tag color={'processing'} size={'small'}>
+ {t('environments.instances.running')}
+ </Tag>
+ </Tooltip>
)}
{/* Reading what an instance kept is not an edit, so it stays
available in an environment someone else published — that is