fix: resolve runtime, review, channel and chat state failures

Keep remote startup cancellable without blocking other sessions and surface local OpenCode submission failures promptly. Preserve supervisor project isolation, pause behavior and valid story destinations.

Restore generated-image channel delivery, Telegram reconnection on unchanged Save and DingTalk business-error retries. Preserve virtualized message disclosures using sparse state and release stale supervisor UI requests.

Add production-path regressions, Electron checks, isolated SQLite validation and audit evidence. Fix the SDK cleanup test fixture lifetime under garbage collection without weakening its assertions.

Validation: 6136 tests passed, 87 skipped; typecheck, lint and diff checks passed. Seven real text-model calls, current-source Linux x64 Host scenarios and large-history Electron comparisons completed.

Release note: Fix stuck runtime requests, inconsistent review results and channel delivery failures, and retain expanded details while browsing long conversations. Remote runtime fixes require an Agent build containing these changes.
This commit is contained in:
mesalogo
2026-10-05 10:25:43 +08:00
parent 126dbc57e2
commit bbf24c282a
49 changed files with 1710 additions and 106 deletions
+46 -27
View File
@@ -36,6 +36,9 @@ import type {
import { defaultKnowledgeOntologySettings } from '../shared/knowledge-ontology'
import { AssistantDatabase } from './assistant/assistant-database'
import { ChannelSettingsStore } from './channels/channel-settings-store'
import { ChannelService } from './channels/channel-service'
import { SqliteChannelOutbox } from './channels/sqlite-channel-state'
import type { ChannelDriver, ChannelInboundHandler } from './channels/channel-driver'
import { SubagentService, createSubagentRuntime } from './assistant/subagent-service'
import { ConversationAttachmentStorage } from './conversation-attachment-storage'
import { DocumentResultStorage } from './document-result-storage'
@@ -12583,8 +12586,20 @@ describe('registerIpcHandlers agent terminal state', () => {
throw new Error('Expected channel executor')
}
await expect(
executor(
const outboxDatabase = new AssistantDatabase(':memory:')
outboxDatabase.initialize('C:\\Workspace')
const outbox = new SqliteChannelOutbox(outboxDatabase)
let inbound!: ChannelInboundHandler
const send = vi.fn<ChannelDriver['send']>(async () => undefined)
const service = new ChannelService({
channel: 'wecom',
start: (handler) => { inbound = handler },
send,
stop: () => undefined
}, executor, { allowedSenderIds: ['user-1'], outbox })
try {
await service.start()
await inbound(
{
channel: 'wecom',
eventId: 'event-generated-image',
@@ -12594,34 +12609,38 @@ describe('registerIpcHandlers agent terminal state', () => {
text: '生成结果图',
mentioned: false
},
new AbortController().signal
() => undefined
)
).resolves.toMatchObject({
status: 'completed',
attachments: [
{
name: '结果图.png',
mimeType: 'image/png',
size: image.byteLength,
kind: 'image',
dataBase64: image.toString('base64')
}
],
artifactIds: [
'00000000-0000-4000-8000-000000000499'
]
})
expect(
harness.assistantDatabase.appendRemoteConversationMessage
).toHaveBeenLastCalledWith(
expect.objectContaining({
role: 'assistant',
artifactIds: [
'00000000-0000-4000-8000-000000000499'
await vi.waitFor(() => expect(send).toHaveBeenCalledOnce())
expect(send.mock.calls[0]?.[0]).toMatchObject({
status: 'completed',
attachments: [
{
name: '结果图.png',
mimeType: 'image/png',
size: image.byteLength,
kind: 'image',
dataBase64: image.toString('base64')
}
]
})
)
await harness.dispose()
expect(send.mock.calls[0]?.[0]).not.toHaveProperty('artifactIds')
expect(outbox.listUndelivered()).toEqual([])
expect(
harness.assistantDatabase.appendRemoteConversationMessage
).toHaveBeenLastCalledWith(
expect.objectContaining({
role: 'assistant',
artifactIds: [
'00000000-0000-4000-8000-000000000499'
]
})
)
} finally {
await service.stop()
outboxDatabase.close()
await harness.dispose()
}
})
it('creates a bounded result file only when the remote user explicitly requests one', async () => {