Files
oh-my-claudecode/docs/OPENCLAW-ROUTING.md
T
fc226e7547 chore(release): v4.7.10 - Bedrock routing, team hardening, session search (#1549)
* feat(setup): add rtk token optimization integration

* revert(setup): remove RTK integration from PR #1489

* fix(hooks): fail open on critical context exhaustion

* fix(skill): harden omc-teams tmux and agent validation

* Add Ralph critic selection for verification

* fix(doctor): accept supported omc config keys

* feat(openclaw): normalize native clawhip signals

* fix: skip legacy agent sync when plugin agents exist

* fix(hud): preserve stale usage limits on API failures

* Reduce startup OMC guidance context

* fix: clean up stale transient files on session end (#1510)

- session-end: cleanupTransientState now removes agent-replay-*.jsonl,
  last-tool-error.json, hud-state.json, hud-stdin-cache.json,
  idle-notif-cooldown.json, *-stop-breaker.json, cancel-signal files
  inside session dirs, and empty session directories
- keyword-detector: activateState adds project_path field for parity
  with TypeScript activateUltrawork in bridge.ts
- persistent-mode: readStateFileWithSession adds fallback scan of all
  session directories when session-scoped path lookup fails

* fix(hud): reduce transient usage API retry hammering (#1513)

* fix(hooks): add missing continue: false to persistent-mode.cjs Stop hook

The .cjs Stop hook outputs `{ decision: "block" }` without
`continue: false` when blocking stops for active modes. The original
fix (#1216) added `continue: false` to the .mjs scripts but the .cjs
version was never updated, and subsequent commits (#1306, #1330, #1374,
#1480, #1482) did not carry over this fix.

Since hooks.json references the .cjs version, the plugin Stop hook has
been missing hard-block capability, allowing sessions to end mid-execution.

- Add `continue: false` to all 12 blocking outputs in persistent-mode.cjs
- Add `continue: false` to context-guard-stop.mjs (1 output)
- Add `continue: false` to code-simplifier.mjs and its template (1 each)

Closes #1516

* feat(doc-specialist): add first-pass context hub guidance (#1519)

* Add skill pipeline handoff metadata (#1520)

* chore: remove stale root development artifacts (#1526)

* docs(rebrand): update scoped guidance docs (#1527)

* docs: rebrand main README to oh-my-openagent (#1528)

* docs: rebrand localized readmes to oh-my-openagent (#1529)

* revert: undo unauthorized rebrand PRs 1527-1529

* docs: fix outdated install references in REFERENCE.md

- Update platform support table: "curl or npm" → "Claude Code Plugin"
  for macOS/Linux, consistent with the deprecation notice at the top
  of the Installation section
- Replace deprecated curl uninstall one-liner with the plugin uninstall
  command (/plugin uninstall oh-my-claudecode@oh-my-claudecode)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: remove stale analytics references

* fix(team): port startup hardening from omx

* fix(team): finish runtime hardening port

* fix(team): resolve worktree mailbox trigger paths

* fix(hud): avoid repeated watch mode initialization

* feat: add session history search

* fix(team): require real startup evidence

* fix(routing): normalize explicit model IDs in all code paths (#1415)

The prior fix (PR #1464) only normalized auto-injected models but missed
two paths where full model IDs like 'claude-sonnet-4-6' leaked through:

1. enforceModel() passed explicitly-provided models as-is without
   normalizing to CC aliases (sonnet/opus/haiku)
2. buildLaunchArgs() in model-contract.ts passed model directly to
   --model flag for team worker launches

Extract normalizeToCcAlias() helper and apply it in both paths.
Add 5 tests covering explicit ID normalization and Bedrock ID handling.

Closes #1415

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore(release): bump version to v4.7.10

Version bumps:
- package.json: 4.7.9 → 4.7.10
- .claude-plugin/plugin.json: 4.7.9 → 4.7.10
- .claude-plugin/marketplace.json: 4.7.9 → 4.7.10
- CHANGELOG.md: Updated release header

Includes rebuilt dist artifacts for:
- Bedrock model routing fixes
- Team runtime hardening
- Session history search feature
- Lazy agent loading

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: ChoKhoOu <38033263+ChoKhoOu@users.noreply.github.com>
Co-authored-by: Yong <yong@levvels.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Carlos Cubas <carloscubas82@gmail.com>
2026-03-11 10:12:37 +09:00

3.2 KiB

OpenClaw / Clawhip Routing Contract

This document defines the normalized event contract OMC emits through the OpenClaw bridge for native Clawhip-style consumers.

Goals

  • Keep the raw hook event (event) for backward compatibility.
  • Add a normalized signal object for routing and dedupe-friendly filtering.
  • Make command/native gateways receive the same logical payload shape as HTTP gateways.

Payload shape

HTTP gateways receive JSON with this structure:

{
  "event": "post-tool-use",
  "instruction": "...",
  "timestamp": "2026-03-09T00:00:00.000Z",
  "sessionId": "...",
  "projectPath": "...",
  "projectName": "...",
  "tmuxSession": "...",
  "tmuxTail": "...",
  "signal": {
    "kind": "test",
    "name": "test-run",
    "phase": "failed",
    "routeKey": "test.failed",
    "priority": "high",
    "toolName": "Bash",
    "command": "pnpm test",
    "testRunner": "package-test",
    "summary": "FAIL src/example.test.ts | ..."
  },
  "context": {
    "sessionId": "...",
    "projectPath": "...",
    "toolName": "Bash"
  }
}

signal contract

Field Meaning
kind Routing family: session, tool, test, pull-request, question, keyword
name Stable logical signal name
phase Lifecycle phase: started, finished, failed, idle, detected, requested
routeKey Canonical routing key for downstream consumers
priority high for operational signals, low for generic tool noise

Additional fields may appear when applicable:

  • toolName
  • command
  • testRunner
  • prUrl
  • summary

Native command gateway contract

Command gateways now get the same normalized payload through both:

  • template variable: {{payloadJson}}
  • env var: OPENCLAW_PAYLOAD_JSON

They also receive convenience env vars:

  • OPENCLAW_SIGNAL_ROUTE_KEY
  • OPENCLAW_SIGNAL_PHASE
  • OPENCLAW_SIGNAL_KIND

That lets native Clawhip routing consume one contract whether the transport is HTTP or shell-command based.

Current high-priority route keys

  • session.started
  • session.finished
  • session.idle
  • question.requested
  • test.started
  • test.finished
  • test.failed
  • pull-request.started
  • pull-request.created
  • pull-request.failed
  • tool.failed

Generic tool.started / tool.finished remain available as low-priority fallback signals.

Noise reduction

  • AskUserQuestion now emits only the dedicated question.requested signal instead of also emitting generic tool lifecycle events.
  • Consumers should prefer signal.priority === "high" or explicit signal.routeKey filters instead of routing directly on raw hook names.

Stability notes

  • Raw event names are preserved for backward compatibility.
  • signal is the preferred routing surface for new native Clawhip integrations.
  • context remains a whitelisted subset; internal raw tool input/output are used only to derive normalized signals and are not forwarded in payload.context.