Repository navigation
Conversation
AGENTDESCENT_CACHE and XDG_CACHE_HOME were expanded but not made absolute, so cache_path handed back (and created) a bare relative directory: the same half-expansion #402 fixed for the run store, left in the dataset cache after #1261. hf_rows_modelscope's docstring still promised one fixed ~/.cache/agentdescent/modelscope/ path, so documented and written roots disagreed once the knob moved. Refs #1280
`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.
|
Pre-report — What changes. Why. That clause is false outside Scope. One file, one commit: no code, no tests, PR body untouched (it does not contain that sentence). Docs-only delta on top of |
|
Pre-report — What changes. Only the Why. The body still names What stays. Line Scope. One |
Fixes #1280
What changed
Two halves of one thing: the dataset cache root is written by one process and read by another, so it must be neither relative nor resolved in two different places.
dataloader._cache_root()expanded~but never made the root absolute, soAGENTDESCENT_CACHE=rel-cacheread back asrel-cacheandcache_path()created it relative to whatever cwd the caller had — the half#402/#403already closed for the run store (runstore._normalise). Both branches now normalise once:abspath(expanduser(...))forAGENTDESCENT_CACHE, andabspath(expanduser(xdg))/agentdescentforXDG_CACHE_HOME.CACHE_ROOTand the no-variable path are byte-identical to before, andcache_path()'s signature, itsmakedirs, and thecache=Falsebypass contract inhf_rows/hf_rows_modelscope/fetch_bytesare untouched.runstore.launch()is the half that makes the issue's own headline stop being true. It buildschild_envfromos.environ, and the scrub deliberately keepsAGENTDESCENT_*; the child then starts atcwd=rd.path. With only the dataloader half, the launcher resolved tree A and the detached child resolved tree B, so the cache still moved with every run directory. Only the launcher still knows the cwd the operator typed the value in, so a relativeAGENTDESCENT_CACHEorXDG_CACHE_HOMEis spelled absolute there — after the caller'senvis merged (an explicitly passed relative value is normalised too) and before the Ticket marker block. An absolute value is forwarded untouched; the markers andPYTHONPATHare not involved.The stale docstring in the issue is the third part of the same fix:
hf_rows_modelscopepromised responses under one fixed~/.cache/agentdescent/modelscope/while:421writes through_raw_cache_path → cache_path → _cache_root()and honours both knobs. It now names both knobs and no longer claims a fixed path.Not a goal: the default root, the fetch/cache keying, and any change to what is downloaded.
Verification at the tip
Tip SHA: 7fbcc3d — base
0a6e782f8f206eb1477d72f334e84c2ff0ba4b09, 3 commits,+210/−7across 5 files (as the API reports it).Ran:
0a6e782fwith onlytests/test_dataloader_cache_root_abs.pyadded:4 failed, 1 passed in 0.91s— the failures arerel-cache/rel-xdgread back relative (includingcache_pathhanding backrel-cache/gsm8k/x.jsonlfrom either cwd) and the stale~/.cache/agentdescent/modelscope/docstring; the pass is the unchanged-default row62e8dd00(the first commit alone) with onlytests/test_runstore_cache_env.pyadded:2 failed, 1 passed— both relative knobs reach the child asrel-cache/rel-xdg, and the absolute-value row passesprobe_child_cache_root.py, which drives the reallaunchenv/cwd construction (only the spawn stubbed) and then asks a real child for_cache_root():62e8dd00:one_tree: falsefor both knobs,value_in_child_envstillrel-cache/rel-xdg; launcher<launcher cwd>/rel-cachevs child<run dir>/rel-cache, and<launcher cwd>/rel-xdg/agentdescentvs<run dir>/rel-xdg/agentdescent438aee6:one_tree: truefor both knobs,value_in_child_env=<launcher cwd>/rel-cacheand<launcher cwd>/rel-xdg, child root equal to launcher root,all_paths_inside_temp: true8 passed in 0.99stest_dataloader.py,test_dataloader_cache_root.py,test_dataloader_cache_names.py,test_dataloader_cache_root_abs.py):60 passed in 2.85stest_runstore_cli.py,test_runstore_tilde.py,test_runstore_cache_env.py):58 passed in 23.65s#1273knob rows:tests/test_adas_example.py tests/test_skill_evolution_example.py -k cache→3 passed, 31 deselected in 1.76spython -m tools.changelog_fragments check→46 changelog fragment(s) OK;python -m tools.gen_api_docs --check→docs/api.md is up to date438aee6242: 10 checks —build,otel-wireandtest (3.9)–test (3.13)allsuccess,deployskipped, both report-only checkssuccess; zero failingThe contract this keeps, stated plainly: the detached child inherits the launcher's resolved root, so the process that starts a run and the run itself name one tree.
The rule that survives is narrower and unchanged: a relative value is still resolved against the cwd of the process that reads it — the same contract
#403gave the run store — so anything that builds achild_envby hand, outsidelaunch, should be given an absoluteAGENTDESCENT_CACHE. This PR does not widen that; it stopslaunchfrom being one of those callers.No UI surface: library path resolution only.
Not run: full
pytest -q(markdownis not installed here fortests/test_docs_links.py);mkdocs build --strict(no docs page changed; mkdocs not installed). No network or model call in the new tests; the probe is a local file run, not part of the suite.Draft on purpose: no flip without the Lead's word.