Repository navigation
fix(runstore): expand a literal '~' in --store and $AGENTDESCENT_HOME (#402) - #403
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Birfy
left a comment
There was a problem hiding this comment.
LGTM (self-approval is blocked, so posting as a comment).
- The 4 new tests in
tests/test_runstore_tilde.pyfail on mainbc7395aand pass on this branch. - Full
pyteston Python 3.13 exits 0. - Real CLI check from an empty cwd:
agentdescent --store '~/st' evolve spec.json --detachthenagentdescent --store '~/st' statusshows the rundonewith no stray./~directory; on main the samestatusprintsno runs under ~/st.
Squash auto-merge is armed; it will land once the CI matrix is green.
Birfy
left a comment
There was a problem hiding this comment.
Verdict: approve (posted as a comment because GitHub blocks self-approval). Reviewed at e9a7a58.
This closes the gap left by #400/#401 cleanly: the store base is normalised in exactly one place (runstore.store_path), and every consumer of store= already funnels through create / get / list_runs (CLI status/show/apply/cancel/resume, MCP Tools.*, serve_http's handler, require_resume_host_on_path), so there's no second raw-base path left behind. root() expanding $AGENTDESCENT_HOME also fixes doctor's run_store for free.
What I checked
tests/test_runstore_tilde.py: all 4 new tests fail onorigin/mainand pass on this branch.- Full
pyteston 3.12 locally: exit 0. - Real CLI from an empty cwd with
HOMEpointed at a temp dir, using the stub skill_dir spec fromtests/test_evolvespec._dir_spec:agentdescent --store '~/st' evolve spec.json --detachlands in$HOME/st/<id>;agentdescent --store '~/st' statusshows itdone;show <id>works; no./~in the cwd.AGENTDESCENT_HOME='~/adh' agentdescent evolve … --detachlands in$HOME/adh/runs/<id>;status,showanddoctor(run_store: $HOME/adh/runs) all agree; again no stray./~.Tools(store='~/st').status()reports the absolute$HOME/stwith the one run.
- CI: docs build passed; the test matrix was still queued when I posted.
Design notes (all non-blocking)
- A relative
$AGENTDESCENT_HOMEis now resolved against the cwd at call time and becomes absolute. That matches how a relative--storealready behaves after #400, so it's consistent rather than a regression, just worth knowing. store_path("")still falls back toroot(), same as the oldstore or root(), so empty--storebehaviour is unchanged.
Nits (optional)
test_mcp_status_and_cli_status_name_the_expanded_storecould also assertnot (cwd / "~").exists()after the CLIstatus, to pin the "no stray directory" part for the CLI path too (the first two tests cover it forcreate/list_runs).docs/plugins.md:472mentions$AGENTDESCENT_HOME/runs; a short note that~in host-configenv/argsis now expanded would help plugin users who hit #402 before, but the changelog entry already covers it.
Nice, small and well-scoped fix.
`launch` scrubs the environment but keeps `AGENTDESCENT_*` and starts the child at `cwd=rd.path`, so a relative `AGENTDESCENT_CACHE` or `XDG_CACHE_HOME` named one tree in the process that launched the run and another in the run itself: the cache moved with every run directory, which is the bug #1280 is about. Only the launcher still knows the cwd the value was typed in, so both knobs are spelled absolute there when they are relative -- after the caller's `env` is merged, before the Ticket marker handling. An absolute value is forwarded untouched and `PYTHONPATH` is not involved. #402/#403 normalised the store the same way. Verified with Product's `probe_child_cache_root.py`, which asks a real child for `_cache_root()`: `one_tree: false` for both knobs at 62e8dd0, `one_tree: true` at this tip with an absolute `value_in_child_env`.
The fragment said the dataset cache root is one spelled path "however a later caller was launched", which is false outside `launch`: a caller that builds its own environment by hand and reads a relative value from another cwd still spells a different path to the same tree -- the `#403` contract the PR body states narrowly. Release notes are read as promises, so the fragment now stops at "a bare relative directory"; its last sentence already scopes the launch claim. Docs-only: one changelog fragment, no code or test change. Refs #1280.
Closes #402
A literal
~in--storeor$AGENTDESCENT_HOME(what an MCP host config'sargs/envor a quoted--store '~/st'delivers) was only half expanded:RunDirexpanded it (#400), socreatewrote under$HOME, butlist_runs/get's message / CLIstatus/ MCPstatusused the raw base, looked in./~/st, said "no runs", and left a stray~directory in the cwd.AGENTDESCENT_HOME=~/xwas never expanded at all.Change:
runstore.store_path(store)normalises the base once (expanduser+abspath);create,get,list_runsuse it.root()expands$AGENTDESCENT_HOME.status("no runs under …") and MCPstatus'sstorereport the expanded absolute path.changelog.d/402-tilde-store.md.Verification:
tests/test_runstore_tilde.py: 4 new tests, all fail on main (bc7395a) and pass here.HOMEpointed at a temp dir:agentdescent --store '~/st' evolve spec.json --detachthenagentdescent --store '~/st' statusshows the run asdone, no./~directory. On main the samestatusprintsno runs under ~/st.