Repository navigation
Commit 3007dbf
committed
fix(cli): YAML removers answer OK for an absent config, so uninstall no longer refuses
`uninstall` failed with rc 1 on any macOS where Hermes is installed:
Hermes is detected by its binary on PATH, not by its home, so a HOME
without `.hermes/` (every test HOME, and a fresh user's) reached the
Hermes uninstall ops with `~/.hermes/config.yaml` absent. The JSON
removers already treat a missing config as "nothing to remove"; the YAML
removers acquired the lock first, and the lock directory is created
beside the target — with the parent directory absent that failed, the
adapter recorded
error: agent_config agent=Hermes op=pre_llm_hook_uninstall ... (target: does not exist or cannot be inspected)
error: agent_config agent=Hermes op=mcp_uninstall ...
and uninstall refused to remove the executable and the indexes. This is
what made cli_uninstall_quiesces_active_cohort_before_removing_binary_and_index
fail on such a machine (7837 passed, 1 failed on a pristine main).
All four YAML removers short-circuit on a genuinely absent path and
create nothing: lstat + ENOENT on POSIX, and CreateFileW with
FILE_FLAG_OPEN_REPARSE_POINT on Windows, mirroring toml_read_file.
Opening the reparse point rather than following it keeps a dangling
symlink out of the short-circuit on both platforms, so it still reaches
the reader and its byte-identical rejection.
The regression test covers the four removers and runs on every platform:
it asserts "nothing was created" through cbm_path_info_utf8 rather than
lstat, so the Windows branch is exercised rather than compiled out.
Signed-off-by: David Gil <dgilperez@gmail.com>1 parent fe85a6b commit 3007dbf
2 files changed
Lines changed: 83 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3601 | 3601 | | |
3602 | 3602 | | |
3603 | 3603 | | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
3604 | 3642 | | |
3605 | 3643 | | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
3606 | 3647 | | |
3607 | 3648 | | |
3608 | 3649 | | |
| |||
3626 | 3667 | | |
3627 | 3668 | | |
3628 | 3669 | | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
3629 | 3673 | | |
3630 | 3674 | | |
3631 | 3675 | | |
| |||
3653 | 3697 | | |
3654 | 3698 | | |
3655 | 3699 | | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
3656 | 3703 | | |
3657 | 3704 | | |
3658 | 3705 | | |
| |||
3675 | 3722 | | |
3676 | 3723 | | |
3677 | 3724 | | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
3678 | 3728 | | |
3679 | 3729 | | |
3680 | 3730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
1826 | 1827 | | |
1827 | 1828 | | |
1828 | 1829 | | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
1829 | 1861 | | |
1830 | 1862 | | |
1831 | 1863 | | |
| |||
1980 | 2012 | | |
1981 | 2013 | | |
1982 | 2014 | | |
| 2015 | + | |
1983 | 2016 | | |
1984 | 2017 | | |
1985 | 2018 | | |
| |||
0 commit comments