Repository navigation
Conversation
yaml.safe_load returns None for an empty file, a comment-only file or a bare document marker. set_envs passed that to flatten_dict, which failed with AttributeError, and since veadk.config calls set_envs at import time, importing veadk failed whenever such a config.yaml was found. Treat a None document as an empty mapping.
This branch has not been deployed
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.
veadk.configlooks for aconfig.yaml(viafind_dotenv(usecwd=True)) and passes it toset_envsat import time.yaml.safe_loadreturnsNonefor an empty file, a comment-only file or a bare---, andflatten_dict(None)then raises:So with an empty or placeholder
config.yamlin the working directory, or in any parent directory,import veadk.configfails, and so does everything that imports it, e.g.from veadk import Agent. That's an easy state to end up in when configuration comes from environment variables only.set_envsnow treats aNonedocument as an empty mapping. Non-empty configs, including nested ones, and the precedence of existing environment variables are unchanged.Tests
New
tests/utils/test_empty_config.py: three empty-document variants, plus a nested-config/env-precedence check. Onmain: 3 failed, 1 passed. On this branch: 4 passed.I also checked the import path end to end: in a temp directory containing an empty
config.yaml,python -c "import veadk.config"raises the error above onmainand imports cleanly on this branch.Full suite (
uv run --extra dev pytest -n 4 -m "not codex_smoke and not piagent_smoke"): 26 failed, 2 errors, 8053 passed. The same 28 failures/errors occur on unmodifiedmainin my environment (tests/runtime/codex/*,tests/cloud/test_harness_app_contract.py,tests/frontend/test_migration_delivery_recovery.py,tests/runtime/test_self_host_sandbox_*), so none are new. Ruff 0.11.12 (the pre-commit version)checkandformat --checkare clean on the changed files.