34 Commits

Author SHA1 Message Date
Agapenor fc93bd091e Wait for browser shutdown before cleaning private profiles (#827)
Thanks @Agapenordev! Supervised browser hand-off now waits for process-group/Job Object shutdown, and private-profile removal retries transient locks for up to five seconds. Missing profiles count as already cleaned.

Reviewed source head 6e3398d28b. Hosted Ubuntu CI is green. On AnayPC, the applicable engine/platform tests, clippy, layers, locks, secrets and wasm checks pass. Two Windows UI-automation tests also fail on pristine main because the SSH session cannot create interactive WinForms windows; their baseline and candidate failures are preserved.

Related #810 remains open: this follow-up does not establish that the broader live macOS/Brave issue is fully resolved.
2026-11-05 18:46:31 +01:00
Rares Cristea 1eb4d0afe0 Read a plugin's whole tools/list line, however long (#797)
An MCP plugin whose `tools/list` answer is one JSON-RPC line over 1 MiB never loaded: the process reader cut long lines into fragments that never parsed, so the plugin timed out. The partial-line cap is now the 16 MiB the MCP client already allows, with a regression test for a multi-megabyte line.
2026-11-04 19:29:24 +07:00
BFlat 282a4bca5c Start a program that was just written, instead of failing with Text file busy (#787)
A program whose file is busy (just written, still open for writing in a child another thread is starting, so Linux says Text file busy) is tried again for about 0.3 s before its start fails. Fixes flaky test failures and a start just after an agent's CLI updates.
2026-11-04 11:32:54 +07:00
Tanish Manku 8cf29dfa08 The keep-awake helper ends by itself once the app it serves is gone (#762)
The keep-awake helper ends by itself once the app it serves is gone (Windows checks the process every 30 s, macOS uses caffeinate -w), so closing the window during a build no longer keeps the computer awake.
2026-11-04 10:06:18 +07:00
FuryNocturnTV (Tare Fernandez) 4d6e3b01bf Look up a relative program where it starts before calling its path empty (#772)
A program started by a relative path in another folder is looked up where it starts before it's reported as a path with no file (on Unix, a script there whose interpreter is missing).
2026-11-04 10:06:07 +07:00
FuryNocturnTV (Tare Fernandez) 0fc381c206 Count Antigravity's second folder in the Windows search path test (#770)
The Windows search-path test counts Antigravity's second folder, added by #748.
2026-11-04 10:06:02 +07:00
FuryNocturnTV (Tare Fernandez) c26e6ba525 Say when a saved program path has no file there, instead of blaming PATH (#739)
A program started by its path (a saved agent program, say) with no file there says so and names the path, as possibly moved by an update, instead of "isn't installed or isn't on your PATH"; it stays a missing program, so builder turns aren't retried (refs #721).
2026-11-04 08:08:33 +07:00
Fábio Soares eb6babd593 Find Antigravity's CLI next to its own folder on Windows (#748)
On Windows, Antigravity's CLI (agy.exe) is also looked for straight in its Antigravity folder, where newer installers put it; the desktop app's own Antigravity.exe is never taken for it (fixes #737).
2026-11-04 08:08:07 +07:00
Thân Minh Nghĩa 2e0d0813e0 Ignore switched-off screens and shared PCI ids when picking the Linux GPU (#671)
On Linux a switched-off screen (a closed laptop lid) no longer counts as the one the GPU drives, and PCI ids pick a card only when no other card shares them (follow-up to #659).
2026-11-03 22:54:25 +07:00
BFlat f05f019691 Draw on the GPU that drives the screen on Linux, so laptops with two GPUs open fast and don't lag (#659)
On Linux the window is drawn on the GPU that drives the screen (the built-in panel's, or the only one with displays), so laptops with two GPUs open fast and don't lag; WGPU_ADAPTER_NAME and WGPU_POWER_PREF still decide (fixes #571). Replays #578.

Co-authored-by: Thân Minh Nghĩa <thanminhnghia3@gmail.com>
2026-11-03 21:57:08 +07:00
BFlat aeb86a69a3 Agent setup and streaming fixes: Aider, Antigravity on Windows, chat-only models, SSE limits and retries (#653)
Replays #616, #617, #619, #620 and #621. Aider isn't offered until it has an adapter, Antigravity is found under a redirected LOCALAPPDATA, servers with only specialised models aren't set up for chat, an SSE event's data is capped, and a retry keeps the original request when the agent's session can't be restored. Program lookup adds lower-case extensions on Windows.

Co-authored-by: Afloat <132809511+Afloat16@users.noreply.github.com>
2026-11-03 20:41:06 +07:00
Fábio Soares 78e1f7dce0 Say where a program is when it is there but can't start, instead of "isn't installed" (#583)
A program that is on disk but can't start (an npm script whose node is missing) says where it is and what to check, instead of "isn't installed"; on Windows an .exe is started by the path it was found at (refs #152, #95).
2026-11-03 20:15:01 +07:00
Fábio Soares b9c4c53099 Find Hermes Agent's native Windows install when the app's PATH is older than it (#585)
Hermes Agent's native Windows install (%LOCALAPPDATA%\hermes\bin) is found even when the app's PATH predates it (refs #116).
2026-11-03 20:14:49 +07:00
NetterSilver 0cff0f4336 Keep-awake helper test accepts a stop that arrives after the connection (#629)
Fixes a flaky platform test: on macOS an accepted socket inherits the listener's non-blocking mode, so the keep-awake stand-in helper dropped a stop that arrived after accept.
2026-11-03 20:14:14 +07:00
BFlat 3ee1642770 Serve previews only to this computer, stream their files and bound their connections (#649)
Replays #597, #598, #600 and #601. The preview server answers only requests addressed to this computer, streams files, sends no body for HEAD on a missing file, caps open connections and gives a request head one deadline.

Co-authored-by: Afloat <132809511+Afloat16@users.noreply.github.com>
2026-11-03 20:07:33 +07:00
Afloat 925d4737d1 Wait for keep-awake cleanup before a rebuild reports it finished (#541)
The rebuild releases its keep-awake helper before reporting Finished, and dropping the guard waits up to five seconds for the helper to stop (logging if it doesn't), so a CLI that exits right away no longer leaves it running.
2026-11-03 14:49:55 +07:00
phatloi0010 87b191a6be Capture teardown stops surviving group helpers after a normal leader exit (#387)
Capture teardown stops a helper left in the process group after the leader exits normally. Fixes #361.
2026-11-02 23:10:03 +07:00
BFlat 09fdc72e8d Saves from two threads at once never collide or mix a project file (#311)
The engine had its own `write_atomic` (used for `craft.json`, the inbox, reports and session files). Its temp file was named by process only, so two threads saving the same file at once wrote into one temp file. One rename then found it gone ("craft.json: No such file or directory"), and the file could end up with two versions mixed ("trailing characters").

The engine now uses the platform crate's `write_atomic`, which already gave each write its own temp file and kept the file's permissions. It also gains the engine's short retry when Windows briefly can't replace a file another program holds open. There is one atomic writer now; docs/pitfalls.md says so.

**Verified:**
- A new engine test: four threads each save one file 50 times and read it back. Every save succeeds, every read is one whole version, and no temp files are left. It fails against the old engine writer (checked) and passes now.
- The existing "file held open for a moment" test still passes.
- `cargo test -p craft-anything-engine` (397), the platform fs tests, clippy on both crates and fmt.

**Not covered:** two saves that overlap can still each start from what was on disk, so the later one wins for fields that aren't the person's (the person's fields are kept, as before). That's separate from the write itself.

Fixes #273
2026-11-02 14:45:46 +07:00
BFlat 27d93b9ae3 A capture's timeout stops every process in the group, not just the leader (#246)
On a timeout with a grace period, a capture sent SIGTERM to the group, then waited only for the leader. When the leader exited, it skipped the SIGKILL, so a helper in the group that ignores SIGTERM kept running after the capture returned (reported as `still_running` / `incomplete`).

Now the grace period waits for the whole group to be gone, reaping the leader as it goes so a zombie doesn't count. Whatever is left afterwards gets SIGKILL. `settle` uses the same group check.

**Verified:**
- A new Linux/macOS test with the reporter's helper (ignores TERM and HUP, outlives the leader): the capture must settle, verify cleanup and report SIGKILL.
- `cargo clippy -p craft-anything-platform --all-targets --target x86_64-unknown-linux-gnu -D warnings`, fmt.

**Not verified locally:** this machine is Windows without WSL, so the new test first runs in CI (Ubuntu). macOS isn't run; it uses the same code.

Fixes #230
2026-11-02 13:39:04 +07:00
BFlat 07fe869dc4 A same-size rewrite of an unhashed file reads as unknown, not unchanged (#241)
A runtime capture compared a file's size, type and hash. When the file was over the hashing budget (or couldn't be read), neither snapshot had a hash, so a rewrite at the same size was reported as `unchanged`. Now:

- such a file is `unknown`;
- a file is `modified` only when its size or type changed, or both hashes exist and differ;
- a symlink pointed somewhere else with a target of the same length is `modified` (only the target's length was compared before).

**Verified:** a new unit test of `effects` (unhashed on either side, equal and different hashes, a size change, symlink retargets); `cargo test -p craft-anything-platform` (47 passed), clippy, fmt. The test runs on every OS, unlike the shell-based capture tests.

**Not verified:** a live run of the issue's capture probe on macOS.

Fixes #229
2026-11-02 13:24:22 +07:00
GGWA fff225d319 The Windows pipe gap in project_play is noted in its tool help and kept as an ignored test (#212)
project_play's help says that on Windows a started program inherits the caller's output pipe (#207), and the reproducing test is kept in platform as an ignored test.
2026-11-02 11:28:57 +07:00
BFlat 69c0b8c9be Find coding agents npm installed under a custom prefix (#139)
npm's global prefix, from NPM_CONFIG_PREFIX or prefix= in ~/.npmrc (its bin folder outside Windows), is searched after PATH with the other usual folders, without running npm. Fixes #132.
2026-11-02 02:37:17 +07:00
BFlat 8c3532d94c Test that a stopped stand-in frees its port where the server is, without racing other tests (#136)
The engine test no longer connects to the stopped stand-in's port, which another parallel test could be handed; platform::standin_server tests that dropping a server frees its port, trying it for a moment.
2026-11-02 02:09:00 +07:00
BFlat 01994f0622 A program run in a console on Windows doesn't lose what it wrote on a busy computer (#126)
console_text waits for the program's output to arrive and settle before closing the console, waits up to 15 s for it, and says so instead of returning an empty screen.
2026-11-02 01:11:03 +07:00
BFlat 9c93f3a8ba Find coding agents in OpenCode's install folder and under nvm (#120)
~/.opencode/bin, ~/bin and the bin folders of nvm's Node versions (newest first) are searched after PATH with the other usual folders, so a desktop-started app finds OpenCode from its own installer and agents npm installed under nvm.
2026-11-02 00:39:38 +07:00
valère didon 26bf3635f1 Frida lists devices and processes on Windows instead of hanging or finding none (#59)
frida_devices_find runs frida-ls-devices in a pseudo console on Windows, where it crashed on pipes and hung; frida_targets_list falls back to plain processes; device columns split on two spaces. Fixes #58.
2026-11-01 23:05:18 +07:00
Justin John 1c7a7b8ef1 Look for Claude Code where WinGet installs it (#65)
WinGet's Links folders, per user and machine-wide, join the folders searched after PATH, so an app started before a WinGet install of Claude Code still finds it.
2026-11-01 19:32:29 +07:00
muraa-p 793e47ce0f Find the Windows shim, not npm's POSIX script, for a bare program name (#51)
On Windows, which() tries PATHEXT names before the bare name, so npm's .cmd shim is found instead of the extensionless POSIX script beside it (#41).
2026-11-01 18:40:44 +07:00
BFlat 70b11ba6e2 A program that crashes is named by its error, not the last line of its stack trace (#26)
When a coding agent or tool crashed with a stack trace, the error's headline was the trace's last
frame ("OpenCode stopped with exit code 1: at <anonymous> (/$bunfs/root/chunk-….js:96:6417)"),
which says nothing about what went wrong. The headline is now the line above the trace (searched
in all of stderr, since a trace can outrun the excerpt), with Java's "Caused by" and Node's
version footer handled; output without a trace keeps its last line.

Refs #15
2026-11-01 14:36:52 +07:00
BFlat b43d1e8d14 Coding agents installed with npm on Windows start instead of "isn't on your PATH" (#23)
npm installs Gemini CLI, Codex and often Claude Code on Windows as .cmd shims. They were found,
but Rust starts only .exe files by bare name, so every build stopped with "gemini isn't installed
or isn't on your PATH". An npm (or pnpm) shim's script now runs with Node directly, so a prompt
with line breaks or over cmd.exe's 8191 characters arrives whole; any other batch file starts by
its full path. The usual Windows install folders (~\.local\bin, npm, bun, cargo) are searched
after PATH.

Fixes #18
2026-11-01 14:34:51 +07:00
Brandon Thomas 292d5af06e Stop deadlocks as they form and watch every lock for one that never lets go (#5)
* Stop deadlocks as they form and watch every lock for one that never lets go

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

* Give the stuck-lock banner's test a program of its own

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:28:16 -04:00
Brandon Thomas 6a120011a1 Explain failed agent runs, keep a log to open, and stop offering git servers as computers (#3)
* Explain failed agent runs, keep a log to open, and stop offering git servers as computers

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

* Fix a lock-up: the build's agent setup took the session lock twice in one statement

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:27:44 -04:00
BFlat 62700f5c69 Built by no longer offers a GitHub SSH key as a computer, and finds Claude Code on a Mac opened from the Dock (#4)
SSH hosts that point at a git server (named after one, or with its HostName or User git) are left out of the AIs found on the computer and the remote-machine picker. Programs are looked up and started with PATH plus the usual install folders (~/.local/bin, Homebrew, npm, bun, volta, cargo), which a Mac app opened from the Dock doesn't get.
2026-10-31 23:48:53 +07:00
Brandon Thomas f64ae3bf3c Craft Anything
A native, pure-Rust app that shows anyone how a piece of software works, with
evidence-backed answers, then helps them rebuild it. It ships a desktop app, a
CLI and an MCP server, all driven by one engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 10:52:14 -04:00