feat: keep managed SSH prompts running on Hosts

Managed SSH prompts previously depended on Desktop-owned provider and transcript state, so accepted work could stop or become uncertain when the Desktop, network, or power disappeared. The Agent now owns accepted OpenCode prompt execution, model and tool rounds, cancellation, and the durable semantic transcript, while Desktop remains authoritative for permanent projects, conversations, tasks, and messages.

Recovered work attaches to the original conversation without replay. The project switcher also groups managed SSH projects by saved Host and shows live Agent connectivity beside each group without opening a connection merely to read status. Remote project subtitles now show only the path, and the Agent lock advances to 0.11.14 with Runtime ACP v4.

Release note: 托管 SSH 任务在桌面端、网络或电源中断后可继续在主机上运行,并能回到原会话精确恢复;项目菜单现按主机分组并显示实时连接状态。
This commit is contained in:
mesalogo
2026-08-31 11:04:41 +08:00
parent f6f8d5e053
commit 561de29f00
75 changed files with 13439 additions and 1327 deletions
+39
View File
@@ -7,9 +7,17 @@ import type {
AcpReconcilePromptResult
} from '../../shared/agent-protocol'
import type {
RemoteOwnedPromptStartRequest,
RemoteOwnedPromptStartResult,
RemotePromptOperationAcceptance,
RemotePromptOperationPreparation,
remoteOwnedPromptAttachRequestSchema,
remoteSemanticTranscriptAckRequestSchema,
remoteSemanticTranscriptAckResultSchema,
remoteSemanticTranscriptPageRequestSchema,
remoteSemanticTranscriptPageResultSchema,
} from '../../shared/remote-agent-contracts'
import type { z } from 'zod'
import type {
ModelBridgePolicy
} from '../../shared/model-bridge-contracts'
@@ -17,9 +25,26 @@ import type {
export type RemoteRuntimeChannelCapabilities = {
cancellationEscalation: boolean
promptOperationReconciliation: boolean
ownedPrompt?: boolean
modelBridge?: boolean
}
export type RemoteOwnedPromptAttachRequest = z.infer<
typeof remoteOwnedPromptAttachRequestSchema
>
export type RemoteSemanticTranscriptPageRequest = z.infer<
typeof remoteSemanticTranscriptPageRequestSchema
>
export type RemoteSemanticTranscriptPageResult = z.infer<
typeof remoteSemanticTranscriptPageResultSchema
>
export type RemoteSemanticTranscriptAckRequest = z.infer<
typeof remoteSemanticTranscriptAckRequestSchema
>
export type RemoteSemanticTranscriptAckResult = z.infer<
typeof remoteSemanticTranscriptAckResultSchema
>
export type RuntimeSessionBindingCursors = AcpBindingCursors
export type RemoteCancellationEscalation = Omit<
@@ -86,6 +111,20 @@ export interface RemoteRuntimeChannel {
preparePrompt(
preparation: RemotePromptOperationPreparation
): Promise<RemotePromptOperationAcceptance>
/** Starts an Agent-owned ACP prompt exactly once for its stable operation. */
startOwnedPrompt?(
request: RemoteOwnedPromptStartRequest
): Promise<RemoteOwnedPromptStartResult>
/** Reattaches to an already accepted Agent-owned prompt without replaying it. */
attachOwnedPrompt?(
request: RemoteOwnedPromptAttachRequest
): Promise<RemoteOwnedPromptStartResult>
pageOwnedPromptTranscript?(
request: RemoteSemanticTranscriptPageRequest
): Promise<RemoteSemanticTranscriptPageResult>
ackOwnedPromptTranscript?(
request: RemoteSemanticTranscriptAckRequest
): Promise<RemoteSemanticTranscriptAckResult>
/**
* Bounds same-daemon stream recovery to the signed prompt lifetime and
* caller cancellation. Implementations that cannot recover may omit it.