fix(agent): use ruamel.yaml instead of pyyaml in agent modules (hotfix from #193)#194
Merged
Conversation
Four agent modules imported PyYAML (`import yaml`) but `pyproject.toml` only declares `ruamel.yaml`. On clean CI runners (no PyYAML in the venv) this raised `ModuleNotFoundError: yaml` at `agentops doctor` time, breaking the doctor step of the generated deploy workflow. Refactored to the existing `ruamel.yaml` dependency (same pattern as `src/agentops/utils/yaml.py`): - `agent/checks/opex_workspace.py` - `agent/checks/spec_conformance.py` - `agent/llm_assist/_bundle_rule.py` - `agent/cockpit.py` (preserved the lazy-import semantics inside `_resolve_agent_identity`) Behaviour preserved: `YAML(typ='safe').load(...)` returns plain dicts/lists just like `yaml.safe_load(...)`. No new runtime dependency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Hotfix
Cherry-pick of #193 from
develop: replaceimport yaml(PyYAML, not declared) withruamel.yaml(already declared) in fouragent/modules.Fixes
ModuleNotFoundError: yamlraised byagentops doctoron clean CI runners that only installedagentops-acceleratorfrom PyPI / GitHub.Same diff as #193 (
+16/-13across 4 files). Tests:python -m pytest tests/ -x -q→ 784 passed, 3 skipped.Cherry-pick of commit d04e39d.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com