feat(coding-agent): implemented shared Python gateway for efficient kernel reuse
- Added Python shared gateway setting for resource-efficient kernel reuse across sessions. - Enhanced Python tool with session-scoped kernel isolation and workdir-aware session IDs. - Added Python tool cancellation support with timeout handling and proper cleanup. - Expanded Python prelude with enhanced file operations, git utilities, and improved output handling. - Fixed AI provider message transformation for proper tool call handling and error recovery.
This commit is contained in:
@@ -20,6 +20,7 @@ function createSettings(overrides?: Partial<ToolSession["settings"]>): ToolSessi
|
||||
getBashInterceptorRules: () => [],
|
||||
getPythonToolMode: () => "ipy-only",
|
||||
getPythonKernelMode: () => "session",
|
||||
getPythonSharedGateway: () => true,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
@@ -81,7 +82,10 @@ describe("python tool settings", () => {
|
||||
|
||||
expect(executeSpy).toHaveBeenCalledWith(
|
||||
"print(1)",
|
||||
expect.objectContaining({ kernelMode: "per-call", sessionId: "session.json" }),
|
||||
expect.objectContaining({
|
||||
kernelMode: "per-call",
|
||||
sessionId: `session:session.json:workdir:${testDir}`,
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user