Add ExtensionContext.paths to expose resolved TauPaths - #627
Open
AmirF194 wants to merge 1 commit into
Open
Conversation
AmirF194
force-pushed
the
fix/598-extension-context-paths
branch
2 times, most recently
from
August 24, 2026 21:53
bd63e38 to
ce6f0d9
Compare
ExtensionRuntime.load() received a TauResourcePaths carrying the resolved TauPaths but never stored it, so ExtensionContext had no way to hand extensions the same home directory a host may have moved with TauPaths(home=...). Extensions had to hardcode "~/.tau". Store the resolved paths on the runtime with the same fallback used in session.py (paths.paths or TauPaths(home=paths.root)) and expose them through a new ExtensionContext.paths property, following the same generation check as the other context properties. Fixes huggingface#598
AmirF194
force-pushed
the
fix/598-extension-context-paths
branch
from
August 24, 2026 21:54
ce6f0d9 to
5f86885
Compare
Author
|
No rush, just checking in on this one. CI is sitting behind the first-time-contributor workflow approval wall, so it has not actually run yet, happy to rebase again if that helps. |
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.
ExtensionRuntime.load()receives aTauResourcePathsthat carries the resolvedTauPaths, but never stores it.ExtensionContextexposescwd,model,session_id, and other session values, but nothing about the Tau home, so an extension has no way to findTauPaths.homewhen a host moved it withTauPaths(home=...). Extensions end up hardcoding~/.tau, which reads and writes the wrong location once the home moves (the tau-subagents extension does this in four places, recorded as a workaround in its ADR 0003).Fix:
ExtensionRuntime.load()now storespaths.paths or TauPaths(home=paths.root), the same fallbacksession.pyalready uses to build the trust store, and exposes it through a newExtensionRuntime.pathsproperty.ExtensionContext.pathsreads that property under the sameassert_active()generation check as every other context property, so a context captured before a/reloadraisesExtensionErrorinstead of reading the reloaded world.Verification:
test_context_paths_exposes_resolved_paths_from_loadandtest_context_paths_falls_back_to_resource_root_homefail onmainwithAttributeError: 'ExtensionContext' object has no attribute 'paths'and pass on this branch (both run in the same Docker image).test_session_exposes_extension_paths_at_moved_homeexercises the realCodingSession.load()path end to end, same fail-before/pass-after check.context.pathsstaleness assertion next to the existingcontext.cwdone intest_reset_for_reload_invalidates_prior_context_and_ui.uv run pytest),ruff check .,ruff format --check ., andmypyall pass.Fixes #598