Skip to content

fix(agent): use ruamel.yaml instead of pyyaml in agent modules (hotfix from #193)#194

Merged
placerda merged 1 commit into
mainfrom
hotfix/agent-ruamel-yaml
May 29, 2026
Merged

fix(agent): use ruamel.yaml instead of pyyaml in agent modules (hotfix from #193)#194
placerda merged 1 commit into
mainfrom
hotfix/agent-ruamel-yaml

Conversation

@placerda
Copy link
Copy Markdown
Contributor

Hotfix

Cherry-pick of #193 from develop: replace import yaml (PyYAML, not declared) with ruamel.yaml (already declared) in four agent/ modules.

Fixes ModuleNotFoundError: yaml raised by agentops doctor on clean CI runners that only installed agentops-accelerator from PyPI / GitHub.

Same diff as #193 (+16/-13 across 4 files). Tests: python -m pytest tests/ -x -q784 passed, 3 skipped.

Cherry-pick of commit d04e39d.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant