From 0a87b11f7a09be68ed31a9765931413387a3ce89 Mon Sep 17 00:00:00 2001 From: Jake Ruesink Date: Thu, 9 Apr 2026 10:56:54 -0500 Subject: [PATCH 1/2] Fix check_task schema rejected by Claude API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove top-level anyOf from check_task inputSchema — Claude API does not support oneOf/allOf/anyOf at the schema root. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/chatgpt/src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/chatgpt/src/index.ts b/apps/chatgpt/src/index.ts index cc88c57..3c159e7 100644 --- a/apps/chatgpt/src/index.ts +++ b/apps/chatgpt/src/index.ts @@ -87,7 +87,6 @@ const TOOLS = [ description: 'Polling mode: "poll" returns on new logs (default for ChatGPT widget), "wait" blocks until completion.', }, }, - anyOf: [{ required: ["jobId"] }, { required: ["sessionKey"] }], }, annotations: { title: "Check Task Status", From fb200de0c07a7a5d03d6feae761e4aaf1920a809 Mon Sep 17 00:00:00 2001 From: Jake Ruesink Date: Thu, 16 Apr 2026 12:15:51 -0500 Subject: [PATCH 2/2] Make task timeout and log cap configurable via env Long-running investigations (multi-step infra debugging, large codebase audits) routinely hit the hardcoded 10-minute TIMEOUT_MS and get cut off mid-reasoning. Operators had to rebuild the package to tune it. Add CLAWCONNECT_TIMEOUT_MS and CLAWCONNECT_MAX_LOG_ENTRIES env vars that override the module-level defaults when set to a positive integer. Invalid or missing values fall back to the prior defaults (600_000 ms and 200 entries), so behavior is unchanged unless operators opt in. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/core/src/session.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/core/src/session.ts b/packages/core/src/session.ts index 090159f..3d52f9f 100644 --- a/packages/core/src/session.ts +++ b/packages/core/src/session.ts @@ -4,9 +4,16 @@ import { classifyError } from "./errors.ts"; import { OpenClawGateway } from "./gateway.ts"; import type { CheckMode, ContinuationState, Job, JobSnapshot, TaskInput } from "./types.ts"; -const TIMEOUT_MS = 600_000; // 10 minutes +function readPositiveIntEnv(name: string, fallback: number): number { + const raw = process.env[name]; + if (!raw) return fallback; + const parsed = Number(raw); + return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback; +} + +const TIMEOUT_MS = readPositiveIntEnv("CLAWCONNECT_TIMEOUT_MS", 600_000); // 10 minutes default const POLL_WAIT_MS = 50_000; // max time check waits before returning -const MAX_LOG_ENTRIES = 200; +const MAX_LOG_ENTRIES = readPositiveIntEnv("CLAWCONNECT_MAX_LOG_ENTRIES", 200); const LEGACY_CHATGPT_SESSION_PREFIX = "agent:chatgpt:";