Skip to content

fix: save new chats, find npx and hide agent consoles on Windows - #59

Merged
cu-e merged 6 commits into
masterfrom
claude/great-mccarthy-o50r1d
Nov 10, 2026
Merged

cu-e merged 6 commits into
masterfrom
claude/great-mccarthy-o50r1d

Conversation

@cu-e

@cu-e cu-e commented Nov 10, 2026

Copy link
Copy Markdown
Owner

What

  • Chat history on Windows (nocterm-localfs): strict directory capabilities now hold a handle to every ancestor, opened without FILE_SHARE_DELETE and with FILE_FLAG_OPEN_REPARSE_POINT. Their identity (volume serial + file index) is native, so new v3 chats save in every environment/context (ThisComputer/HubAccount × General/Project). Reparse points (junctions, symlinks, mount points) are refused. Partition and owner checks and atomic publication are unchanged.
  • Save error text (agent-runtime, agent-chat): a failed save is classified from its typed cause chain as unsupported storage / full volume / access denied / other. Only a full volume suggests freeing disk space. Queued messages stay queued in every case.
  • npx on Windows (nocterm-ai, nocterm-acp): the agent environment allow-list matched names case-sensitively, so Windows' Path was dropped and npx was never found. On Windows, names now match without case and are stored in a single spelling. If a bare command isn't on PATH, the usual Node.js locations are searched too. Resolved paths keep the C:\ form that cmd.exe accepts.
  • No console windows (nocterm-acp): the agent process and taskkill start with CREATE_NO_WINDOW.
  • ADR 0162 (amends 0110) and ADR 0163; Windows CI job now runs localfs, ai and agent-storage tests and the native chat-history test.

Why

On Windows 4.1.0, every new chat failed to save with "This environment requires held native storage directory capabilities… check disk space". The queue paused for good. Users also had to type the absolute path to npx, and console windows popped up whenever a chat started an agent.

How it was verified

Linux: cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo xtask architecture, cargo xtask docs --check, notice inputs check. Tests for localfs, ai, acp, agent-runtime, agent-chat and agent-storage pass, except one test that already failed on master here: explicit_cancel_reports_permission_failure… fails when run as root. The app tests native_chat_history, agent_process and agent_history* pass. Windows target: cargo clippy --target x86_64-pc-windows-gnu -D warnings for localfs, ai, agent-storage, agent-runtime and agent-chat with all targets, and for acp as a library only (acp's test targets already have unused-import warnings on Windows). Native Windows tests run in the CI Windows job.

Notes for the reviewer

Not verified by hand in a real Windows GUI session.


Generated by Claude Code

New v3 chats need held directory capabilities, which Windows never supplied: every save
of a new chat was refused and its queue paused. A strict capability now keeps a handle to
every ancestor, opened without delete sharing and as a reparse point, so no held directory
can be renamed or replaced by a junction while it lives; its identity comes from the
handle's volume serial and file index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAgRyZmbmoaRukKppczMRc
Every failed save advised checking disk space, including a missing storage capability.
The runtime now classifies the typed cause chain as unsupported storage, a full volume,
refused access or another failure, and only a full volume suggests freeing space. Queued
messages stay queued in every case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAgRyZmbmoaRukKppczMRc
The agent environment allow-list compared names case-sensitively, so Windows' `Path`
was dropped and `npx` was never found without an absolute path. Names now match without
case on Windows and get one spelling, and bare commands also search the usual Node.js
locations. Agents and taskkill start with CREATE_NO_WINDOW, so a GUI build no longer opens
console windows when a chat starts or stops an agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAgRyZmbmoaRukKppczMRc
Runs the chat repository on the production LocalFilesystem for every environment and
context, including restart and queue recovery, and refuses a junctioned account partition
on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAgRyZmbmoaRukKppczMRc
ADR 0162 amends 0110: Windows supplies held directories for v3 chat history. ADR 0163
covers the agent environment, Node.js fallback locations and windowless start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WAgRyZmbmoaRukKppczMRc

cu-e commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Build and test failed in tests/agent_process.rs::service_guardian_cleans_cgroup_when_owner_is_killed (Linux-only, systemd agent-host): EOF while parsing a value when reading the agent's environment file right after its pids file appeared. This PR doesn't touch that path — the test spawns nocterm agent-host via systemd-run directly, and process/host.rs and systemd.rs are unchanged; the test passed locally on this head. It looks like a timing race between the script writing pids and environment. I've re-run the failed job once; if it fails again I'll treat it as real and fix the test's wait.

The Windows job passed, including the new native tests (native_chat_history: 3 passed on a real Windows filesystem, junction refusal included).


Generated by Claude Code

@cu-e
cu-e merged commit a1d4e62 into master Nov 10, 2026
16 of 18 checks passed
@cu-e
cu-e deleted the claude/great-mccarthy-o50r1d branch November 10, 2026 20:20
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