Repository navigation
release(r1): cross-runtime AgentMesh first-class tool wrappers - #184
Merged
Merged
Conversation
R1 batch 2 — three small, independent release-readiness fixes. 1) mesh_inbox tool description (`mesh-plugin` + `openclaw` plugins): adds an explicit "ALWAYS call this tool FIRST whenever your task description says a peer agent has sent you data" line. Without this, models routinely write a fresh response instead of picking up the parent's KNOCK message, breaking inter-agent handoff. Tool semantics unchanged — description only. 2) BYO strict-mode reference: adds an intentionally-invalid CR (`examples/byo-quickstart/k8s/clawsandbox-strict-demo.yaml` with `contractVersion: v999`) plus a §5 walkthrough in the example README that flips `controller.byoStrict=true` and observes the `BYOContractInvalid` Degraded condition. Production-deployment recipe for the strict gate that already exists in the controller. 3) Stale comment cleanup in `controller/src/reconciler/runtime.rs`: the LangGraph dispatch was annotated "TS gated as ShapeInvalid" from before the TS adapter shipped (PR #182). Updated to reflect that both Python and TypeScript flavours are wired end-to-end. No behavioural change to wired runtimes; no new public API surface. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a `mesh_tools.py` module to all 5 Python runtime adapters (openai-agents, maf-python, langgraph, anthropic, pydantic-ai). Each exposes `build_mesh_tools()` returning native Tool objects of the runtime's framework — `agents.function_tool` for openai-agents, `agent_framework.ai_function` for MAF, `langchain_core.tools.tool` for LangGraph, `claude_agent_sdk.tool` for Anthropic, and `pydantic_ai.Tool` for Pydantic-AI. Two tools are registered per runtime: * `mesh_inbox()` — drains pending AgentMesh messages. Description carries the explicit "INBOX-FIRST" nudge (matching the mesh-plugin / OpenClaw nudge in PR #183) so models reliably pick up parent KNOCK messages after a handoff. * `mesh_send(target_agent, content, skill_id)` — sends an A2A TaskEnvelope to a peer agent. Framework SDKs are imported lazily inside `build_mesh_tools()` (matches the `tools.py` Foundry-tools pattern), so unit tests that don't have the SDK installed degrade to the smoke-test path. Smoke tests added for openai-agents and maf-python (the two adapters with an existing pytest setup); langgraph / anthropic / pydantic-ai get the production code now and tests will follow with their pytest infrastructure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pal Lakatos-Toth (pallakatos)
force-pushed
the
feat/release-r1-batch3
branch
from
May 3, 2026 21:28
eb78e2d to
f26074e
Compare
The runtime image-override tests (e.g. openai_agents_default_image_*) all share a process-global env var. Rust's default test harness runs multiple threads concurrently, so tests like `openai_agents_default_image_honours_env_override` would set "myacr.azurecr.io/openai-agents:pinned" while `openai_agents_default_image_treats_blank_env_as_unset` happened to read it, producing a flaky failure that bit PR #184 CI: left: "myacr.azurecr.io/openai-agents:pinned" right: "azureclawacr.azurecr.io/azureclaw-runtime-openai-agents:latest" Added a module-local `ENV_LOCK: Mutex<()>` and have every test that mutates a *_RUNTIME_IMAGE env var take `_g = ENV_LOCK.lock()...` at its top. Uses unwrap_or_else(into_inner) so a panicking sibling test doesn't poison the lock for everyone else. 20 tests instrumented. Full controller test suite: 483 passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pal Lakatos-Toth (pallakatos)
added a commit
that referenced
this pull request
May 12, 2026
* release(r1): mesh_inbox INBOX-FIRST nudge + BYO strict-mode demo R1 batch 2 — three small, independent release-readiness fixes. 1) mesh_inbox tool description (`mesh-plugin` + `openclaw` plugins): adds an explicit "ALWAYS call this tool FIRST whenever your task description says a peer agent has sent you data" line. Without this, models routinely write a fresh response instead of picking up the parent's KNOCK message, breaking inter-agent handoff. Tool semantics unchanged — description only. 2) BYO strict-mode reference: adds an intentionally-invalid CR (`examples/byo-quickstart/k8s/clawsandbox-strict-demo.yaml` with `contractVersion: v999`) plus a §5 walkthrough in the example README that flips `controller.byoStrict=true` and observes the `BYOContractInvalid` Degraded condition. Production-deployment recipe for the strict gate that already exists in the controller. 3) Stale comment cleanup in `controller/src/reconciler/runtime.rs`: the LangGraph dispatch was annotated "TS gated as ShapeInvalid" from before the TS adapter shipped (PR #182). Updated to reflect that both Python and TypeScript flavours are wired end-to-end. No behavioural change to wired runtimes; no new public API surface. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * release(r1): cross-runtime AgentMesh first-class tool wrappers Adds a `mesh_tools.py` module to all 5 Python runtime adapters (openai-agents, maf-python, langgraph, anthropic, pydantic-ai). Each exposes `build_mesh_tools()` returning native Tool objects of the runtime's framework — `agents.function_tool` for openai-agents, `agent_framework.ai_function` for MAF, `langchain_core.tools.tool` for LangGraph, `claude_agent_sdk.tool` for Anthropic, and `pydantic_ai.Tool` for Pydantic-AI. Two tools are registered per runtime: * `mesh_inbox()` — drains pending AgentMesh messages. Description carries the explicit "INBOX-FIRST" nudge (matching the mesh-plugin / OpenClaw nudge in PR #183) so models reliably pick up parent KNOCK messages after a handoff. * `mesh_send(target_agent, content, skill_id)` — sends an A2A TaskEnvelope to a peer agent. Framework SDKs are imported lazily inside `build_mesh_tools()` (matches the `tools.py` Foundry-tools pattern), so unit tests that don't have the SDK installed degrade to the smoke-test path. Smoke tests added for openai-agents and maf-python (the two adapters with an existing pytest setup); langgraph / anthropic / pydantic-ai get the production code now and tests will follow with their pytest infrastructure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(controller): serialize env-mutating runtime tests The runtime image-override tests (e.g. openai_agents_default_image_*) all share a process-global env var. Rust's default test harness runs multiple threads concurrently, so tests like `openai_agents_default_image_honours_env_override` would set "myacr.azurecr.io/openai-agents:pinned" while `openai_agents_default_image_treats_blank_env_as_unset` happened to read it, producing a flaky failure that bit PR #184 CI: left: "myacr.azurecr.io/openai-agents:pinned" right: "azureclawacr.azurecr.io/azureclaw-runtime-openai-agents:latest" Added a module-local `ENV_LOCK: Mutex<()>` and have every test that mutates a *_RUNTIME_IMAGE env var take `_g = ENV_LOCK.lock()...` at its top. Uses unwrap_or_else(into_inner) so a panicking sibling test doesn't poison the lock for everyone else. 20 tests instrumented. Full controller test suite: 483 passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Pal Lakatos-Toth <pallakatos@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
R1 Batch 3 — cross-runtime mesh tool exposure
Stacked on #182 (R1 batch 1) and #183 (R1 batch 2).
Adds a
mesh_tools.pymodule to all 5 Python runtime adapters(openai-agents, maf-python, langgraph, anthropic, pydantic-ai). Each
exposes
build_mesh_tools()returning native Tool objects of theruntime's framework. Two tools are registered per runtime:
mesh_inbox()— drains pending AgentMesh messages. Descriptioncarries the explicit "INBOX-FIRST" nudge (matching the mesh-plugin
/ OpenClaw nudge in release(r1): mesh_inbox nudge + BYO strict-mode demo + stale comment fix #183).
mesh_send(target_agent, content, skill_id)— sends an A2ATaskEnvelope to a peer agent.
Framework SDKs are imported lazily inside
build_mesh_tools()(matchesthe existing Foundry-tools pattern in
tools.py).Verification
test_tools.pypattern mirrored.additive.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com