refactor: dedupe agent and reply runtimes

This commit is contained in:
Peter Steinberger
2026-03-02 19:47:30 +00:00
parent 8768487aee
commit 9617ac9dd5
53 changed files with 1828 additions and 1176 deletions

View File

@@ -1,5 +1,3 @@
import type { AgentTool, AgentToolResult } from "@mariozechner/pi-agent-core";
import { Type } from "@sinclair/typebox";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import {
@@ -7,16 +5,7 @@ import {
isToolAllowedByPolicyName,
resolveSubagentToolPolicy,
} from "./pi-tools.policy.js";
function createStubTool(name: string): AgentTool {
return {
name,
label: name,
description: "",
parameters: Type.Object({}),
execute: async () => ({}) as AgentToolResult<unknown>,
};
}
import { createStubTool } from "./test-helpers/pi-tool-stubs.js";
describe("pi-tools.policy", () => {
it("treats * in allow as allow-all", () => {