feat: Support configurable home directory via TAU_HOME environment variable#466
Open
abrahamy wants to merge 4 commits into
Open
feat: Support configurable home directory via TAU_HOME environment variable#466abrahamy wants to merge 4 commits into
abrahamy wants to merge 4 commits into
Conversation
…riable Adds support for TAU_HOME and TAU_AGENTS_HOME environment variables to override the default ~/.tau and ~/.agents directories respectively. Closes huggingface#465 Changes: - Add _default_tau_home() and _default_agents_home() helper functions - Update TauPaths dataclass to use the new helper functions as defaults - Add comprehensive test coverage for the new functionality - Update documentation to describe the new environment variables The implementation: - Respects TAU_HOME when set, falls back to ~/.tau otherwise - Respects TAU_AGENTS_HOME when set, falls back to ~/.agents otherwise - Supports tilde expansion (e.g., ~/my-tau) - Maintains full backward compatibility
- Remove tests for private _default_tau_home and _default_agents_home functions - Consolidate tests to use TauPaths() constructor directly - Add comprehensive tests for default behavior, env var override, and tilde expansion - All 8 tests now verify behavior through the public TauPaths interface This follows better testing practices by testing behavior rather than implementation details.
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.
Summary
Adds support for
TAU_HOMEandTAU_AGENTS_HOMEenvironment variables to override the default~/.tauand~/.agentsdirectories respectively.Closes #465
Changes
_default_tau_home()and_default_agents_home()helper functions insrc/tau_coding/paths.pyTauPathsdataclass to use the new helper functions as defaultsMotivation
Tau currently hardcodes the user home directory to
~/.tau. This prevents users from:~/.config/tau)~/.tauisn't idealImplementation Details
The implementation:
TAU_HOMEwhen set, falls back to~/.tauotherwiseTAU_AGENTS_HOMEwhen set, falls back to~/.agentsotherwise~/my-tau)Testing
All existing tests pass, plus 5 new tests covering behavior through the public
TauPathsAPI:test_taupaths_defaults_to_standard_locations- Verifies default~/.tauand~/.agentswhen env vars are not settest_taupaths_respects_tau_home_env_var- VerifiesTAU_HOMEoverride workstest_taupaths_respects_tau_agents_home_env_var- VerifiesTAU_AGENTS_HOMEoverride workstest_taupaths_expands_tilde_in_tau_home- Verifies tilde expansion forTAU_HOMEtest_taupaths_expands_tilde_in_tau_agents_home- Verifies tilde expansion forTAU_AGENTS_HOMEDocumentation
Updated
website/content/reference/configuration.mdto document:TAU_HOMEenvironment variableTAU_AGENTS_HOMEenvironment variableChecks
uv run ruff check .- passeduv run ruff format --check .- passeduv run mypy- passeduv run pytest- all 1150 tests passed