Repository navigation
fix(OMN-11025): migrate delegation DTO imports - #629
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR consolidates omnimarket delegation data models into canonical ChangesDelegation DTO compatibility re-export migration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
✅ Architectural Review — PASSEDErrors: 0 What this checks
No architectural violations found. Powered by node_pr_review_bot |
✅ PR Review Bot — CLEANFindings: 0
Verdict semantics
Powered by node_pr_review_bot — FSM pipeline with multi-model review fan-out |
|
| Verdict | Meaning | Blocks merge? |
|---|---|---|
passed |
No critical/error findings | No |
blocked |
CRITICAL or ERROR findings found | Yes |
degraded |
All models unavailable (infra) | No (pilot) |
Powered by omniintelligence.review_pairing.cli_review — node-based adversarial review via HandlerLlmCliSubprocess (OMN-8524)
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/test_delegation_dto_omnibase_compat_imports.py (1)
91-95: ⚡ Quick winFail fast on unmapped contract DTO refs.
This filter only checks refs already listed in
DTO_IMPORTS, so newomnimarket.*refs incontract.yamlcan be missed while the test still passes. Assert there are no unmapped refs before compatibility checks.Proposed patch
- model_refs = [ - ref - for ref in _model_refs(contract) - if ref in DTO_IMPORTS and not ref.endswith(".ModelRoutingDecision") - ] + all_contract_refs = [ + ref + for ref in _model_refs(contract) + if ref.startswith("omnimarket.") and not ref.endswith(".ModelRoutingDecision") + ] + unmapped_refs = sorted(set(all_contract_refs) - set(DTO_IMPORTS)) + assert not unmapped_refs, ( + f"Unmapped delegation DTO refs in {node_name} contract.yaml: {unmapped_refs}" + ) + model_refs = [ref for ref in all_contract_refs if ref in DTO_IMPORTS]🤖 Prompt for 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. In `@tests/test_delegation_dto_omnibase_compat_imports.py` around lines 91 - 95, The test currently builds model_refs by filtering _model_refs(contract) against DTO_IMPORTS, which hides any new omnimarket.* refs; modify the test to first compute unmapped = [ref for ref in _model_refs(contract) if ref not in DTO_IMPORTS] and assert that unmapped is empty (raise/assert with a clear message listing unmapped refs) before proceeding to the existing compatibility checks that use model_refs, so any new contract DTO refs are caught immediately; refer to _model_refs, DTO_IMPORTS, and the model_refs variable when making this change.
🤖 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
`@src/omnimarket/nodes/node_delegation_routing_reducer/models/model_delegation_config.py`:
- Around line 25-35: The YAML parsing currently assumes safe_load returns a dict
and that m["use_for"] is list-like, which can lead to AttributeError or turn a
scalar string into a tuple of characters; update the parsing in the block that
builds tiers and ModelTierModel so you first verify raw is a dict (fall back to
{} if None), ensure raw.get("tiers", []) yields a list and each tier_data is a
dict, ensure tier_data.get("models", []) yields a list and each m is a dict, and
coerce m.get("use_for") safely by treating strings as single-item lists or
validating it is already a list before converting to a tuple for
ModelTierModel(use_for=...), raising or logging a clear error if types mismatch;
refer to the variables raw, tiers, tier_data, m and the ModelTierModel
constructor to locate where to add these checks.
---
Nitpick comments:
In `@tests/test_delegation_dto_omnibase_compat_imports.py`:
- Around line 91-95: The test currently builds model_refs by filtering
_model_refs(contract) against DTO_IMPORTS, which hides any new omnimarket.*
refs; modify the test to first compute unmapped = [ref for ref in
_model_refs(contract) if ref not in DTO_IMPORTS] and assert that unmapped is
empty (raise/assert with a clear message listing unmapped refs) before
proceeding to the existing compatibility checks that use model_refs, so any new
contract DTO refs are caught immediately; refer to _model_refs, DTO_IMPORTS, and
the model_refs variable when making this change.
🪄 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: a738e55a-8d8a-42dc-b5a2-b061369fd183
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (29)
docs/work-tracking/contracts/OMN-11025.yamlpyproject.tomlsrc/omnimarket/adapters/llm/bifrost/model_bifrost_delegation_config.pysrc/omnimarket/events/delegation.pysrc/omnimarket/nodes/node_budget_policy_compute/metadata.yamlsrc/omnimarket/nodes/node_budget_policy_compute/models/model_budget_limits.pysrc/omnimarket/nodes/node_build_loop_orchestrator/models/model_dispatch_trace.pysrc/omnimarket/nodes/node_delegation_orchestrator/metadata.yamlsrc/omnimarket/nodes/node_delegation_orchestrator/models/model_baseline_intent.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_compliance_loop_result.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_delegation_event.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_delegation_request.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_delegation_result.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_inference_intent.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_inference_response_data.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_quality_gate_intent.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_routing_intent.pysrc/omnimarket/nodes/node_delegation_orchestrator/models/model_task_delegated_event.pysrc/omnimarket/nodes/node_delegation_quality_gate_reducer/metadata.yamlsrc/omnimarket/nodes/node_delegation_quality_gate_reducer/models/model_quality_contract.pysrc/omnimarket/nodes/node_delegation_quality_gate_reducer/models/model_quality_gate_input.pysrc/omnimarket/nodes/node_delegation_quality_gate_reducer/models/model_quality_gate_result.pysrc/omnimarket/nodes/node_delegation_routing_reducer/handlers/handler_delegation_routing.pysrc/omnimarket/nodes/node_delegation_routing_reducer/metadata.yamlsrc/omnimarket/nodes/node_delegation_routing_reducer/models/model_delegation_config.pysrc/omnimarket/nodes/node_delegation_routing_reducer/models/model_routing_tier.pysrc/omnimarket/nodes/node_delegation_routing_reducer/models/model_tier_model.pysrc/omnimarket/nodes/node_projection_delegation/handlers/handler_projection_delegation.pytests/test_delegation_dto_omnibase_compat_imports.py
|



