A walkthrough with keep_bodies.response_body kept bodies for the first
200 requests and said nothing about the rest, so a request without a
response_body read as one that had no body (#1811; web_page_show's
outlines were fixed in #1845). The network result now counts the kept
bodies, and a response_bodies_partial limitation says how many were
left out: past the cap, after the run's deadline, or unreadable.
Co-Authored-By: htjulia <htjulia1@gmail.com>
Follow-up to #1921. A credential in a plugin argument that no flag names, such as a token in a URL, is now hidden in the failure log's command. A local server that stops answering is stopped, and what it printed is added to the error and the log, which before had no output. A failed write to a server now waits a moment for its exit to be recorded, so the error gives the exit code and output instead of a broken pipe; that race was failing the test added in #1921.
A local MCP plugin that exited before answering only said "The X plugin exited." It now gives its exit code and the last lines it printed, and a write to a server that has already gone gives the same error. When a local plugin can't be started, exits, or doesn't answer in time, a failure log is written to logs/ in the config folder and named in the error. The plugin's environment is left out of the log, and a remote plugin or a stop writes none. The failure-log writer moves to the engine crate so plugins and agent runs share it.
Aider's setup check read this computer's environment and home folder even for a run on another computer over SSH, so a working remote setup could be refused and local keys could pass a remote run that would then wait at a sign-in page. The check now runs on the host: one bounded, stoppable ssh command looks at that account's environment and Aider's settings files and returns only an exit status. Only the two definite answers refuse the run (no model or key; an OpenRouter model without its key); a check that can't run lets the run start and logs why. Not run against a real SSH host.
The hint for a tool Codex refused told the person to add a [mcp_servers.craft-anything.tools.<tool>] table, but setup writes tools as one inline table, and TOML refuses to extend an inline table that way, so Codex's config stopped parsing. The hint and docs/codex.md now say to add the tool inside tools, and a test checks that the old form fails and both valid forms parse. For #1867.
The lexer fallback, used for sources too large or too deep to parse, dropped side-effect imports such as import "./polyfill.js", which the syntax-tree path records. A string straight after the import keyword is now recorded as a static dependency with its location. Every fallback import goes through one helper that marks the list truncated past its cap and records a .node specifier as a native module, as the syntax-tree pass does.
A banner such as /*! @scope/pkg@1.2.3 */ was recorded as package pkg, losing its scope. A word that starts with @ now keeps its slash, so @scope/pkg@1.2.3 and @scope/pkg v1.2.3 keep the full name; every other word is still split on slashes, so a banner that names a package by its URL reads as before.
xtask was the one workspace member that didn't opt into the shared lints, so the repo-wide ban on unsafe code and the unwrap, expect and panic denials didn't cover the tooling. It now uses them like every other member, and a test checks that every member manifest does.
Recovering a webpack factory renames its parameters (e, t, n) to module, exports and __webpack_require__, but code inside a direct eval still used the old names, so the recovered factory threw a ReferenceError. A factory with a possible direct eval call now keeps its parameter names; indirect and optional eval calls, and mere mentions of eval, still allow the rename.
A project's inbox request and answer files were written with the default mode, usually readable by every local account, though a request can carry the person's own words and an answer a typed reply or an approval. Both are now written owner-only (0600 on Unix). Whether an answer could be forged by another local process is a separate question and is not changed here.
Addresses #1178 (which also consolidates #1277).
## The problem
The website study a build starts with opens a fresh private browser, so a web app behind a login is studied as its sign-in or landing page, and the builder then builds a sign-in page.
## What this adds
- **`web_site_sign_in { url }`** opens a visible browser window on the site. The person signs in there themselves and closes the window. The browser's profile is then saved in Craft Anything's own folder, keyed by the site's host and port. Craft Anything never sees or stores a password and still never reads cookie or storage values.
- **`web_site_open`** uses a saved sign-in for that exact host and port when there is one, by copying it into the usual temporary profile (headless as before, deleted afterwards). `signed_in: false` forces the private profile; `signed_in: true` with nothing saved is a clear error naming the sign-in tool. Nothing else about the private path changes.
- **`web_site_sign_out { url }`** forgets a saved sign-in.
- **A check right after saving.** The sign-in tool reopens the site headless exactly as a later study will, and reports whether it still looks like a sign-in page, plus a screenshot kept in the site's owner-only folder (path, hash and size are returned, not the picture, so the person's account screen is not sent to an agent).
- **Typed facts through to the builder.** `signed_in`, `signed_in_site` and `sign_in_page` are in the open result, the capture result and `capture.json`. The website briefs tell the builder the capture is the signed-in view only when it is signed in and does not look like a sign-in page. A not-signed-in capture with a password field says how to sign in; a signed-in one says the sign-in may have ended.
- The check phase opens the built site with `signed_in: false`.
Because a study already starts with `web_site_open`, a normal build of that site is signed in after one `web_site_sign_in`, with no new build option.
## Decisions for maintainers
These are policy calls I made so the change is usable; each is small to reverse.
1. **Clean room allows the two tools** (two lines in `clean_room.rs`). Reasoning: the person signing in as themselves and looking at pages is watching from outside, as a user would; `visitor_view()` strips exactly what it did before.
2. **A saved sign-in is used by default** for later opens of that site, until `web_site_sign_out`. Saving it is treated as the consent, and the tool text and evidence say so. The alternative is opt-in per study, which needs an option in the Make screen and `rebuild`.
3. **Restricted MCP mode refuses both tools even with `--allow-web`**, since sign-in opens a window on the person's desktop.
4. The saved profile sits on disk (owner-only on Unix; on Windows it relies on the per-user config folder). On Linux it is launched with the basic password store so the visible and headless launches can read the same cookies. The tool text says that anyone who can open the person's files could use the sign-in.
## Trade-offs and limits
- Needs a desktop: on a computer with no display the tool refuses at once with what to do instead.
- Sites that tie a sign-in to the browser, or expire it quickly, will capture signed out; the check after saving and the `sign_in_page` field say so.
- Session-only cookies are kept by setting the profile to continue where it left off; restored tabs are not copied.
- The saved profile can also hold single sign-on providers' sign-ins made in that window. It is used only when that exact host and port is opened.
- Screenshots and page text of a signed-in study contain the person's own account data; the evidence says so. Result URLs drop the query and fragment when a sign-in is used.
- Not in this PR (roadmap lines added under R2.9): a Make-screen button, showing the person the study's first screenshots to confirm before the builder starts, attaching to the person's running browser, refreshing a saved sign-in from a capture, and a live run on a real site and with the Snap browser.
## What was verified
Run locally on Linux (x86-64), on the branch before its final rebase onto `main` (the rebase was clean; after it: `cargo fmt --all --check`, `cargo xtask layers`, `locks`, `secrets`, `tools --check`, `i18n-coverage` pass):
- `cargo test -p craft-anything-engine` (583 passed, 12 ignored), `-p craft-anything-mcp` (22), `-p craft-anything-ai` (580, 3 ignored).
- `cargo clippy -p <crate> --all-targets -- -D warnings` for engine, mcp and ai.
- **Live, with Chromium 157 under a virtual display against a local test site** (the new `#[ignore]` tests in `site_sign_in/tests.rs`; a helper plays the person over the browser's own debugging port and closes the window):
- a sign-in made in the visible window is seen by a later headless open and capture, including an HttpOnly cookie and a session-only cookie (removing the continue-where-you-left-off setting makes that assertion fail, so the setting is what keeps it);
- `signed_in: false` and a signed-out site show the signed-out page with the private-profile limitation;
- a site that forgets the cookie is reported as still a sign-in page by the check after saving;
- two overlapping signed-in opens both work and leave the saved sign-in byte-identical;
- the timeout path stops the browser, keeps what was saved and leaves no process behind;
- with no display the tool refuses immediately.
- The two existing live website tests still pass.
**Not verified:** a real third-party site; a confined Snap or Flatpak browser (reasoned from the existing profile-location code, not run); Windows and macOS behaviour, including the browser-exit signal (the profile lock going away) and cookie decryption there; the workspace-wide `cargo xtask ci` steps and `--features wasm-plugins` (not enough disk locally, so CI is the first run of those); how the egui app shows the new tools.
An independent review pass was done before opening; its findings (copying only after the browser has exited, not treating one slow probe as a closed window, a whole-or-nothing replacement of the saved profile, reserved Windows names in site keys, owner-only permissions) are fixed in the later commits.
The MCP server's --allow-run flag treats every tool call as approved, and a client configuration that adds it did so without a word. The server now writes one line to stderr at startup when the flag is set, saying what is turned off and how to restore the approval step. The consent behaviour itself is unchanged.
The lock tracker logged a problem while holding its registry lock. The app's logger writes to a file behind one of the tracked locks, which locks the registry again, so the thread waited on itself and every other lock in the app waited behind it: the window froze for good about 30 minutes into a long tool call that other threads were waiting on. Problems are now recorded under the registry lock and logged after it is released. Fixes#1907.
Adds README.tr.md, a Turkish translation of the README, and a Türkçe link in the language switcher of the English README and every existing translation. Code blocks, commands, file names and links are unchanged; only the comments inside code blocks are translated.
Python 3.10's argparse reads -v=m "old task" as -v -m "old task", so a message saved that way in Aider's extra arguments still replaced the request in its file. An = after a single valueless short flag is now read before looking for m: the m and its message go and -v stays. Later Python versions refuse that form.
zip_has_entry scanned the whole file for central-directory signatures, so a ZIP holding backup.zip whose inner archive had an AndroidManifest.xml, or a comment shaped like a directory entry, was taken for an APK. It now searches the archive's own validated central directory with the existing parser, keeping only the matching entry and decompressing nothing.
The JSONC parser accepted carriage-return line endings, but its editor found lines by LF only, so adding a setting to a CR-only configuration brought in LF and lost the members' indentation, and removing a member left its line behind. CR now ends a line when the editor locates lines and when it removes a whole member's line, and a CR-only document keeps CR; LF and CRLF documents are unchanged.
pe_is_managed read the CLR directory past the optional header a PE file declares, so a native image with a short optional header and nonzero bytes where the directory usually sits could be taken for .NET. The optional header is now read through a slice bounded by SizeOfOptionalHeader, with the offset addition checked; PE32 and PE32+ keep their directory-count and nonzero RVA and size checks.
The MCP server sent progress notifications whenever a call carried a progressToken field, whatever it held. MCP's token is a string or a number, so a null, object, array or boolean now gets no progress notifications; a valid token still gets them, before the response.
The firmware carver read a PE's header size and certificate directory at fixed offsets without checking the optional header's declared size, so a short header could borrow bytes after it, inflate the region and carve into the next embedded object. Those fields are now read only inside the declared optional header, and a header too short for its fixed fields gives no PE region.
The hash of a signed Windows program is now checked against a second implementation: the test kit signs its fixtures with its own copy of the steps, covering gaps between sections, section order, data after the last section, sections that share bytes and 97 sections. A file that declares more sections than were read is refused instead of being hashed with some left out.
The .NET reader read the data-directory count and the CLI directory at fixed offsets without checking the optional header's declared size, so a file whose header ended earlier could be read as a .NET assembly from section-table bytes, or refused with a misleading section error. It now reads those fields only inside the declared optional header and refuses a short one as truncated.
A saved message in a short-option group was still passed to Aider: -vm "old task" means -v -m "old task", so the saved task replaced the request in its file. A group of Aider's valueless flags (-v, -h) followed by m now loses the m and its message and keeps the other flags. Any other short option is kept whole.
A new build is stopped before its first turn when its stack's program (Cargo, for Rust) isn't on this computer, but the check was skipped for any backend with an SSH host. An API builder over SSH still builds on this computer, so it found the missing program only after a whole turn. Only a coding agent over SSH, which builds on the other computer, skips the check now.
In Deep mode a build starts Ghidra's one-time analysis on its own thread, and it kept running after its project was deleted, using a core and about 12 GB of memory until the app closed. The analysis now also stops once the project's record is known to be gone, checked on its existing polls. Pausing is unchanged, and a record that can't be read for a moment doesn't stop it. Fixes#948.
A URL with no path has its first slash in the query or fragment, so https://auth.example.test?next=/graphql was read as a GraphQL endpoint; and a :// in a query made /api/graphql?next=https://x.test lose its path. A scheme now counts only before any /, ? or #, the host ends at the first of those, and run-time text in a partly literal URL ends neither.
Text read through constants joined both sides of every + as written, so '/v' + (1 + 2) read as /v12 and '/w' + 0x10 as /w0x10, both marked literal. Two numbers now add, a number literal reads as JavaScript turns it into text (0x10 is 16), and a + whose sides are neither known text nor two numbers is no longer reported as literal.
Aider handles a --message before it reads --message-file, so a --message saved in a backend's extra arguments ran instead of the person's request once the request went in a file. When the message is in a file, saved --message, --msg and -m arguments (and their joined forms) are now left out; other saved arguments are kept. With the message in argv nothing changes: it comes last and wins.
A push of [[ids], {one property}] was read as a webpack chunk whatever the object held, so ordinary code such as queue.push([[1], { callback }]) became a webpack module and marked the file as bundled. A one-property object now counts only when the property is a module factory and the file names webpack or uses its chunk-global push.
An export list marked functions exported by name among those seen so far: a list before the declaration marked nothing, and one after it marked every function of that name, nested ones included. Listed names are now resolved to bindings and matched to functions after the walk, whether the function was declared, initialised a variable or was assigned to one.
.cts and .mts got the same source type as .ts, where the parser decides between module and script from the syntax, so their reported source kind could be wrong. As in Node and TypeScript, .cts is now always CommonJS and .mts always an ES module.
When Auto mode or a project's approval setting refuses an action, the build feed now names the kind and how to be asked next time, for example /approvals publish ask for a refused push. The refusal itself is unchanged. Repeated refusals of one kind share one notice, and the next build clears old notices.
An API backend's requests per minute could only be set by editing config.toml. Settings → AI now has a field for it on each API backend, and the CLI has ai request-rate <name> [n]; zero removes the limit. Agent apps send their own requests, so they have no such setting. The save runs on a worker through the hub's usual save path.
Aider got its whole message, brief included, as one --message argument, and a builder's brief can pass Windows' 32,767-character command line, so the run failed before Aider started. A run on this computer now writes the message to a private file in the temp folder, passes it with --message-file and removes it when the run is over. Over SSH, or when the file can't be written, the message still goes in --message. Refs #402.
OpenCode's private server can answer the model check with a 503 ServiceUnavailableError while its plugins start, which stopped a question or build before it began. The check now asks once more after a two-second pause when that typed answer is what it got. Any other failure, a timeout or a stop isn't retried, and a second 503 is the error as before. For #1859.
When codex exec refused one of our tools, the feed always said to run setup --client codex, which changes nothing for a tool setup doesn't approve, such as build_command_run. For those tools the message now says how to approve the tool in Codex's own config.toml; the setup hint stays for the tools setup approves. Fixes the wrong hint in #1867.
game_unity_asset_export now takes AudioClips (Unity 5 and later). The sound is read from the .resource file beside the serialized file or inside the bundle, 256 MiB at most. A single 16-bit PCM sample in mono or stereo is saved as a WAV; anything else (Vorbis, ADPCM, a bank that isn't read) is saved as the FMOD bank it's stored in, with a limitation saying so. The output's extension is set to .wav or .fsb to match.
* engine: contain agent reads and stop auto-running generated programs
* engine: format the read-containment changes
* engine: expect deep mode reads to stay inside the workspace
* mcp: use an always-allowed action in approval-shape tests
Codex started a fresh conversation on every turn. The adapter now continues the thread Codex reported (codex exec resume) on later turns and when a saved project is reopened, with the same model, sandbox and tool configuration and the prompt on stdin. A saved thread Codex no longer has is cleared and the next turn starts fresh. Codex's --ephemeral and --worktree options are refused before a run, since neither can continue a saved conversation.
* settings: call the private-folder helper through its module
* journal: format the redaction helper
* Secure the config directory before replacing settings
Four shapes still estimated one or two levels and then overflowed the parser's stack: an else-if chain whose links end with ";", a class extends chain, a run of prefix ++, and brackets hidden in a false regex after an update operator or a member name. The estimate now counts each, and "/" after those tokens is read as division. A regex after yield is read only when it closes on the line; its brackets and operators are counted too, and a source where the regex and division readings can't be told apart takes the lexer fallback.