fix: remove avoidable model runtime limits

Preserve long histories and parsed attachments, expose paged process and Subagent output, isolate MCP discovery failures, and expand browser snapshots and knowledge result selection. Remove fixed Harness output and updated remote Runtime duration limits.

Keep released Agent profile and v1 bridge compatibility while enabling larger framed exchanges and optional limits for updated peers. Document remote coverage requirements and real-model boundary validation.

Release note: Long model tasks can retain more context and continue reading complete tool output; remote execution preserves compatibility with released Agents. Updated remote limits require an updated Agent and Runtime bundle.
This commit is contained in:
mesalogo
2026-09-10 03:01:21 +08:00
parent 80b0b18712
commit b01a856bae
62 changed files with 1285 additions and 465 deletions
+2 -28
View File
@@ -45,7 +45,6 @@ const maximumDocumentFileSize = 20 * 1024 * 1024
const maximumContextBytes = 12 * 1024 * 1024
const maximumContextCount = 16
const maximumAttachmentsPerMessage = 8
const maximumPromptBytes = 1024 * 1024
const supportedExtensions = new Set([
'.c',
'.cpp',
@@ -82,19 +81,6 @@ const supportedDocumentExtensions = new Set([
'.xlsx'
])
function truncateUtf8(value: string, maximumBytes: number): string {
const buffer = Buffer.from(value)
if (buffer.byteLength <= maximumBytes) {
return value
}
const marker = '\n\n[文档内容过长,已截断]'
const markerBytes = Buffer.byteLength(marker)
return `${buffer
.subarray(0, maximumBytes - markerBytes)
.toString('utf8')
.replace(/\uFFFD$/u, '')}${marker}`
}
function formatParsedDocument(
sections: ParsedDocument['sections']
): string {
@@ -170,9 +156,6 @@ export class ContextManager {
if (size === 0) {
throw new Error('所选内容为空')
}
if (size > maximumFileSize) {
throw new Error('文本内容不能超过 256KB')
}
this.assertCapacity(size)
const context: StoredTextContext = {
id: crypto.randomUUID(),
@@ -271,10 +254,7 @@ export class ContextManager {
)
return this.storeText(
name,
truncateUtf8(
formatParsedDocument(parsed.sections),
maximumFileSize
)
formatParsedDocument(parsed.sections)
)
}
if (!supportedExtensions.has(extension)) {
@@ -387,10 +367,7 @@ export class ContextManager {
attachments.push(
this.storeText(
fileName,
truncateUtf8(
formatParsedDocument(parsed.sections),
maximumFileSize
)
formatParsedDocument(parsed.sections)
)
)
} finally {
@@ -554,9 +531,6 @@ export class ContextManager {
context
].join('\n')
: request.prompt
if (Buffer.byteLength(prompt) > maximumPromptBytes) {
throw new Error('问题和上下文总大小不能超过 1MB')
}
const images = selected
.filter(