fix: complete runtime and workspace workflows

Restore Ask workspace reads and output paging without granting write access,
and let programming Subagents reuse their parent's browser page. Allocate
browser resources only when used, keep Agent pages aligned with workbar tabs,
recover released bindings, and remove unused automatic screenshot work.

Preserve inherited Runtime selections during remote usage persistence and
manual compression. Keep viable channel model fallbacks, display the actual
scheduled-task mode and Harness model source, and avoid rediscovery delays
when calling healthy MCP tools. Fix directory/history refresh, case-only
renames, rename-aware commit diffs, and FastGPT probe success reporting.

Add regression coverage and align feature documentation. The Agent-side
connection timeout fix requires deploying an updated Agent; existing Ask
read-only and Execute authorization boundaries remain unchanged.

Final validation: 3839 tests passed, 66 skipped; typecheck, lint, development
build, and diff checks passed. Isolated Electron UI/MCP workflows passed with
a loopback model fixture. Current-source Linux x64 Host checks passed with
three successful real model requests. Chromium loadURL rejection was not
reproduced in the UI; released-binding recovery has automated coverage.

Release note: 修复 Ask 读取项目文件、浏览器页面显示与恢复、文件管理及模型配置跟随中的不一致,并减少无用截图和 MCP 等待。定时任务显示实际工作模式,远程会话可正常保存继承 Runtime 的用量;远端连接超时修复需更新 Agent 后生效。
This commit is contained in:
mesalogo
2026-09-10 12:48:30 +08:00
parent 020a9ad0dc
commit c037d7fb20
62 changed files with 2637 additions and 521 deletions
+28 -25
View File
@@ -266,6 +266,25 @@ async function probeDify(configuration_) {
}
}
function fastGptListResult(result) {
if (!result) return { success: false, failure: 'request-failed' }
if (!result.response.ok) return { success: false, failure: 'http-error' }
const body = asRecord(result.body)
if (body?.code !== 200) return { success: false, failure: 'business-error' }
const data = asRecord(body.data)
const list = Array.isArray(body.data) ? body.data : data?.list
if (!Array.isArray(list)) return { success: false, failure: 'invalid-shape' }
return { success: true, list }
}
function fastGptRetrievalShape(result) {
const { list, ...outcome } = fastGptListResult(result)
return {
...outcome,
...(list ? resultShape(list, 'score') : {})
}
}
async function probeFastGpt(configuration_) {
const context = { apiKey: configuration_.apiKey, operations: [] }
const base = baseUrl('fastgpt', configuration_.baseUrl)
@@ -277,12 +296,8 @@ async function probeFastGpt(configuration_) {
)
const catalogBody = asRecord(catalog?.body)
const rawData = catalogBody?.data
const nestedData = asRecord(rawData)
const items = Array.isArray(rawData)
? rawData
: Array.isArray(nestedData?.list)
? nestedData.list
: []
const { list, ...catalogOutcome } = fastGptListResult(catalog)
const items = list ?? []
const datasets = items.filter((item) => asRecord(item)?.type === 'dataset')
const first = asRecord(datasets[0])
let detail
@@ -308,14 +323,7 @@ async function probeFastGpt(configuration_) {
})
}
)
const body = asRecord(result?.body)
const data = asRecord(body?.data)
const list = Array.isArray(body?.data)
? body.data
: Array.isArray(data?.list)
? data.list
: []
retrievals.push({ searchMode, ...resultShape(list, 'score') })
retrievals.push({ searchMode, ...fastGptRetrievalShape(result) })
}
if (extended) {
const result = await request(
@@ -334,17 +342,10 @@ async function probeFastGpt(configuration_) {
})
}
)
const body = asRecord(result?.body)
const data = asRecord(body?.data)
const list = Array.isArray(body?.data)
? body.data
: Array.isArray(data?.list)
? data.list
: []
retrievals.push({
searchMode: 'mixedRecall',
usingRerank: true,
...resultShape(list, 'score')
...fastGptRetrievalShape(result)
})
}
}
@@ -360,7 +361,8 @@ async function probeFastGpt(configuration_) {
: undefined
},
catalog: {
count: datasets.length,
...catalogOutcome,
...(catalogOutcome.success ? { count: datasets.length } : {}),
envelope: Array.isArray(rawData) ? 'data-array' : 'data-object',
itemKeys: unionKeys(items),
itemTypes: [...new Set(items.map((item) => asRecord(item)?.type).filter((value) => typeof value === 'string'))].sort()
@@ -371,8 +373,9 @@ async function probeFastGpt(configuration_) {
},
retrievals,
features: {
searchModes: [...new Set(retrievals.filter((item) => item.count >= 0).map((item) => item.searchMode))],
rerankProbed: extended,
searchModes: [...new Set(retrievals.filter((item) => item.success && !item.usingRerank).map((item) => item.searchMode))],
rerankProbed: retrievals.some((item) => item.usingRerank),
rerankSucceeded: retrievals.some((item) => item.usingRerank && item.success),
extensionQueryProbed: false
},
operations: context.operations