feat: UI parser kinds, nodeSelector textarea, step-limit session clear, per-line path redaction

- ui-parser: add thinking kind + handler for standalone thinking events, thinking
  blocks in assistant content arrays, and user-turn tool_result blocks
- job-manifest: parseKeyValueOrObject helper so nodeSelector (and labels) accept
  key=value textarea lines in addition to JSON objects
- parse: isOpenCodeStepLimitResult detects step_finish with max_turns / max_steps /
  step_limit reason
- execute: return clearSession:true when step limit reached so next run starts fresh;
  redactHomePathUserSegments moved to per-line to prevent paths split across chunks
- tests: ui-parser.test.ts (new), extended parse.test.ts and job-manifest.test.ts

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-24 22:01:35 +00:00
parent 3ed6e95085
commit 13c2a3032b
7 changed files with 413 additions and 12 deletions
+34
View File
@@ -110,4 +110,38 @@ describe("buildJobManifest", () => {
expect(result.job.spec?.template?.spec?.restartPolicy).toBe("Never");
});
it("applies nodeSelector from key=value textarea string", () => {
const ctx = { ...mockCtx, config: { nodeSelector: "kubernetes.io/arch=amd64\nkubernetes.io/os=linux" } };
const result = buildJobManifest({ ctx, selfPod: mockSelfPod });
expect(result.job.spec?.template?.spec?.nodeSelector).toEqual({
"kubernetes.io/arch": "amd64",
"kubernetes.io/os": "linux",
});
});
it("applies nodeSelector from JSON object string", () => {
const ctx = { ...mockCtx, config: { nodeSelector: '{"node-type":"gpu"}' } };
const result = buildJobManifest({ ctx, selfPod: mockSelfPod });
expect(result.job.spec?.template?.spec?.nodeSelector).toEqual({ "node-type": "gpu" });
});
it("applies nodeSelector from plain object config", () => {
const ctx = { ...mockCtx, config: { nodeSelector: { "zone": "us-east-1" } } };
const result = buildJobManifest({ ctx, selfPod: mockSelfPod });
expect(result.job.spec?.template?.spec?.nodeSelector).toEqual({ zone: "us-east-1" });
});
it("ignores blank lines and comments in nodeSelector textarea", () => {
const ctx = {
...mockCtx,
config: { nodeSelector: "# comment\n\nkubernetes.io/arch=amd64\n" },
};
const result = buildJobManifest({ ctx, selfPod: mockSelfPod });
expect(result.job.spec?.template?.spec?.nodeSelector).toEqual({ "kubernetes.io/arch": "amd64" });
});
});