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
+39 -1
View File
@@ -361,12 +361,50 @@ describe('CdpBrowserDriver', () => {
expect(snapshot.truncated).toBe(true)
expect(snapshot.nodes.length).toBeGreaterThan(0)
expect(snapshot.nodes.length).toBeLessThan(500)
expect(Buffer.byteLength(JSON.stringify(snapshot))).toBeLessThanOrEqual(
expect(Buffer.byteLength(JSON.stringify(snapshot))).toBeGreaterThan(
128 * 1024
)
expect(Buffer.byteLength(JSON.stringify(snapshot))).toBeLessThanOrEqual(
512 * 1024
)
driver.dispose()
})
it('keeps useful nodes beyond 500 and their actionable references within the byte budget', async () => {
const nodes = Array.from({ length: 3_000 }, (_, index) => ({
nodeId: `node-${index}`,
backendDOMNodeId: index + 100,
role: { value: 'button' },
name: { value: `Item ${index} ${'x'.repeat(50)}` }
}))
const harness = createHarness((method, parameters) =>
method === 'Accessibility.getFullAXTree'
? Promise.resolve({ nodes: [
...Array.from({ length: 600 }, (_, index) => ({
nodeId: `ignored-${index}`, ignored: true
})),
...nodes
] })
: standardCommand(method, parameters)
)
const driver = new CdpBrowserDriver(harness.webContents)
try {
const signal = new AbortController().signal
const snapshot = await driver.snapshot(signal)
expect(snapshot.truncated).toBe(false)
expect(snapshot.nodes).toHaveLength(3_000)
const bytes = Buffer.byteLength(JSON.stringify(snapshot))
expect(bytes).toBeGreaterThan(128 * 1024)
expect(bytes).toBeLessThanOrEqual(512 * 1024)
await driver.click(snapshot.nodes.at(-1)!.ref, signal)
expect(harness.sendCommand).toHaveBeenCalledWith('DOM.describeNode', {
backendNodeId: 3_099, depth: 0, pierce: false
})
} finally {
driver.dispose()
}
})
it('rejects a snapshot crossed by main-frame navigation', async () => {
const harness = createHarness(async (method, parameters) => {
if (
+2 -3
View File
@@ -16,9 +16,8 @@ import {
} from './browser-limits'
const DEFAULT_TIMEOUT_MS = 15_000
const MAX_AX_NODES = 500
const MAX_AX_DEPTH = 20
const MAX_SNAPSHOT_BYTES = 128 * 1024
const MAX_SNAPSHOT_BYTES = 512 * 1024
const SELECT_OPTION_FUNCTION = `function (expectedValue) {
const options = Array.from(this.options);
const option = options.find((candidate) => candidate.value === expectedValue);
@@ -228,7 +227,7 @@ export class CdpBrowserDriver {
) {
this.debugger = webContents.debugger
this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS
this.maximumAxNodes = options.maximumAxNodes ?? MAX_AX_NODES
this.maximumAxNodes = options.maximumAxNodes ?? Infinity
this.maximumAxDepth = options.maximumAxDepth ?? MAX_AX_DEPTH
this.maximumSnapshotBytes =
options.maximumSnapshotBytes ?? MAX_SNAPSHOT_BYTES