样式修改
This commit is contained in:
1 parent
eaf1e075f2
commit
ce431ee155
4 files changed
+45
-23
No files matched your search
@@ -591,7 +591,18 @@ export function useStep2Orchestration(
|
||||
* auto=false(用户点击步骤 / 文件卡)始终强制打开。
|
||||
*/
|
||||
const openSeatVirtualArtifact = useCallback(
|
||||
(seatThreadId: string, virtualUrl: string, auto: boolean) => {
|
||||
(
|
||||
seatThreadId: string,
|
||||
virtualUrl: string,
|
||||
auto: boolean,
|
||||
opts?: { manual?: boolean },
|
||||
) => {
|
||||
// manual=true → 视为「用户手动接管」,会把全局 autoSelect 置 false(尊重用户后续不再
|
||||
// 自动选/自动开)。默认沿用旧语义:auto=false 即手动点击(文件卡 / 步骤)。
|
||||
// 但**系统程序化打开**(如沙箱跟随 openSeatLatestArtifact)必须传 manual:false ——
|
||||
// 否则会误关 autoSelect,毒化随后实时 write_file 的 auto=true 自动打开,表现为
|
||||
// 「单个智能体发言时沙箱不自动打开、只能手动开」(763eb4d 沙箱跟随引入的回归)。
|
||||
const manual = opts?.manual ?? !auto;
|
||||
if (auto) {
|
||||
if (hasAutoOpenedRef.current.has(virtualUrl)) return;
|
||||
const flags = autoOpenFlagsRef.current;
|
||||
@@ -618,7 +629,8 @@ export function useStep2Orchestration(
|
||||
}
|
||||
setActiveArtifactThreadId(seatThreadId);
|
||||
const open = () => {
|
||||
selectArtifact(virtualUrl, auto);
|
||||
// select 的第 2 参 = autoSelect:true 表示「自动选,不毒化」;只有真正手动接管才传 false。
|
||||
selectArtifact(virtualUrl, !manual);
|
||||
setArtifactsOpen(true);
|
||||
};
|
||||
if (auto) {
|
||||
@@ -658,7 +670,9 @@ export function useStep2Orchestration(
|
||||
: "";
|
||||
if (!path) continue;
|
||||
const virtualUrl = buildWriteFileVirtualUrl(path, stub.id, tc.id);
|
||||
openSeatVirtualArtifact(seatThreadId, virtualUrl, false);
|
||||
// manual:false —— 沙箱跟随是系统行为,强制打开但**不**关闭 autoSelect(否则毒化
|
||||
// 后续实时自动打开,见 openSeatVirtualArtifact 注释)。
|
||||
openSeatVirtualArtifact(seatThreadId, virtualUrl, false, { manual: false });
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user