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:
@@ -113,6 +113,7 @@ export type RemoteConversationTaskEventInput = Omit<
|
||||
> & {
|
||||
conversationId: string
|
||||
assistantMessageId: string
|
||||
runtimeSelection?: AgentRuntimeSelection
|
||||
event:
|
||||
| AgentEvent
|
||||
| {
|
||||
@@ -4940,6 +4941,10 @@ export class AssistantDatabase {
|
||||
const assistantMessageId = assistantIdSchema.parse(
|
||||
input.assistantMessageId
|
||||
)
|
||||
const requestRuntimeSelection =
|
||||
input.runtimeSelection === undefined
|
||||
? undefined
|
||||
: agentRuntimeSelectionSchema.parse(input.runtimeSelection)
|
||||
const publicEvent = stripRemoteEventProvenance(input.event)
|
||||
if (publicEvent.requestId !== input.taskId) {
|
||||
throw new Error('远程事件的请求 ID 与任务不匹配')
|
||||
@@ -5054,13 +5059,16 @@ export class AssistantDatabase {
|
||||
}
|
||||
const conversation = database
|
||||
.prepare(
|
||||
`SELECT runtime_selection_json, context_state_json
|
||||
FROM conversations
|
||||
WHERE id = ?`
|
||||
`SELECT c.runtime_selection_json, c.context_state_json,
|
||||
p.runtime_selection_json AS project_runtime_selection_json
|
||||
FROM conversations c
|
||||
LEFT JOIN projects p ON p.id = c.project_id
|
||||
WHERE c.id = ?`
|
||||
)
|
||||
.get(conversationId) as
|
||||
| {
|
||||
runtime_selection_json: string | null
|
||||
project_runtime_selection_json: string | null
|
||||
context_state_json: string | null
|
||||
}
|
||||
| undefined
|
||||
@@ -5070,13 +5078,12 @@ export class AssistantDatabase {
|
||||
let contextState = parseConversationContextState(
|
||||
conversation.context_state_json
|
||||
)
|
||||
const runtimeSelection =
|
||||
requestRuntimeSelection ??
|
||||
parseRuntimeSelection(conversation.runtime_selection_json) ??
|
||||
parseRuntimeSelection(conversation.project_runtime_selection_json) ??
|
||||
{ provider: 'auto' as const }
|
||||
if (publicEvent.type === 'context-metrics') {
|
||||
const runtimeSelection = parseRuntimeSelection(
|
||||
conversation.runtime_selection_json
|
||||
)
|
||||
if (!runtimeSelection) {
|
||||
throw new Error('远程事件的对话缺少 Runtime 选择')
|
||||
}
|
||||
contextState = {
|
||||
...contextState,
|
||||
contextMetrics: {
|
||||
@@ -5091,9 +5098,6 @@ export class AssistantDatabase {
|
||||
publicEvent.type === 'context-compression' &&
|
||||
publicEvent.scope !== 'agent-run'
|
||||
) {
|
||||
const runtimeSelection = parseRuntimeSelection(
|
||||
conversation.runtime_selection_json
|
||||
)
|
||||
const estimatedAfterTokens =
|
||||
publicEvent.estimatedAfterTokens
|
||||
contextState = {
|
||||
@@ -5105,8 +5109,7 @@ export class AssistantDatabase {
|
||||
}
|
||||
: {}),
|
||||
...(publicEvent.state === 'completed' &&
|
||||
estimatedAfterTokens !== undefined &&
|
||||
runtimeSelection
|
||||
estimatedAfterTokens !== undefined
|
||||
? {
|
||||
contextMetrics: {
|
||||
runtimeSelectionKey:
|
||||
|
||||
Reference in New Issue
Block a user