feat(coding-agent): added multi-cell Python execution with persistent kernel

- Added multi-cell Python execution with sequential processing in persistent kernel.
- Changed Python tool API to use cells array instead of single code parameter.
- Renamed workdir parameter to cwd across Bash and Python tools for consistency.
- Fixed indentation adjustment logic for mixed indentation levels in patch tool.
This commit is contained in:
can1357
2026-01-21 10:20:11 +01:00
parent 7f6d4ccf80
commit a5293b2fa6
15 changed files with 203 additions and 86 deletions
@@ -40,7 +40,7 @@ describe("python tool execution", () => {
const tool = new PythonTool(createSession(tempDir.path));
const result = await tool.execute(
"call-id",
{ code: "print('hi')", timeoutMs: 5000, workdir: tempDir.path, reset: true },
{ cells: [{ code: "print('hi')" }], timeoutMs: 5000, cwd: tempDir.path, reset: true },
undefined,
undefined,
undefined,
@@ -51,7 +51,7 @@ describe("python tool execution", () => {
expect.objectContaining({
cwd: tempDir.path,
timeoutMs: 5000,
sessionId: `session:session-file:workdir:${tempDir.path}`,
sessionId: `session:session-file:cwd:${tempDir.path}`,
kernelMode: "per-call",
reset: true,
}),