Skip to content

fix(OMN-12813): SEA generation output format — force fenced yaml+python blocks + exemplar, suppress reasoning - #1105

Merged
jonahgabriel merged 3 commits into
devfrom
jonah/omn-12813-sea-generation-output-format
Jun 7, 2026
Merged

jonahgabriel merged 3 commits into
devfrom
jonah/omn-12813-sea-generation-output-format

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Jun 7, 2026 •

Copy link
Copy Markdown
Contributor

Evidence-Source: OCC#2317
Evidence-Ticket: OMN-12813

Summary

Fixes the last-mile defect blocking a real SEA generation proof: Qwen3.6-35B-A3B returns reasoning prose ("1. Analyze the Request...") and bare YAML instead of the required two-fenced-block output, causing contract_passed=false with empty contract_yaml / handler_source in the generation_events projection row.

Changes

src/omnimarket/configs/inference_protocols.v1.yaml

  • Add local-qwen-generation-no-think: scoped to task_types: [node_generation] + model_name_patterns: [*qwen*]; prepends /no_think to user prompt to suppress reasoning tokens
  • Add local-qwen-generation-exemplar: same scope; appends a one-shot exemplar (yaml contract + python handler with the exact required output shape) to the system prompt via system_suffix directive
  • Both profiles are narrowed to task_type="node_generation" so they do NOT bleed into delegation, summarization, or code-generation calls

src/omnimarket/nodes/node_generation_consumer/handlers/handler_generation_consumer.py

