fix: keep tool authorization valid throughout long requests

Remove the fixed gateway capability lifetime so active requests retain knowledge, notes, browser, configuration, and custom MCP access. Preserve token validation and request cancellation or cleanup revocation, and replace the misleading knowledge expiry error with a tool authorization error.

Remove native-client clock overrides and cover long-running scoped and HTTP MCP calls. Validation: 34 focused tests passed; changed-file lint passed. Repository typecheck and lint remain blocked by unrelated manual-compaction and sidebar probe files.

Release note: Long-running Agent requests no longer lose tool access after ten minutes, including when the knowledge-base switch is off. Request cancellation and completion still revoke access.
This commit is contained in:
mesalogo
2026-09-28 21:36:41 +08:00
parent 393a07ccdf
commit 1603871f7c
6 changed files with 35 additions and 43 deletions
+1 -1
View File
@@ -9041,7 +9041,7 @@ describe('registerIpcHandlers agent terminal state', () => {
rootDirectory: join(root, 'clients'), managedNodeDirectory: join(root, 'node'),
bundledRuntimePaths: resolveBundledRuntimePaths({ appPath: process.cwd(), resourcesPath: '', packaged: false }),
npmCliPath: resolveNpmCliPaths({ appPath: process.cwd(), resourcesPath: '', packaged: false }).npmCliPath,
createGateway: () => new KnowledgeMcpGateway({} as never, { now: () => 0 }),
createGateway: () => new KnowledgeMcpGateway({} as never),
openExternal: async (url) => { opened.push(url) }
})
harness = createHarness({}, undefined, 'always', undefined, false, undefined, undefined, undefined,