feat(chaos): registry-driven fault/trigger axes, lazy agent#31
Draft
pradeepvrd wants to merge 1 commit into
Draft
feat(chaos): registry-driven fault/trigger axes, lazy agent#31pradeepvrd wants to merge 1 commit into
pradeepvrd wants to merge 1 commit into
Conversation
pradeepvrd
commented
Jun 20, 2026
e6d22f4 to
2fa6e73
Compare
eec518a to
ef062ee
Compare
2fa6e73 to
ddf3ce9
Compare
ef062ee to
8e1f4f0
Compare
ddf3ce9 to
307bb21
Compare
8e1f4f0 to
281df06
Compare
307bb21 to
915b68f
Compare
281df06 to
bff43c5
Compare
915b68f to
885f8b8
Compare
bff43c5 to
550cec5
Compare
885f8b8 to
90261d8
Compare
9db9100 to
ba65ba9
Compare
90261d8 to
073719a
Compare
ba65ba9 to
4be11fb
Compare
Chaos used to live in `pkg/agents/chaos/` as a single Gemini agent hardwired to fortio load generation; this migrates it into `devops_bench/chaos/` with registry-driven axes: a `FAULTS` registry (`generate_load`), a `TRIGGERS` registry (`time`), a typed `ChaosSpec` parser, and a lazily-imported `ChaosAgent` on `models.loop`. **Behavior changes** - Fault/trigger types are extensible via `@FAULTS.register` / `@TRIGGERS.register`; the spec parser validates `action.type` / `trigger.type` against the registry (unknown types raise `ValidationError`) rather than a hand-maintained `Union`. - Concrete faults/triggers import eagerly so the registries populate, but the agent + provider SDK chain stays lazy — `import devops_bench.chaos` never touches a provider SDK. - `ChaosAgent` is provider-agnostic via `get_model()` (provider SDKs are optional extras); each fault owns its tool handlers and command lifecycle. **Bugs fixed** - Fault commands run as a shell-free argv via `core.subprocess.run` (parsed with `shlex.split`) instead of `subprocess.run(..., shell=True)`, so model-generated commands are no longer shell-interpreted.
4be11fb to
cc4d588
Compare
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.
Chaos used to live in
pkg/agents/chaos/as a single Gemini agent hardwired to fortio load generation; this migrates it intodevops_bench/chaos/with registry-driven axes: aFAULTSregistry (generate_load), aTRIGGERSregistry (time), a typedChaosSpecparser, and a lazily-importedChaosAgentonmodels.loop.Behavior changes
@FAULTS.register/@TRIGGERS.register; the spec parser validatesaction.type/trigger.typeagainst the registry (unknown types raiseValidationError) rather than a hand-maintainedUnion.import devops_bench.chaosnever touches a provider SDK.ChaosAgentis provider-agnostic viaget_model()(provider SDKs are optional extras); each fault owns its tool handlers and command lifecycle.Bugs fixed
core.subprocess.run(parsed withshlex.split) instead ofsubprocess.run(..., shell=True), so model-generated commands are no longer shell-interpreted.