Skip to content

fix(OMN-12752): route terminal events for single handlers - #1890

Merged
jonahgabriel merged 1 commit into
devfrom
jonah/omn-12752-runtime-local-terminal-output
Jun 7, 2026
Merged

jonahgabriel merged 1 commit into
devfrom
jonah/omn-12752-runtime-local-terminal-output

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jun 6, 2026 •

Copy link
Copy Markdown
Collaborator

Evidence-Source: OCC#2246
Evidence-Ticket: OMN-12752

Summary

  • Publish a terminal event when a single local runtime handler returns a payload without downstream output events.
  • Keep multi-handler routing behavior unchanged.
  • Add runtime-local tests covering single-handler terminal publish and existing chained paths.

Verification

  • uv run pytest tests/unit/runtime/test_runtime_local_execution.py tests/unit/runtime/test_handler_wiring_resolver_integration.py tests/unit/runtime/test_container_wiring.py -q -> 81 passed
  • uv run ruff check src/omnibase_infra/runtime tests/unit/runtime/test_runtime_local_execution.py -> All checks passed
  • git diff --check -> PASS

Worktree cleanup

  • Worktree remains at /Users/jonah/Code/omni_home/omni_worktrees/OMN-12752/omnibase_infra pending PR merge and closeout.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates RuntimeLocal to explicitly resolve handler input topics and refines how terminal event output topics are selected. Handlers now receive computed input_topic values, and terminal wiring prefers a contract's terminal_event when it is present in configured publish_topics. A new integration test validates the behavior.

Changes

Handler input topic resolution and terminal event routing

Layer / File(s) Summary
Input topic resolution and terminal output wiring
src/omnibase_infra/runtime/runtime_local.py
Handler routing entries now compute input_topic via _resolve_handler_input_topic(...) with empty-string default. Terminal/terminal-reducer output wiring prefers the contract's terminal_event when present in publish_topics; otherwise falls back to publish_topics[0].
End-to-end test for handler terminal topic publishing
tests/unit/runtime/test_runtime_local_execution.py
New test test_single_event_handler_publishes_result_to_terminal_topic validates a single-handler workflow publishes results to the terminal topic, injects in-memory modules, runs async execution, and asserts workflow completion with expected payload in workflow_result.json.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 Topics now resolve with care and grace,
Terminal events find their proper place,
Handler inputs flow through logic true,
A test confirms what routing will do! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.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 directly and specifically describes the main change: routing terminal events for single handlers, which matches the core functionality added in the pull request.
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-12752-runtime-local-terminal-output

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

@jonahgabriel
jonahgabriel force-pushed the jonah/omn-12752-runtime-local-terminal-output branch from d451b3e to 3d88a74 Compare June 6, 2026 23:51
@jonahgabriel
jonahgabriel added this pull request to the merge queue Jun 7, 2026
Merged via the queue into dev with commit 4d26f3c Jun 7, 2026
133 of 140 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-12752-runtime-local-terminal-output branch June 7, 2026 00:51
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