Skip to content

feat(OMN-11268): runner health models and state enum — add __all__ and OOM_KILLED emoji - #1671

Merged
jonahgabriel merged 3 commits into
mainfrom
jonah/omn-11268-runner-health-models
May 19, 2026
Merged

jonahgabriel merged 3 commits into
mainfrom
jonah/omn-11268-runner-health-models

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented May 19, 2026 •

Copy link
Copy Markdown
Collaborator

Evidence-Ticket: OMN-11268
Evidence-Source: 1b771764c82d78214eb7689a63e21a76993199e6

Summary

Closes OMN-11268.

The ModelRunnerStatus, ModelRunnerHealthSnapshot, ModelRunnerHealthAlert, and EnumRunnerHealthState models were already implemented in main (OMN-6075, OMN-6049). This PR adds missing polish items:

  • __all__ declarations on ModelRunnerHealthSnapshot and ModelRunnerHealthAlert
  • OOM_KILLED emoji mapping in ModelRunnerHealthAlert.to_slack_message()
  • Integration tests covering package exports, enum coverage, state coverage, and snapshot roundtrip

Acceptance criteria

  • ModelRunnerStatus frozen with 7 fields
  • EnumRunnerHealthState has HEALTHY, GITHUB_OFFLINE, DOCKER_UNHEALTHY, OOM_KILLED, CRASH_LOOPING, STALE_REGISTRATION, MISSING
  • ModelRunnerHealthSnapshot frozen with all required fields
  • ModelRunnerHealthAlert.to_slack_message() covers all degraded states
  • 7 unit tests + 4 integration tests pass

dod_evidence

ticket: OMN-11268
tests_passed: 7 unit + 4 integration (all PASS)
pre_commit: all hooks passed
occ_contract: onex_change_control PR #1176

…ealth models

ModelRunnerHealthAlert.to_slack_message now maps OOM_KILLED state to a
skull emoji (previously fell through to the default ❌). Add explicit
__all__ to ModelRunnerHealthAlert and ModelRunnerHealthSnapshot.
@coderabbitai

coderabbitai Bot commented May 19, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR adds public API declarations and integration tests for the runner health models. The alert model now maps OOM_KILLED state to a skull emoji, both model modules explicitly export their primary classes, and a comprehensive integration test suite validates the full public API surface.

Changes

Runner Health Model Public API and Integration Testing

Layer / File(s) Summary
Model exports and Slack emoji mapping
src/omnibase_infra/observability/runner_health/model_runner_health_alert.py, src/omnibase_infra/observability/runner_health/model_runner_health_snapshot.py
ModelRunnerHealthAlert and ModelRunnerHealthSnapshot add __all__ export lists to control public API surface. ModelRunnerHealthAlert.to_slack_message() adds OOM_KILLED emoji mapping to :skull: for Slack formatting.
Integration tests for runner health public API
tests/integration/observability/test_runner_health_models_integration.py
New integration test suite validates package-level exports (EnumRunnerHealthState, ModelRunnerStatus, ModelRunnerHealthSnapshot, ModelRunnerHealthAlert), EnumRunnerHealthState enum member completeness, to_slack_message() output for all degraded states, and ModelRunnerHealthSnapshot JSON serialization round-tripping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Health alerts now shine so bright,
With skulls that glow and :__all__: light!
Tests protect our public face,
While emojis find their rightful place. 🔔

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding all exports and mapping OOM_KILLED emoji, which matches the core modifications across the three files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-11268-runner-health-models

Comment @coderabbitai help to get the list of available commands and usage tips.

… API

Four integration tests verify package exports, enum member coverage,
to_slack_message state coverage, and snapshot model_dump roundtrip.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/integration/observability/test_runner_health_models_integration.py`:
- Around line 31-38: The test's required set (variable `required`) is missing
the "OOM_KILLED" member declared in `EnumRunnerHealthState`; update the
`required` set in the test
(tests/integration/observability/test_runner_health_models_integration.py) to
include the string "OOM_KILLED" so the test verifies all seven enum members are
present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0cf7159e-0eb4-46b1-acff-f8ac96b9df0d

📥 Commits

Reviewing files that changed from the base of the PR and between a9a747c and 834772f.

📒 Files selected for processing (3)
  • src/omnibase_infra/observability/runner_health/model_runner_health_alert.py
  • src/omnibase_infra/observability/runner_health/model_runner_health_snapshot.py
  • tests/integration/observability/test_runner_health_models_integration.py

@sonarqubecloud

Copy link
Copy Markdown

@jonahgabriel
jonahgabriel enabled auto-merge (squash) May 19, 2026 20:50
@jonahgabriel
jonahgabriel merged commit cda190e into main May 19, 2026
97 of 103 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-11268-runner-health-models branch May 19, 2026 21:26
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