Repository navigation
fix(agent): keep a read-only shell from fencing a session; build(make): install-local - #1326
Merged
Merged
Conversation
[profile.local] (added in 464b75b) keeps release optimisation but drops ThinLTO and reuses the incremental cache. It had no make wrapper, so using it meant remembering the exact cargo invocation and package name. Add two targets that are pure additions; no existing target changes: build-cli-local: cargo build --profile local -p future-cli build-desktop-local: cargo build --profile local -p futureos They exist for local verification only and deliberately stay out of `install*` and `package-desktop`: what ships must keep coming from the unchanged `release` profile. They also do not wrap the frontend build or the Tauri bundling `build-desktop` does — they produce the Rust binaries under target/local/ only. Measured in a fresh worktree (cold target directory, sccache warm): build-cli-local 244 s cold, 4.5 s after a one-line edit; build-desktop-local 4 m 42 s cold, 20.6 s after a one-line edit. `cargo build --release` on the same one-line edit takes ~137 s for the CLI, almost all of it ThinLTO.
The closed magnifier was 28px and the field that replaced it 32px, so clicking it grew the row 4px: the list below jumped and the compact device picker beside it re-centred 2px down. The field now takes the glyph's height, which is also the switch band's and the picker's.
…show The crash-log unit tests render and append by hand, so a hook that is never installed — or installed before the home can be resolved — still looked covered. The new case runs this same test binary as a child with its own `FUTURE_HOME`, panics in it, and asserts the file exists with `file:line`, the payload, the startup step and exit code 101 — the code Windows reports as no crash at all, and the reason the file has to be there. Also fixes `the_crash_log_is_a_sibling_of_the_host_log`, which read the process-global home twice: a sibling fixture publishing its own `HOME` between the reads made it fail in the full suite while passing alone. It now holds `HomeGuard`'s lock, the same way the other home-comparing fixtures do.
A launch that panics leaves `<root>/app/logs/crash.log`; the troubleshooting section named only `desktop.log` and `desktop.prev.log`, so the file a reader needs after "it never came up" was undocumented.
…ation
`make install` already builds `future` and `futureos` together — through
scripts/build/build-desktop.mjs, so they share one dependency graph and one
feature unification — but it runs the release profile, and release carries
`lto = "thin"`, which makes every edit recompile the graph under LTO.
`build-local` gives the same selection on the LTO-free `local` profile:
cargo build --profile local -p future-cli -p futureos --bin future --bin futureos
One invocation matters for the same reason it matters in build-desktop.mjs:
selecting both packages at once keeps shared crates compiled once and keeps
feature unification aligned with the shipping build, instead of two runs that
disagree and recompile each other's dependencies.
It writes target/local/{future,futureos} only. It does not install into PREFIX,
stage the Desktop sidecar, build the frontend or bundle — `make install*` and
`make package-desktop` keep owning those, unchanged.
Measured in a fresh worktree: 327 s cold for both binaries; afterwards a
one-line CLI edit rebuilds both in 3.7-3.8 s and a one-line Desktop edit in
3.4 s.
No platform-specific syntax: the target is the same three lines on Windows,
macOS and Linux, and `profile.local` lives in the root Cargo.toml.
…ttings The name and the icon are this machine's own record of a paired computer — `remote_peer_set_label` writes the local credential book and never reaches the desktop — so editing them belonged on the row that shows them, not on a page that is otherwise entirely "read the host, write the host". There they read as one more remote setting, and were unusable exactly when someone renames a machine: while it is offline. Edits now open from a pencil beside the name and save one patch with only what changed, then re-read the list so the row shows it. The dialog is the only place these two values are edited; the settings page's copy is gone, so two surfaces can no longer disagree about one name. With nothing local left on it, that page needs a live connection to be worth opening at all, so the row's Settings button is also disabled when the machine is not connected — with the reason on the wrapping span, the same way the takeover hint works, because a disabled button receives no pointer events of its own.
# Conflicts: # Makefile
…keys The shortcuts page listed seven categories in taxonomy order, three of them one or two rows long, with the Vibe panel's thirty-odd keys in the middle of the scroll. Sections now follow frequency instead: conversation and navigation first, the small groups sharing a heading (panels + terminal; palette + Settings), and the panel last, closed until asked for. A section heading folds its rows and reports how many keys are behind it, and how many of them have been changed — a folded section must not be able to hide the customisation this page exists to report. A search opens every section before it filters, so a match is never folded away and read as 'no matches'. The cheat sheet walks the same sections, so the sheet and the page that edits it list the keyboard in one order.
`build-local` writes target/local/{future,futureos} and stops there, so the
build is invisible to a shell: the Desktop agent prepends its own directory to
PATH (agent/src/tools/shell/execution.rs path_with_own_dir), which means skills
and shell tools resolve `future` next to whatever binary launched them. To use a
local-profile build from the app, both binaries have to sit in the same
directory the app runs from.
`install-local` builds both without LTO and copies them to PREFIX — the same
destinations `install-cli`/`install-desktop` use (`%USERPROFILE%\.future\bin`,
`/opt/homebrew/bin`, `/usr/local/bin`) — so launching the installed `futureos`
resolves `future` beside it.
It is deliberately not a release install: `make install*` keep owning PREFIX for
shipping builds and the two overwrite each other. Skills are untouched
(`make install-skills` remains separate), and no frontend build, sidecar staging
or bundling happens.
The Windows branch copies through node instead of `copy`. make runs every recipe
through SHELL, which is sh.exe whenever Git for Windows is on PATH — there the
cmd builtins (`if not exist`) are a syntax error and unquoted backslash paths are
eaten by bash, which is why the existing Windows recipes in this file cannot run
in that shell. node is already a build prerequisite (the TARGET probe uses it)
and handles quoting, path joins and directory creation in both shells. The POSIX
branch keeps `install -m 755`, whose fresh inode macOS taskgated needs.
Measured on Windows from a worktree: cold `make install-local` 498 s (same cold
build as build-local), an unchanged rerun 3.3 s, and a one-line CLI edit 8.3 s
through compile, install and both copies.
Recovery treated every tool call without a recorded result as an unknown side effect, so pressing stop while a read-only command like git worktree list was in flight fenced the whole session: every non- ead tool was refused for good. Classify a shell call by whether its text can change anything observable instead of by whether a result was recorded. command_is_read_only proves it from the command text only (never from the model's claim), conservatively: every chain, pipe and newline segment must be a whitelisted program with a whitelisted subcommand, no segment may redirect, and command substitution, grouping, stop-parsing, &, assignments and interpreters stay fenced. write/edit verification is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes from two sessions, each verified in its own worktree and merged into
dev-huichen; this PR carries them tomain. The rest of the branch's commitsare already on
main(the remote-peer row editing landed as #1325), so theeffective diff here is
agent/src/rpc/recovery_safety.rsandMakefile.fix(agent): do not fence a session on an interrupted read-only shellrecovery_safetytreated every tool call without a recorded result as anunknown side effect, so pressing Stop during a
git statusfenced the wholesession permanently - no later mutation, ever, with no way out. It now asks
command_is_read_only()first, and skips the call fromunresolvedonly when itcan prove there is nothing to repeat.
The proof is deliberately narrow. The default is
false; a shell command countsas read-only only when every segment of the chain matches a two-level
whitelist (program + subcommand), no redirection is present, and
cdappearsnowhere but last.
rm -rf build,git commit,cargo build,echo hi > f,git status | tee f,git status; rm x, and anything run through aninterpreter still fence the session exactly as before, and
write/editkeeptheir existing apply-check - unknown is still unknown.
Known residual, kept on purpose:
cd ...; git worktree list; git statusstillfences, because
cdis not last. Relaxing that is a separate change.build(make):install-localfor the LTO-free binariesSame destinations as
install-cli/install-desktop, sofutureon PATH andthe Desktop agent (which prepends its own directory to PATH) run the freshly
built pair. The Windows recipe copies through node rather than
copy/if not exist: make runs every recipe throughSHELL, which issh.exewhenever Git for Windows is on PATH, and cmd builtins plus backslashpaths are not valid there.
make install*keep owningPREFIXfor shipping builds; each target overwritesthe other. Windows cannot replace a running image, so start from
PREFIXtohave a new binary take effect.
Commits
fix(agent): do not fence a session on an interrupted read-only shellbuild(make): add install-local for the LTO-free binariesfeat(desktop): order shortcut sections by use; fold the Vibe panel's keysfeat(remote-peer): rename a machine from its row; grey out its settings-already on
mainas feat(remote-peer): rename a machine from its row, and grey out its settings #1325build(make): add build-local for both binaries from one Cargo invocation-already on
maindocs(guide): name the crash log beside the host log- already onmaintest(host): prove a panicking process writes the report it could not show-already on
mainfix(desktop): keep the rail's search row height when the field opens-already on
mainbuild(make): add local-profile wrappers for the CLI and desktop binaries-already on
mainVerification
cargo fmt -p future-agent --check,cargo clippy -p future-agent --all-targets -- -D warnings: cleancargo test -p future-agent --lib recovery_safety: 12 passed. Four new tests:a table of 40 read-only and 43 mutating commands, a read-only unresolved call
leaving
pause_reason()empty andbefore_toolopen,rm -rf buildstillfencing the session, and the exemption not extending to
write.cargo test -p future-agent --lib: 2505 passed, 4 failed - all four fail onthe baseline too (three sandbox/service probes that pass when run alone, and a
local-IPC
serve_localbind test that fails alone as well).make check-docs;.PHONYandmake helpboth listinstall-local.difference from
mainis the two files named at the top.Notes
make -nhere (GnuMake 3.81/GnuWin32) blanksevery
$(shell ...), so a dry run reports the POSIX branch, andinstall-cli/install-desktopthemselves remain cmd-syntax undersh.exe,untouched by this PR.