Repository navigation
fix(shell): expand ~ in cd and working_directory, and lead the pipe refusal with its fix - #5724
Conversation
…efusal with its fix `cd ~/Work/gaia` failed with "Directory not found" because ~ was taken literally, though the pre-check beside it already expanded it. The refusal for a '|' inside single quotes on Windows now starts with what to do, so a truncated error line still shows it. Part of amd#5700.
|
Verdict: Request changes Making
Real-world evidenceN/A: no evidence bundle was produced for this run. The PR description reports a manual run of 🔍 Technical details🟡 One-time and person approvals miss a
The smallest fix that keeps every caller consistent is to normalise inside the key (line 416):
Strengths
|
…ll runs The run expands ~ before checking an approval, but the approval was keyed on the folder as typed, so an approved one-time command with a ~ working folder was refused as unapproved.
|
Fixed: approvals are now keyed on the expanded folder ( |
…amd#5831) Anyone who updated from a v0.25.1 release candidate to the final v0.25.1 kept the candidate's agent, so the final release's agent fixes never reached them. On this Mac, v0.25.1 kept the rc11 build of agent 0.3.1 (`24219ae2…`) instead of the pinned build (`658361d2…`), and asking GAIA to `cd ~/Downloads` still failed with "Directory not found: ~/Downloads", which amd#5724 fixed. `gaia init` only checked whether *a* flagship was installed. A candidate's build carries the final version number, so only the bytes tell them apart. Init now compares the installed build's hash with the one the hub publishes for this machine, and replaces and restarts the agent when they differ. The same check replaces any build the hub no longer publishes, so a newer flagship release is now picked up on the next `gaia init` too. If the hub can't be reached, it keeps the working agent and says so. ## Test plan - [x] `pytest tests/unit/test_hub_prerelease.py`: - a candidate's build is replaced and the agent restarted; - a hash that differs only in letter case counts as the same build; - the published build is kept; - an unreachable hub keeps the agent with a warning; - an install with no recorded hash is left alone; - the published hash uses the same selection as an install. The two replacement tests fail on main's code. - [x] `tests/unit/test_init_command.py`, `installer/test_init_default_profile.py`, `test_hub_*.py`: 744 passed - [x] Live on this Mac, after installing v0.25.1 over rc11: init printed "Replacing the installed 'gaia' agent (0.3.1+v0.25.1-rc11) with the published build… Stopped the running 'gaia' agent". The installed hash is now `658361d2…`, matching `binaries.lock.json`, and `cd ~/Downloads && pwd` in the Agent UI now prints `/Users/kalin/Downloads`. - [x] black, isort, pylint (errors only), CI path coverage --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
Asked to triage PRs "under ~/Work/gaia", GAIA's very first command failed with "Directory not found: ~/Work/gaia" because
~was taken literally, and it went on to guess other paths.~now means your home folder incdand in a command's working folder, as in any shell. Separately, when a|inside single quotes is refused on Windows (correctly: cmd.exe doesn't treat single quotes as quoting), the error now starts with the fix ("wrap any argument containing '|' in double quotes"), so the cut-off error line in the UI still says what to do.Part of #5700. The rest of #5700, read-only
ghcommands refused in a Full access chat, is already fixed on main by #5562. It still reached the user because their desktop app was running an older agent build, which is now #5723.Test plan
pytest tests/unit -k shell: 1593 passed, including new~tests forcdandworking_directory(both fail on main)python util/lint.py --black --isort: cleancd ~/Work/gaia && git log --oneline -1(the command that failed in the user's chat) now runs and prints the latest commitgaia_*categories that drive shell commands on Windows🔍 Technical details
_expand_homeis applied in_resolve_cd_target(the realcd),_call_cwd(the pre-flight) and at the top ofrun_shell_commandforworking_directory. The install-target pre-check already usedexpanduser, so the pre-check and the run disagreed._ambiguous_pipe_refusalkeeps itshint; only the order of theerrortext changed.