Skip to content

v3.43.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Oct 06:43
· 1 commit to main since this release
7893dc5

v3.43.0 — 2026-10-29

Added

  • OCP runs natively on Windows, on the default -p path (#529). No request handler is modified, but two helpers change client-visible output, so the class is stated per helper instead of declaring "not endpoint-touching". sanitizeError changes error text on /v1/chat/completions (JSON and SSE error bodies, and the structured-output refusal text): Class B.1, OpenAI's published Error object (components.schemas.Error in openai-openapi, spec version 2.3.0 as read 2026-10-21: message is a required string with no stated content constraint; the refusal text is ChatCompletionResponseMessage.refusal, a string|null with none either), authorized by ADR 0006; no field is added, removed or retyped. SPAWN_HOME_DIR changes /health spawn.home only when HOME is unset, where it was the relative path undefined/.ocp/spawn-home and is now the real home: Class B.2, ADR 0006 (grandfathered as of v3.16.4), route (a); the field already meant "the scratch HOME path when isolated" and now says so truthfully. Tested on Windows 11 with Node 24 and the native-installer claude.exe.
    • Home paths come from os.homedir(), because native Windows shells and services usually leave HOME unset.
    • Isolated spawns also set USERPROFILE on win32. claude.exe reads its config dir from USERPROFILE and ignores HOME, so without this an "isolated" spawn loaded the operator's real ~/.claude.
    • killChildTree runs taskkill /PID <pid> /T /F on win32, so grandchildren holding the stdout pipe are reaped (the #474 shape). SIGBREAK triggers graceful shutdown; claude spawns pass windowsHide.
      • It does not taskkill a child that has already exited (exitCode or signalCode set). The #500 SIGKILL escalation is never cancelled on win32, because there is no process group to check, so at the two sites that arm it (request timeout, tool quiesce) it used to fire 5 s after the SIGTERM and run taskkill /PID <old pid> /T /F on a pid Windows may already have reused, force-killing an unrelated process tree. Found by an external review of 566b936 (finding M1) before any release carried it. killChildTree moved from server.mjs to lib/child-tree.mjs so the win32 branch is testable; the POSIX branch is unchanged.
    • The keychain lookup (security) and POSIX mode tightening are skipped on win32; on Linux and macOS both are unchanged.
    • sanitizeError also redacts drive-letter (C:\…, C:/…) and UNC (\\server\share\…) paths in client-visible error messages, on every platform, so the suite pins the patterns on Linux CI. POSIX paths are redacted exactly as before; what changes on Linux and macOS is that non-path text shaped like those (x:\y, c:/tmp, \\name\…) also becomes [path]. A single pair of backslashes followed by text without a third one (an escaped regex such as "\\d{3}") is not taken for a UNC path; a repeated pair such as a\\b\\c is, and the run from the first pair to the next whitespace, quote, <, > or | becomes [path] (a\\b\\c tail gives a[path] tail).
    • CLAUDE_TUI_MODE=true is refused at boot on win32, since TUI mode needs tmux and /bin/sh hooks.
    • setup.mjs works on Windows: the claude probes no longer redirect to /dev/null, where claude picks the .exe, and a start_ocp.cmd launcher replaces start.sh. No auto-start is installed on Windows, so setup no longer waits for a health check.
    • Not included: Windows auto-start, and ports of the bash ocp / ocp-connect CLIs. README § "Quickstart → Windows".
  • OCP_ALLOWED_ORIGIN_SCHEMES: admit browser extensions by origin scheme (#528). A Firefox extension calls OCP from moz-extension://<id>, and that id changes per install and per profile, so declaring it in OCP_ALLOWED_HOSTS admits one install and the 403 forbidden_origin comes back after a reinstall. The new variable (comma-separated, e.g. moz-extension, chrome-extension) admits every origin of a listed scheme through the inbound origin gate (reason declared-scheme in the gate's verdict; the log carries a reason only for a rejection, as origin_rejected) and echoes the origin in Access-Control-Allow-Origin; boot prints the admitted schemes. http and https are refused as entries, because they would admit every web page, and refused entries are reported at boot. Declaring a scheme admits every extension of that scheme, and with the default CLAUDE_ALLOWED_TOOLS any of them can run tools on the host; to admit one extension, keep declaring its id in OCP_ALLOWED_HOSTS. Unset (the default), nothing changes.
    Class Hybrid, ADR 0023 (Accepted), amending ADR 0019 and ADR 0020; ADR 0006 route (b). A semantics change on the gate in front of every endpoint: with the variable set, a request from a declared-scheme origin that received 403 now executes. No field and no endpoint is added, and the B.2 key-set snapshot is unchanged.

Fixed

  • README now states that the CLI's environment section names the OCP host, not the client (#532). claude writes the spawn's working directory, platform, shell and OS into its own system prompt, and no supported flag removes it when OCP supplies the system prompt, so a model serving a client's tool turn is shown the host's directory. Measured with CLI 2.1.310: claude-haiku-4-5 put the host path into a write_file call in 10 of 10 requests even when the client's system message stated its own directory, and claude-sonnet-5-5 followed the client. A prompt sentence attributing the section to the host was tried and dropped. In an interleaved A/B, two wordings each made claude-opus-4-6 answer with the host directory in 8 of 8 requests where main did so in 1 or 3 of 8, and neither changed haiku's 10 of 10. The fix is documentation only. The same section's "workload fit" paragraph is rewritten. It still said a client-machine coding agent cannot use a LAN OCP because "tools execute on the OCP host", which stopped being true in v3.34.0 (ADR 0022).

  • AGENTS.md § "What this project is" now says what ADR 0021 decided. ADR 0021 (2026-09-09) records that it amends that paragraph's "explicitly not an extension layer", but the paragraph was never changed, so a reader of AGENTS.md still got the pre-0021 framing, with no mention that OCP serves tool calling at all. It now states both halves. OCP does not invent surface Anthropic does not expose. It is an agent backend whose clients' declared tools run on the client (ADR 0022). Documentation only.

  • A request whose newest message cannot fit the model's prompt budget is refused with 400 context_length_exceeded instead of being answered without its question (ADR 0024, amending ADRs 0009/0011). Class B.1 (/v1/chat/completions), ADR 0006; the error body carries all four fields of OpenAI's Error object (components.schemas.Error, openapi 2.3.0: type, message, param, code). The budget trims history newest-first, and when the newest message alone did not fit it kept nothing: measured on 566b936 with a fake claude recording its stdin, one 700,000-character message to a 600,000-character model reached the CLI as the 68-character note [System] Note: 1 older messages were truncated to fit context limit. and the client got a 200; with an image in the turn, the head of the message was cut off instead. Both now refuse, decided in the handler before the quota gate, the counters, the cache and the spawn (so stream: true gets a JSON 400 too), and logged as prompt_refused with stage: "preflight". The 400 states the budget and how many characters the newest message could have had, everything else in the request unchanged. Over-budget history is still trimmed exactly as before. Where the line sits: on the text path a single message is served up to the budget minus any continuation note the lane appends, and with history present the newest must fit in budget − system − 202; on the image path its text, with the two-character separator in front of it, must not exceed the budget. In TUI mode system messages count against it; on -p they travel in the system-prompt file and do not. Found by an external review of 6cf0198 (R4).

  • Cache and single-flight keys no longer collide, and an assistant turn with tool_calls and no content is answered instead of hanging. Found by an external review of 6cf0198 and reproduced here before the change (a real server.mjs against a fake claude, each case with a control that differs in one thing). Two defects in one function, cacheHash:

    • No framing, and a partial view of the message. role, content, the sampling options and the model were fed to the hasher back to back, so a user turn reading aassistantb and the two turns a / b produced the same key; and only role and content were read, so two histories that differed only in a tool call's name or arguments shared one. Reach: with CLAUDE_CACHE_TTL set (it is off by default) the second caller was served the first caller's answer, streamed or not; and with the cache off, a structured request (response_format) joins an in-flight request with the same key, so two concurrent callers with different histories shared one spawn and one answer. The API key id is part of the key, so keys never shared with each other; callers with no database key (auth none or shared, the admin key, anonymous) share the anon pool.
    • A message with no content key threw. OpenAI's assistant message makes content optional when tool_calls is present, and cacheHash handed undefined to the hasher. The throw escaped the async request callback, so the client received no bytes and the socket stayed open (unhandled_rejection in the log; /health unaffected). Reach: a structured request (response_format) on any configuration, and a plain request with the cache on. A plain request with the cache off was never affected, and content: null or "" was always answered.
    • Both halves exclude requests that carry a session_id / conversation_id or a cache_control part, and plain requests that declare tools: none of those reaches cacheHash.

    Class B.1, ADR 0006. Authority: OpenAI's openapi components.schemas.ChatCompletionRequestAssistantMessage (https://raw.githubusercontent.com/openai/openai-openapi/manual_spec/openapi.yaml, spec version 2.3.0, read 2026-10-21): required is [role] alone, and content is "Required unless tool_calls or function_call is specified", so the request that used to hang is valid input. The key is now the SHA-256 of one JSON document of fixed arity, tagged v3, with each message hashed whole rather than by a list of fields; JSON framing is injective over strings, finite numbers and null (-0 and an overflowing literal such as 1e400 serialize as 0 and null, as they did under the old JSON.stringify(m.content)), and a list of "the fields that matter" would be a second copy of what messagesToPrompt and renderToolTurn read. No request or response shape changes; GET /cache/stats and DELETE /cache are unchanged.

    Upgrade effect. Rows written under the old key are unreachable, so the cache starts cold once; they age out through the existing TTL cleanup (every 10 minutes), and GET /cache/stats entries counts them until then. A client that attaches a per-request-varying extra field to its messages now partitions the cache by it, where before only role and content counted. Not included: answering at the HTTP boundary when any other handler throws asynchronously (it would change what every endpoint does on an internal error, which is a separate decision).

  • /logs, and so ocp logs, read a file the installed service never writes, and answered 500 (#514). setup.mjs points launchd's StandardOutPath and systemd's StandardOutput=append: at ~/.ocp/logs/proxy.log; handleLogs read ~/.openclaw/logs/proxy.log. It now reads the service's file first and falls back to the old path only when the first does not exist, so a host whose log is still there keeps working and a stale legacy file cannot shadow the live one. Any other failure on the service's file (say a permissions error) is reported as it is rather than read past, and when neither file exists the 500 has the same { "error": "Cannot read log: ..." } body, now naming ~/.ocp/logs/proxy.log.
    Class B.2, ADR 0006 (grandfathered as of v3.16.4), route (a). Request shape (n, level), response shape (count, level, entries[]) and error shape are unchanged; the endpoint documented itself as "recent proxy log entries" and now returns them on a real install. The mismatch is not new: at v3.16.4 (git show v3.16.4:server.mjs, handleLogs) the handler already read the old path while git show v3.16.4:setup.mjs already wrote the service log to ~/.ocp/logs/proxy.log, so the grandfathered snapshot is the defective behaviour. ADR 0012 is not engaged: no field is added, and docs/governance/b2-response-keys.json is unchanged.
    It stayed hidden because scripts/b2-key-snapshot.mjs seeded the old path in its fixture; the fixture now seeds ~/.ocp/logs/proxy.log, and a mutation that puts the handler back on the old path turns node scripts/b2-key-snapshot.mjs red. No new env var.