Evidence

  • Ticket: OMN-12813 (child of OMN-12776)
  • DoD evidence: onex_change_control contracts/OMN-12813.yaml (OCC#2317) + in-repo deploy-evidence carrier docs/work-tracking/contracts/OMN-12813.yaml

Test results

  • 17 new unit tests in test_omn12813_output_format_fix.py — all pass
  • Full suite (rebased on dev incl. OMN-12801): 6459 passed, 9 skipped, 0 failed (no regressions)
  • mypy --strict: 0 issues across 2308 source files
  • All 20 pre-commit hooks: pass
  • Existing test_protocol_config.py (4 tests): pass — generation profiles do not affect summarization/delegation calls

Architecture notes

  • Exemplar is contract-declared in inference_protocols.v1.yaml — not hardcoded in Python (per feedback_contract_config_not_env_vars)
  • Reuses apply_inference_protocol from OMN-12738 — no new machinery
  • task_types scoping is critical: _profile_matches skips system_prompt_contains when task_type is provided, so profiles that omit task_types can leak. Both new profiles use task_types not system_prompt_contains.
  • w-deploy-2 can re-fire the e2e on stability-test lane after merge to get the POPULATED generation_events row

Related

Rebase + e2e (w-integration, 2026-06-07)

  • Rebased on current dev (d47986c, has OMN-12801). Merge conflict in handler_generation_consumer.py resolved to keep dev endpoint plumbing (_split_resolved_endpoint) + the OMN-12813 inference-protocol system_prompt.
  • e2e GREEN, independently verified: real generation_events rows with contract_passed=true + non-empty contract_yaml/handler_source on stability-test (corr 3409edcc / e22efff6 / e0cfba24, 23:00-23:05Z; verified via psql, verifier!=runner).

…on blocks + exemplar, suppress reasoning

Root cause: Qwen3.6-35B-A3B returns reasoning prose ("1. Analyze the
Request...") and bare YAML instead of the required two-fenced-block format,
causing contract_passed=false + empty contract_yaml/handler_source in the
generation_events projection row.

Changes:
- Strengthen _DEFAULT_SYSTEM_PROMPT: explicit "ONLY two fenced code blocks,
  nothing else" directive (no chain-of-thought, no numbered analysis steps)
- Add two inference protocol profiles in inference_protocols.v1.yaml scoped
  to task_type="node_generation":
  * local-qwen-generation-no-think: prepends /no_think to user prompt for
    Qwen models (suppresses reasoning tokens)
  * local-qwen-generation-exemplar: appends a one-shot exemplar (```yaml +
    ```python with the exact required output shape) to the system prompt
- Wire apply_inference_protocol into HandlerGenerationConsumer._call_llm
  with task_type="node_generation" so both profiles fire for Qwen
- Non-Qwen models and non-generation task types are unaffected (task_types
  scoping prevents the exemplar from bleeding into delegation/summarization)

Tests (17 new, 0 regressions out of 6338):
- _DEFAULT_SYSTEM_PROMPT contains "ONEX node generator" marker + prose suppression
- Profiles fire for Qwen + node_generation, silent for other models/task types
- apply_once prevents /no_think double-insertion
- validate_generation: well-formed response → contract_passed=True
- validate_generation: reasoning-prose response → contract_passed=False
- Handler wires apply_inference_protocol: exemplar in system_prompt, /no_think
  in user_prompt for Qwen
- End-to-end: well-formed LLM response → contract_passed=True + non-empty
  contract_yaml + non-empty handler_source

Reuses OMN-12738 (PR #1065) inference_protocols machinery.
Exemplar is the proven stabilizer from context_matrix_v3 findings.
dod_evidence: 17 new tests pass, 6338/0 full suite, mypy --strict clean,
pre-commit clean, generation profiles scoped to node_generation task type.
@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@jonahgabriel, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 20 minutes and 38 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 962a5c52-9d63-43a1-910e-1670c2f170db

📥 Commits

Reviewing files that changed from the base of the PR and between d47986c and 94e07e9.

📒 Files selected for processing (4)
  • docs/work-tracking/contracts/OMN-12813.yaml
  • src/omnimarket/configs/inference_protocols.v1.yaml
  • src/omnimarket/nodes/node_generation_consumer/handlers/handler_generation_consumer.py
  • tests/unit/nodes/node_generation_consumer/test_omn12813_output_format_fix.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonah/omn-12813-sea-generation-output-format

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

…neration-output-format

# Conflicts:
#	src/omnimarket/nodes/node_generation_consumer/handlers/handler_generation_consumer.py
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

⚠️ Architectural Review — WARNINGS

Errors: 0
Warnings: 1

What this checks

Rule Description
ARCH-TOPIC-001 No hardcoded Kafka topic strings in handler code
ARCH-DI-001 No event_bus=None bypass
ARCH-DI-002 No direct Handler instantiation outside workflow_runner/adapters
ARCH-DI-003 No reinvented DI containers
ARCH-TOPIC-002 contract.yaml topics follow `onex.{cmd

ARCH-DI-002: Direct Handler instantiation (warning)\n\n\nsrc/omnimarket/nodes/node_generation_consumer/handlers/handler_generation_consumer.py:491: self._effect = HandlerLlmOpenaiCompatible(transport=_Transport())\n\n\nHandler classes should be wired only in workflow_runner.py or adapter modules. Direct instantiation elsewhere bypasses the contract system.\n\n

Powered by node_pr_review_bot

@github-actions

github-actions Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

✅ PR Review Bot — CLEAN

Findings: 0
Run ID: ``

Required gate: This check blocks merge when verdict is blocking_issue.


Verdict semantics

Verdict Meaning
clean No blocking findings
risks_noted Findings noted; threads passed judge verification
blocking_issue MAJOR/CRITICAL findings not resolved — do not merge

Powered by node_pr_review_bot — Qwen3-Coder-30B reviewer + DeepSeek-R1 judge (OMN-7963)

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

⚠️ Hostile Reviewer — DEGRADED (informational)

Blocking findings (critical/error): 0
Total findings: 0
Models succeeded: none

Note: All reviewer models failed or were unavailable. Degraded results are informational during the pilot phase (OMN-8524) and do not block merge. Error: cli_review exited non-zero (all models failed or binary error)


Gate semantics (pilot phase)

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)

@jonahgabriel
jonahgabriel added this pull request to the merge queue Jun 7, 2026
Merged via the queue into dev with commit 38700b7 Jun 7, 2026
50 of 56 checks passed
@jonahgabriel
jonahgabriel deleted the jonah/omn-12813-sea-generation-output-format branch June 7, 2026 23:42
andywu42 pushed a commit to andywu42/omnimarket that referenced this pull request Jun 10, 2026
…t env vars (OmniNode-ai#687)

* fix(OMN-11182): resolve generation consumer endpoint via contract, not env vars

Replace bespoke GENERATION_CONSUMER_ENDPOINT/MODEL_ID/API_KEY/PROVIDER/ENDPOINT_CLASS
env vars with contract-first endpoint resolution.

- contract.yaml: add model_routing section (endpoint_env, model_id, auth) and
  dependencies entries (type: environment, key:) for LLM_CODER_URL,
  LOCAL_LLM_SHARED_SECRET, LLM_ENDPOINT_CIDR_ALLOWLIST so the overlay resolver
  knows these are required and populates them at boot
- handler: read endpoint_env and model_id from contract model_routing at
  construction time; resolve the actual URL from os.environ[self._endpoint_env]
  (LLM_CODER_URL) rather than GENERATION_CONSUMER_ENDPOINT at call time
- tests: 4 new unit tests verify contract declares correct model_routing and
  dependency keys, and that the handler falls back correctly when section absent

* fix(OMN-11182): remove IP examples from contract descriptions; add deploy-gate DoD contract

- contract.yaml: stripped 192.168.86.201 examples from dependency
  descriptions to pass Leaked Literals Gate
- docs/work-tracking/contracts/OMN-11182.yaml: added deploy-gate
  contract with dod-deploy evidence item (docker exec import check)

* fix(OMN-11182): add dod-occ-pr evidence item binding to OCC PR OmniNode-ai#1105

* ci(OMN-11182): retrigger receipt gate after OCC probe_stdout fix

* ci(OMN-11182): retrigger receipt gate after dod-occ-pr commit_sha fix

* ci(OMN-11182): retrigger receipt gate after adding Evidence-Ticket line

* fix(OMN-11182): accept OPEN or MERGED state in dod-occ-pr check (CodeRabbit)
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