Skip to content

Validate capy.yaml step payloads before execution#6

Open
RitwijParmar wants to merge 1 commit into
Scrapybara:mainfrom
RitwijParmar:codex/codecapy-capy-config-validation
Open

Validate capy.yaml step payloads before execution#6
RitwijParmar wants to merge 1 commit into
Scrapybara:mainfrom
RitwijParmar:codex/codecapy-capy-config-validation

Conversation

@RitwijParmar
Copy link
Copy Markdown

Summary

capy.yaml steps are currently typed by step kind, but the payload fields are all optional. That means invalid setup config can get accepted and then fail later inside the execution path:

  • bash without command
  • instruction without text
  • wait with seconds <= 0

This PR moves CapyStep / CapyConfig into a small dependency-light src/capy_config.py module, re-exports the models from src.models for existing imports, and adds Pydantic validation for those step-specific payload requirements.

Why

CodeCapy runs agent setup in remote Scrapybara instances and updates PR comments as it goes. Invalid setup config should fail fast with a clear validation error before an agent session starts, rather than surfacing as a later runtime failure while setting up a PR environment.

Tests

  • PYTHONPATH=. /Users/ritwij/Library/Python/3.9/bin/uv run --python 3.11 --with pytest --with pydantic pytest tests/test_capy_config.py -q
  • PYTHONPATH=. /Users/ritwij/Library/Python/3.9/bin/uv run --python 3.11 --with black black --check src/capy_config.py src/models.py tests/test_capy_config.py
  • PYTHONPATH=. /Users/ritwij/Library/Python/3.9/bin/uv run --python 3.11 python -m compileall src tests
  • git diff --check

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