Ticket: OMN-11025
Evidence-Ticket: OMN-11025
Evidence-Source: OCC#1019
Summary
omnibase_compat.contracts.delegation.wireclasses from OMN-11024ModelRoutingDecisionis untouchedomnibase-compatthrough a git source at the same OMN-11024 merge commit after archive zip fetches returned 504/503 in CI/local installVerification
uv sync --locked --all-extrasuv run ruff check pyproject.toml src/omnimarket/events/delegation.py src/omnimarket/adapters/llm/bifrost/model_bifrost_delegation_config.py src/omnimarket/nodes/node_budget_policy_compute/models/model_budget_limits.py src/omnimarket/nodes/node_delegation_orchestrator/models src/omnimarket/nodes/node_delegation_quality_gate_reducer/models src/omnimarket/nodes/node_delegation_routing_reducer/models src/omnimarket/nodes/node_delegation_routing_reducer/handlers/handler_delegation_routing.py src/omnimarket/nodes/node_projection_delegation/handlers/handler_projection_delegation.py src/omnimarket/nodes/node_build_loop_orchestrator/models/model_dispatch_trace.py tests/test_delegation_dto_omnibase_compat_imports.pyuv run python scripts/ci/check_node_metadata_dependencies.pyuv run pytest tests/test_delegation_dto_omnibase_compat_imports.py tests/test_memory_dto_omnimemory_imports.py tests/unit/delegation tests/nodes/node_delegation_routing_reducer/test_contract_routing_policy.py tests/test_golden_chain_projection_delegation.py tests/unit/nodes/node_build_loop_orchestrator/test_dispatch_trace.py src/omnimarket/nodes/node_budget_policy_compute/tests/test_handler_budget_policy.py -quv run pytest tests/ --splits 20 --group 5 --store-durations --durations-path .test_durations -v --tb=short -m "not kafka" --junitxml=junit-5.xmlPASS,findings=[]uv run python - <<'PY' ... yaml.safe_load(Path('docs/work-tracking/contracts/OMN-11025.yaml').read_text()) ... PYgit diff --checkRuntime / Deploy Gate
No runtime deploy, restart, or
.201mutation was performed. This is import compatibility and local collision cleanup; post-merge validation should smoke import the affected delegation node entry points on the deployed image.Summary by CodeRabbit
Release Notes
omnibase-compat>=0.3.1dependency to support enhanced delegation infrastructure.