diff --git a/.gitignore b/.gitignore
index 04a16d35..93cd7ff0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -99,5 +99,5 @@ CLAUDE.md
# Codex CLI local artifacts
.codex/
-# QwenPaw sync state (generated each run; report is intentionally tracked)
-scripts/.qwenpaw-sync-state.json
+# Sync tooling local state (generated each run; report is intentionally tracked)
+scripts/.*-sync-state.json
diff --git a/mateclaw-server/pom.xml b/mateclaw-server/pom.xml
index a24982b3..47bec634 100644
--- a/mateclaw-server/pom.xml
+++ b/mateclaw-server/pom.xml
@@ -382,7 +382,7 @@
Why not the official {@code acp} Python SDK: MateClaw runs on the - * JVM. The protocol is JSON-RPC 2.0 line-delimited over stdio (per the - * QwenPaw reference at {@code C:/codes/QwenPaw}); the surface we need - * for "test connection" is small enough to implement directly. + * JVM. The protocol is JSON-RPC 2.0 line-delimited over stdio; the + * surface we need for "test connection" is small enough to implement + * directly. * *
Each {@link AcpStdioClient} instance owns one Process. Use * try-with-resources or call {@link #close()} explicitly. @@ -51,7 +51,7 @@ import java.util.function.Function; @Slf4j public class AcpStdioClient implements AutoCloseable { - /** ACP protocol version we advertise (matches QwenPaw v1 + Zed agents). */ + /** ACP protocol version we advertise (matches v1 ACP-compatible agents). */ public static final int PROTOCOL_VERSION = 1; private final ObjectMapper mapper; diff --git a/mateclaw-server/src/main/java/vip/mate/acp/model/AcpEndpointEntity.java b/mateclaw-server/src/main/java/vip/mate/acp/model/AcpEndpointEntity.java index f90cef02..88befe46 100644 --- a/mateclaw-server/src/main/java/vip/mate/acp/model/AcpEndpointEntity.java +++ b/mateclaw-server/src/main/java/vip/mate/acp/model/AcpEndpointEntity.java @@ -46,9 +46,9 @@ public class AcpEndpointEntity { private String envJson; /** - * call_title | call_detail | update_detail (mirrors QwenPaw - * {@code tool_parse_mode}). Drives how the wrapper renders ACP - * tool-call events into MateClaw's stream protocol. + * call_title | call_detail | update_detail (mirrors the ACP + * {@code tool_parse_mode} convention). Drives how the wrapper + * renders ACP tool-call events into MateClaw's stream protocol. */ private String toolParseMode; diff --git a/mateclaw-server/src/main/java/vip/mate/acp/service/AcpDelegationService.java b/mateclaw-server/src/main/java/vip/mate/acp/service/AcpDelegationService.java index 78d1c13e..59b4eab2 100644 --- a/mateclaw-server/src/main/java/vip/mate/acp/service/AcpDelegationService.java +++ b/mateclaw-server/src/main/java/vip/mate/acp/service/AcpDelegationService.java @@ -203,7 +203,7 @@ public class AcpDelegationService { * Extract plain text from an ACP {@code content} field. The shape * varies between agents — Zed uses {@code [{type:"text",text:"..."}]}, * some emit a single object, others nest in {@code resource.text}. - * Mirror QwenPaw's tolerant extractor. + * Tolerant extractor that handles all known shapes. */ private String extractText(JsonNode content) { if (content == null || content.isNull()) return ""; diff --git a/mateclaw-server/src/main/java/vip/mate/agent/AgentGraphBuilder.java b/mateclaw-server/src/main/java/vip/mate/agent/AgentGraphBuilder.java index 1e8e4a09..0d49a598 100644 --- a/mateclaw-server/src/main/java/vip/mate/agent/AgentGraphBuilder.java +++ b/mateclaw-server/src/main/java/vip/mate/agent/AgentGraphBuilder.java @@ -155,7 +155,7 @@ public class AgentGraphBuilder { // the agent's bound-skill requires-model. Falls back to the // global default when no preferred provider satisfies, so the // existing "no default model" error path stays intact. - // RFC-03 Lane G1 — honor per-Agent model override when set. + // Honor per-Agent model override when set. // resolveModel() looks up entity.modelName in enabled-only models; // null / blank / unmatched silently fall back to getDefaultModel(), // preserving the legacy behavior for Agents without an override. @@ -229,7 +229,7 @@ public class AgentGraphBuilder { } // Default 100 if DB row leaves max_iterations null; clamp per-agent overrides // to the hard ceiling (BaseAgent.MAX_ITERATIONS_HARD_CEILING) so a misconfigured - // row can never push an unbounded loop. Aligned with QwenPaw's 1..100 range. + // row can never push an unbounded loop. Effective range: 1..100. int rawMaxIter = entity.getMaxIterations() != null ? entity.getMaxIterations() : 100; int maxIter = Math.max(1, Math.min(rawMaxIter, BaseAgent.MAX_ITERATIONS_HARD_CEILING)); if (maxIter != rawMaxIter) { @@ -1099,10 +1099,10 @@ public class AgentGraphBuilder { } /** - * RFC-03 Lane B1 overload — accepts a per-model read-timeout override - * (seconds). Threaded into both the sync RestClient and streaming - * WebClient so timeout behavior is consistent across blocking and - * streaming chat completions. Null falls back to the default 180s. + * Overload that accepts a per-model read-timeout override (seconds). + * Threaded into both the sync RestClient and streaming WebClient so + * timeout behavior is consistent across blocking and streaming chat + * completions. Null falls back to the default 180s. */ public OpenAiApi buildOpenAiApi(ModelProviderEntity provider, Integer readTimeoutOverride) { if (provider == null || !modelProviderService.isProviderConfigured(provider.getProviderId())) { @@ -1489,8 +1489,8 @@ public class AgentGraphBuilder { } /** - * RFC-03 Lane B1 overload — accepts a per-model read-timeout override - * (seconds). Null falls back to the default 180s. + * Overload that accepts a per-model read-timeout override (seconds). + * Null falls back to the default 180s. */ private RestClient.Builder applyHttpTimeouts(RestClient.Builder builder, Integer readTimeoutOverride) { HttpClient httpClient = HttpClient.newBuilder() @@ -1521,7 +1521,7 @@ public class AgentGraphBuilder { } /** - * RFC-03 Lane B1 overload — same per-model override semantics as + * Overload with the same per-model override semantics as * {@link #applyHttpTimeouts(RestClient.Builder, Integer)}. */ private WebClient.Builder applyHttpTimeoutsToWebClient(WebClient.Builder builder, Integer readTimeoutOverride) { diff --git a/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java b/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java index 2480f93b..bcbe8d38 100644 --- a/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java +++ b/mateclaw-server/src/main/java/vip/mate/agent/BaseAgent.java @@ -49,7 +49,7 @@ public abstract class BaseAgent { /** * Max ReAct iterations (one reasoning + action + observation step counts as one). * Default 100, hard ceiling 100 (enforced in AgentGraphBuilder so per-agent DB - * overrides cannot exceed it). Aligned with QwenPaw's _MAX_MAX_ITERATIONS. + * overrides cannot exceed it). */ public static final int MAX_ITERATIONS_HARD_CEILING = 100; protected int maxIterations = 100; diff --git a/mateclaw-server/src/main/java/vip/mate/agent/graph/executor/ToolExecutionExecutor.java b/mateclaw-server/src/main/java/vip/mate/agent/graph/executor/ToolExecutionExecutor.java index 26803c79..a918bcb9 100644 --- a/mateclaw-server/src/main/java/vip/mate/agent/graph/executor/ToolExecutionExecutor.java +++ b/mateclaw-server/src/main/java/vip/mate/agent/graph/executor/ToolExecutionExecutor.java @@ -57,10 +57,10 @@ public class ToolExecutionExecutor { * this list. */ /** - * RFC-03 Lane A2 — defense against runaway single-response tool floods. + * Defense against runaway single-response tool floods. * *
Some models (StreamLake's kat-coder-pro-v1 has been observed - * emitting 50+ in one shot, see QwenPaw #2055) return huge {@code tool_calls} + * emitting 50+ in one shot) return huge {@code tool_calls} * batches in a single response. Without a cap, every call executes, which * can saturate downstream provider QPS, multiply approval rows, and burn * tokens. The cap is independent of {@code MAX_ITERATIONS} (which limits diff --git a/mateclaw-server/src/main/java/vip/mate/channel/MediaPathGuard.java b/mateclaw-server/src/main/java/vip/mate/channel/MediaPathGuard.java index 61598354..767c37de 100644 --- a/mateclaw-server/src/main/java/vip/mate/channel/MediaPathGuard.java +++ b/mateclaw-server/src/main/java/vip/mate/channel/MediaPathGuard.java @@ -16,7 +16,6 @@ import java.util.Set; * checks — extension allowlist here, size cap there, no path-traversal * guard at all. The result is 8 places to keep in sync when a new file * type is supported (or when a new exploit needs a defensive patch). - * Same gap as QwenPaw #1220. * *
This guard centralizes four checks that every adapter needs: *
Use cases (QwenPaw #2452): noon health-check cron that just + *
Use cases: noon health-check cron that just * pokes a database and writes structured output, project-weekly * report jobs that drop a file into a knowledge base, internal * pipelines that don't need an IM-visible "I did the thing" diff --git a/mateclaw-server/src/main/java/vip/mate/skill/acp/AcpSkillBridge.java b/mateclaw-server/src/main/java/vip/mate/skill/acp/AcpSkillBridge.java index 35ce9eeb..a200ec40 100644 --- a/mateclaw-server/src/main/java/vip/mate/skill/acp/AcpSkillBridge.java +++ b/mateclaw-server/src/main/java/vip/mate/skill/acp/AcpSkillBridge.java @@ -42,12 +42,10 @@ import java.util.concurrent.ConcurrentHashMap; * without manual binding. * *
This solves the "ACP configured as skill cannot be called" - * usability bug (matches the inspiration from QwenPaw's - * {@code delegate_external_agent} pattern, but keeps MateClaw's - * skill-card affordance for endpoint discovery): the user manages - * endpoints in Settings ▸ ACP Endpoints, and a card automatically - * appears on the Skills page — no per-endpoint SKILL.md authoring - * required. + * usability bug while keeping MateClaw's skill-card affordance for + * endpoint discovery: the user manages endpoints in Settings ▸ ACP + * Endpoints, and a card automatically appears on the Skills page — + * no per-endpoint SKILL.md authoring required. * *
Lifecycle: *
Returns {@code userShellEnv} verbatim when: *
Reads from the in-memory cache populated on connect/refresh, so the * call is non-blocking and safe to poll from the admin UI. diff --git a/mateclaw-server/src/main/java/vip/mate/tool/mcp/service/McpServerService.java b/mateclaw-server/src/main/java/vip/mate/tool/mcp/service/McpServerService.java index 01e2934e..58a2c713 100644 --- a/mateclaw-server/src/main/java/vip/mate/tool/mcp/service/McpServerService.java +++ b/mateclaw-server/src/main/java/vip/mate/tool/mcp/service/McpServerService.java @@ -162,8 +162,7 @@ public class McpServerService { } /** - * RFC-03 Lane A3 — list the tools the given MCP server has surfaced - * to the runtime (fixes QwenPaw #2495). + * List the tools the given MCP server has surfaced to the runtime. * *
Reads from {@link McpClientManager#getServerTools(Long)} which * already caches the {@code listTools()} response on connect/refresh, diff --git a/mateclaw-server/src/main/resources/db/migration/h2/V47__agent_max_iterations_100.sql b/mateclaw-server/src/main/resources/db/migration/h2/V47__agent_max_iterations_100.sql index 3175bb33..7c3f8b4d 100644 --- a/mateclaw-server/src/main/resources/db/migration/h2/V47__agent_max_iterations_100.sql +++ b/mateclaw-server/src/main/resources/db/migration/h2/V47__agent_max_iterations_100.sql @@ -1,8 +1,8 @@ --- V47: Bump default agents' max_iterations to 100 (QwenPaw-style hard ceiling). +-- V47: Bump default agents' max_iterations to 100 (hard ceiling). -- -- The previous defaults (25 for ReAct, 20 for plan-execute) ran the LimitExceededNode -- too eagerly on substantive multi-tool tasks (e.g. document generation with image --- conversion). New default is 100, matching QwenPaw's _MAX_MAX_ITERATIONS upper bound. +-- conversion). New default is 100, the hard upper bound enforced at runtime. -- AgentGraphBuilder still clamps any per-agent override to MAX_ITERATIONS_HARD_CEILING -- at runtime, so a user-configured 200 will be silently capped to 100. -- diff --git a/mateclaw-server/src/main/resources/db/migration/h2/V48__agent_max_iterations_and_agents_md_tools.sql b/mateclaw-server/src/main/resources/db/migration/h2/V48__agent_max_iterations_and_agents_md_tools.sql index 1e045cf5..c9b7294e 100644 --- a/mateclaw-server/src/main/resources/db/migration/h2/V48__agent_max_iterations_and_agents_md_tools.sql +++ b/mateclaw-server/src/main/resources/db/migration/h2/V48__agent_max_iterations_and_agents_md_tools.sql @@ -4,7 +4,7 @@ -- User-customized rows (any value other than 25/20) were silently skipped, so the -- StateGraph ReAct agent kept running with maxIterations=25 even after V47. -- V48 widens the condition: any seeded agent row with max_iterations < 100 gets --- bumped to 100, matching the QwenPaw-style ceiling. Custom rows above 100 still +-- bumped to 100, matching the hard ceiling. Custom rows above 100 still -- get clamped at runtime by AgentGraphBuilder. -- -- 2) AGENTS.md tool guidance: the workspace's seeded AGENTS.md only mentioned diff --git a/mateclaw-server/src/main/resources/db/migration/h2/V68__add_acp_endpoints.sql b/mateclaw-server/src/main/resources/db/migration/h2/V68__add_acp_endpoints.sql index aac62861..8fca6b39 100644 --- a/mateclaw-server/src/main/resources/db/migration/h2/V68__add_acp_endpoints.sql +++ b/mateclaw-server/src/main/resources/db/migration/h2/V68__add_acp_endpoints.sql @@ -1,6 +1,6 @@ -- V68: ACP (Agent Communication Protocol) endpoint registry (RFC-090 Phase 7) -- One row per external coding agent the user can delegate to over stdio. --- The 4 default rows mirror QwenPaw's bundled set (codex / claude-code / opencode / qwen-code). +-- The 4 default rows cover the common stdio agents (codex / claude-code / opencode / qwen-code). CREATE TABLE IF NOT EXISTS mate_acp_endpoint ( id BIGINT NOT NULL PRIMARY KEY, name VARCHAR(64) NOT NULL, @@ -11,12 +11,12 @@ CREATE TABLE IF NOT EXISTS mate_acp_endpoint ( args_json TEXT, env_json TEXT, -- Bookkeeping for the per-call parser. - -- One of call_title | call_detail | update_detail (matches QwenPaw tool_parse_mode). + -- One of call_title | call_detail | update_detail (matches the ACP tool_parse_mode convention). tool_parse_mode VARCHAR(32) NOT NULL DEFAULT 'call_title', builtin BOOLEAN NOT NULL DEFAULT FALSE, trusted BOOLEAN NOT NULL DEFAULT TRUE, enabled BOOLEAN NOT NULL DEFAULT FALSE, - -- Stdio buffer ceiling, default 50 MiB (mirrors QwenPaw default). + -- Stdio buffer ceiling, default 50 MiB. stdio_buffer_limit_bytes BIGINT NOT NULL DEFAULT 52428800, last_status VARCHAR(32), last_tested_at DATETIME, diff --git a/mateclaw-server/src/main/resources/db/migration/mysql/V47__agent_max_iterations_100.sql b/mateclaw-server/src/main/resources/db/migration/mysql/V47__agent_max_iterations_100.sql index 3175bb33..7c3f8b4d 100644 --- a/mateclaw-server/src/main/resources/db/migration/mysql/V47__agent_max_iterations_100.sql +++ b/mateclaw-server/src/main/resources/db/migration/mysql/V47__agent_max_iterations_100.sql @@ -1,8 +1,8 @@ --- V47: Bump default agents' max_iterations to 100 (QwenPaw-style hard ceiling). +-- V47: Bump default agents' max_iterations to 100 (hard ceiling). -- -- The previous defaults (25 for ReAct, 20 for plan-execute) ran the LimitExceededNode -- too eagerly on substantive multi-tool tasks (e.g. document generation with image --- conversion). New default is 100, matching QwenPaw's _MAX_MAX_ITERATIONS upper bound. +-- conversion). New default is 100, the hard upper bound enforced at runtime. -- AgentGraphBuilder still clamps any per-agent override to MAX_ITERATIONS_HARD_CEILING -- at runtime, so a user-configured 200 will be silently capped to 100. --