feat(agent): scaffold the Beyond agent harness core#5
Merged
Conversation
Add two workspace crates that lay down the harness, modeled on Pi (badlogic/pi-mono) and ported to Rust: - beyond-ai-agent-core (lib `agent_core`): runtime- and network-agnostic core. The dialect-agnostic message model (Role/ContentBlock/Message/ ToolDef/StreamEvent/StopReason), the `Tool` + `ToolRegistry` extensibility seam, the `ModelTransport` network seam, `Session` state, and errors. No HTTP/provider/executor code, so it unit-tests with no network. - beyond-ai-agent (bin `beyond-ai-agent`): thin CLI shell. Targets the one-shot `run` and headless `serve` surface (both scaffolded); `tools` is a working no-network demo of the registry + async tool seam. The Beyond twist: the model layer never manages provider keys/endpoints — it speaks OpenAI/Anthropic wire to the gateway. The agent crate has no dependency on the gateway crate; its only contract is the HTTP wire. Workspace: add `async-trait` + `futures` to [workspace.dependencies] (gateway's async-trait now inherits from the workspace). mise: build:agent, run:agent, test:unit:agent. Verified: build · clippy -D warnings · cargo fmt --all --check · dprint check · 9 agent-core unit tests · gateway 99 unchanged · `beyond-ai-agent tools` demo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 30, 2026
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.
What
First slice of the agent harness — M1. Adds two workspace crates modeled on Pi (
pi-agent-core+ the dialect half ofpi-ai), ported to Rust:beyond-ai-agent-core(libagent_core) — runtime- and network-agnostic core:message— the dialect-agnostic conversation model (Role,ContentBlock,Message,ToolDef,StreamEvent,StopReason). One internal representation; wire adapters (next milestone) map it to/from OpenAI & Anthropic shapes.tool— theTooltrait +ToolRegistry. The extensibility seam: core tools (Read/Write/Edit/Bash) and Beyond primitives (fork/sync/logs) are all just registered tools.transport—ModelRequest+ theModelTransportseam. The loop depends only on this; the real gateway client and the testMockTransportboth implement it.session,error—serde-able run state; loop vs. tool errors.beyond-ai-agent(bin) — thin CLI shell exposing the eventualrun(one-shot) andserve(headless control API) surface. Both scaffolded;toolsis a working no-network demo proving the registry + async tool seam link end-to-end.The Beyond twist
The model layer never manages provider keys/endpoints — it speaks OpenAI/Anthropic wire to the gateway, which owns routing/auth/metering. The agent crate has zero dependency on the gateway crate; its only contract is the HTTP wire.
Out of scope (next milestones)
Wire dialect adapters (M2), HTTP-to-gateway transport (M3), the agent loop (M4), real tools (M6),
servecontrol API (M7). Therun/servecommands print a scaffold notice for now.Verification
cargo build·clippy --all-targets -D warnings·cargo fmt --all --check·dprint check· 9 agent-core unit tests · gateway 99 unchanged ·cargo run -p beyond-ai-agent -- toolsruns the demo. Added crates pinned to latest published (async-trait0.1.89,futures0.3.32).🤖 Generated with Claude Code